]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ast.c
Fix some comments
[xonotic/gmqcc.git] / ast.c
diff --git a/ast.c b/ast.c
index 332f708fbad59d4c9c951e728641df9494c57ba8..f814847714d5d158ed8ebd15a5bd87a3d1cfd1dc 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1025,7 +1025,7 @@ bool ast_call_check_types(ast_call *self, ast_expression *va_type)
 
     for (i = 0; i < count; ++i) {
         if (ast_istype(self->params[i], ast_argpipe)) {
-            // warn about type safety instead
+            /* warn about type safety instead */
             if (i+1 != count) {
                 compile_error(ast_ctx(self), "argpipe must be the last parameter to a function call");
                 return false;
@@ -1047,7 +1047,7 @@ bool ast_call_check_types(ast_call *self, ast_expression *va_type)
     if (count > vec_size(func->params) && func->varparam) {
         for (; i < count; ++i) {
             if (ast_istype(self->params[i], ast_argpipe)) {
-                // warn about type safety instead
+                /* warn about type safety instead */
                 if (i+1 != count) {
                     compile_error(ast_ctx(self), "argpipe must be the last parameter to a function call");
                     return false;
@@ -1055,11 +1055,11 @@ bool ast_call_check_types(ast_call *self, ast_expression *va_type)
                 if (!ast_call_check_vararg(self, va_type, func->varparam))
                     retval = false;
             }
-            if (!ast_compare_type(self->params[i], func->varparam))
+            else if (!ast_compare_type(self->params[i], func->varparam))
             {
                 ast_type_to_string(self->params[i], tgot, sizeof(tgot));
                 ast_type_to_string(func->varparam, texp, sizeof(texp));
-                compile_error(ast_ctx(self), "invalid type for parameter %u in function call: expected %s, got %s",
+                compile_error(ast_ctx(self), "invalid type for variadic parameter %u in function call: expected %s, got %s",
                          (unsigned int)(i+1), texp, tgot);
                 /* we don't immediately return */
                 retval = false;