From b0abeba29bb6661c8e580486c8f969b6ef841af8 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sat, 22 Jul 2023 19:27:29 +1000 Subject: [PATCH] strcat(): update QC defs to match implementation Xonotic was defining strcat1n to allow single-arg cases without boilerplate... Signed-off-by: bones_was_here --- clvm_cmds.c | 2 +- dpdefs/csprogsdefs.qc | 2 +- dpdefs/dpextensions.qc | 2 +- dpdefs/menudefs.qc | 2 +- prvm_cmds.c | 6 +++--- svvm_cmds.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clvm_cmds.c b/clvm_cmds.c index 05bb57a9..8ccc97fa 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -5090,7 +5090,7 @@ VM_fclose, // #111 void(float fhandle) fclose (FRIK_FILE) VM_fgets, // #112 string(float fhandle) fgets (FRIK_FILE) VM_fputs, // #113 void(float fhandle, string s) fputs (FRIK_FILE) VM_strlen, // #114 float(string s) strlen (FRIK_FILE) -VM_strcat, // #115 string(string s1, string s2, ...) strcat (FRIK_FILE) +VM_strcat, // #115 string(string s, string...) strcat (FRIK_FILE) VM_substring, // #116 string(string s, float start, float length) substring (FRIK_FILE) VM_stov, // #117 vector(string) stov (FRIK_FILE) VM_strzone, // #118 string(string s) strzone (FRIK_FILE) diff --git a/dpdefs/csprogsdefs.qc b/dpdefs/csprogsdefs.qc index b396e84b..d78e6b0b 100644 --- a/dpdefs/csprogsdefs.qc +++ b/dpdefs/csprogsdefs.qc @@ -430,7 +430,7 @@ void(float fhandle) fclose = #111; string(float fhandle) fgets = #112; void(float fhandle, string s) fputs = #113; float(string s) strlen = #114; -string(...) strcat = #115; +string(string s, string...) strcat = #115; string(string s, float start, float length) substring = #116; vector(string) stov = #117; string(string s) strzone = #118; diff --git a/dpdefs/dpextensions.qc b/dpdefs/dpextensions.qc index 73996cbf..faf6dcdd 100644 --- a/dpdefs/dpextensions.qc +++ b/dpdefs/dpextensions.qc @@ -2140,7 +2140,7 @@ void(float fhandle) fclose = #111; // closes a file string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring void(float fhandle, string s, ...) fputs = #113; // writes a line of text to the end of the file float(string s) strlen = #114; // returns how many characters are in a string -string(string s1, string s2, ...) strcat = #115; // concatenates two or more strings (for example "abc", "def" would return "abcdef") and returns as a tempstring +string(string s, string...) strcat = #115; // concatenates 1 to 8 strings (for example "abc", "def" would return "abcdef") and returns as a tempstring string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring - see FTE_STRINGS for enhanced version vector(string s) stov = #117; // returns vector value from a string string(string s, ...) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often) diff --git a/dpdefs/menudefs.qc b/dpdefs/menudefs.qc index 1278dd71..b987491b 100644 --- a/dpdefs/menudefs.qc +++ b/dpdefs/menudefs.qc @@ -246,7 +246,7 @@ string fgets(float fhandle) = #50; void fputs(float fhandle, string s) = #51; float strlen(string s) = #52; -string strcat(string s1,string s2,...) = #53; +string strcat(string s, string...) = #53; string substring(string s, float start, float length) = #54; vector stov(string s) = #55; diff --git a/prvm_cmds.c b/prvm_cmds.c index e8c54bb2..0d281e62 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -2322,11 +2322,11 @@ void VM_strtoupper(prvm_prog_t *prog) ========= VM_strcat -string strcat(string,string,...[string]) +string strcat(string s, string...) ========= */ -//string(string s1, string s2) strcat = #115; -// concatenates two strings (for example "abc", "def" would return "abcdef") +//string(string s, string...) strcat = #115; +// concatenates strings (for example "abc", "def" would return "abcdef") // and returns as a tempstring void VM_strcat(prvm_prog_t *prog) { diff --git a/svvm_cmds.c b/svvm_cmds.c index 3692bc2f..a9d50af1 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -3379,7 +3379,7 @@ VM_fclose, // #111 void(float fhandle) fclose (FRIK_FILE) VM_fgets, // #112 string(float fhandle) fgets (FRIK_FILE) VM_fputs, // #113 void(float fhandle, string s) fputs (FRIK_FILE) VM_strlen, // #114 float(string s) strlen (FRIK_FILE) -VM_strcat, // #115 string(string s1, string s2, ...) strcat (FRIK_FILE) +VM_strcat, // #115 string(string s, string...) strcat (FRIK_FILE) VM_substring, // #116 string(string s, float start, float length) substring (FRIK_FILE) VM_stov, // #117 vector(string) stov (FRIK_FILE) VM_strzone, // #118 string(string s) strzone (FRIK_FILE) -- 2.39.2