X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fvarargs.qc;h=4b0d80686e079be78b63f3c0a2f95e0768062a83;hb=6d6a2efadac46d5f8d2b44e5f73bd94549529681;hp=ffe7d1b6b34b152ffa9b2a12751f6302464a0f70;hpb=61b777f5757e5fa085e5a9caa08ba8da2739455d;p=xonotic%2Fgmqcc.git diff --git a/tests/varargs.qc b/tests/varargs.qc index ffe7d1b..4b0d806 100644 --- a/tests/varargs.qc +++ b/tests/varargs.qc @@ -1,6 +1,3 @@ -void(string...) print = #1; -string(float) ftos = #2; - void nbva(float a, string...count) { print("You gave me ", ftos(count), " additional parameters\n"); print("First: ", ...(0, string), "\n"); @@ -9,6 +6,15 @@ void nbva(float a, string...count) { print("Vararg ", ftos(a), " = ", ...(a, string), "\n"); } +var void unstable(...); +void stability(float a, float b, ...count) +{ + print("Got: ", ftos(count), "\n"); +} + void main() { nbva(1, "Hello", "You", "There"); + stability(1, 2, 3, 4, 5); + unstable = stability; + unstable(1, 2, 3, 4, 5); }