]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
add some failcases... get rid of -Oassignments
authorRudolf Polzer <divverent@xonotic.org>
Thu, 26 Apr 2012 10:58:47 +0000 (12:58 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 26 Apr 2012 10:58:47 +0000 (12:58 +0200)
qcsrc/Makefile
qcsrc/fteqcc-bugs.qc [new file with mode: 0644]
qcsrc/server/command/common.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/miscfunctions.qc

index 27f6fc993aa0c12c1e372a7b36c25922fcce7995..8961c4d41e74226665bc97d4b5a77083ed0ae1fb 100644 (file)
@@ -3,7 +3,7 @@ FTEQCC ?= fteqcc
 PERL ?= perl
 
 FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON
-FTEQCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-return_only -fno-fastarrays $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
+FTEQCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-return_only -Ono-assignment -fno-fastarrays $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
 FTEQCCFLAGS_PROGS ?=
 FTEQCCFLAGS_MENU ?=
 
diff --git a/qcsrc/fteqcc-bugs.qc b/qcsrc/fteqcc-bugs.qc
new file mode 100644 (file)
index 0000000..e426e93
--- /dev/null
@@ -0,0 +1,23 @@
+void error(...) = #1;
+
+void Oassignments(float foo) // pass 1
+{
+       float bar;
+       bar = 2;
+       bar = (foo ? 0 : (foo & 1));
+       if(bar == 2)
+               error("FTEQCC SUCKS");
+}
+
+void Oreturn_only(float foo) // pass 0
+{
+       if(foo)
+       {
+               return;
+       }
+}
+
+void Oreturn_only_trap(void)
+{
+       error("FTEQCC SUCKS");
+}
index d26f3279c87b17b65d38eb0a5a29a60fbf79bfd3..13e667ad87123b72c7a282f3633d6940ec1abbd1 100644 (file)
@@ -63,6 +63,7 @@ entity GetIndexedEntity(float argc, float start_index)
        
        next_token = -1;
        index = start_index;
+       selection = world;
        
        if(argc > start_index)
        {
@@ -80,6 +81,8 @@ entity GetIndexedEntity(float argc, float start_index)
                                tmp_number = stof(argv(index));
                                ++index;
                        }
+                       else
+                               tmp_number = 0;
                }
                else // maybe it's ONLY a number?
                {
@@ -123,6 +126,7 @@ entity GetFilteredEntity(string input)
        }
        else
        {
+               selection = world;
                FOR_EACH_CLIENT(tmp_player)
                        if (strdecolorize(tmp_player.netname) == strdecolorize(input))
                                selection = tmp_player;
@@ -137,7 +141,7 @@ float GetFilteredNumber(string input)
        entity selection = GetFilteredEntity(input);
        float output;
        
-       if(selection) { output = num_for_edict(selection); }
+       output = num_for_edict(selection);
 
        return output;
 }
index 045409b471d9d28d7215869d6067b1c4e4b96e5c..10f725f32f7c3e6cf815f731e71125076c571bbe 100644 (file)
@@ -1425,7 +1425,6 @@ void GameCommand_trace(float request, float argc)
                                                        {
                                                                rint(42); // do an engine breakpoint on VM_rint so you can get the trace that errnoeously returns startsolid
                                                                tracebox(start, PL_MIN, PL_MAX, end, MOVE_NOMONSTERS, world);
-                                                               tracebox(p, PL_MIN, PL_MAX, q, MOVE_NOMONSTERS, world);
 
                                                                if(trace_startsolid)
                                                                {
index 3686568d83b123b0a036d578bc7b92ba66db9853..996d217ed9fd25ae4d9714e3606bb0e963a1d659 100644 (file)
@@ -526,7 +526,7 @@ string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(string wo)
 }
 void GetCvars(float f)
 {
-       string s;
+       string s = string_null;
 
        if (f > 0)
                s = strcat1(argv(f));