assorted warning fixes
[pcsx_rearmed.git] / plugins / dfxvideo / gpulib_if.c
index d98520c..ff0c96c 100644 (file)
@@ -260,6 +260,10 @@ unsigned short sSetMask = 0;
 unsigned long  lSetMask = 0;
 long           lLowerpart;
 
+#if defined(__GNUC__) && __GNUC__ >= 6
+#pragma GCC diagnostic ignored "-Wmisleading-indentation"
+#endif
+
 #include "soft.c"
 #include "prim.c"
 
@@ -342,7 +346,12 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
 
         while(1)
         {
-          if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end)
+          if(list_position >= list_end) {
+            cmd = -1;
+            goto breakloop;
+          }
+
+          if((*list_position & 0xf000f000) == 0x50005000)
             break;
 
           list_position++;
@@ -360,7 +369,12 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
 
         while(1)
         {
-          if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end)
+          if(list_position >= list_end) {
+            cmd = -1;
+            goto breakloop;
+          }
+
+          if((*list_position & 0xf000f000) == 0x50005000)
             break;
 
           list_position += 2;
@@ -386,6 +400,7 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
     }
   }
 
+breakloop:
   gpu.ex_regs[1] &= ~0x1ff;
   gpu.ex_regs[1] |= lGPUstatusRet & 0x1ff;