Răsfoiți Sursa

Fixed some Sun Studio warnings about unreachable code.

Ryan C. Gordon 17 ani în urmă
părinte
comite
07e97a0166
3 a modificat fișierele cu 4 adăugiri și 7 ștergeri
  1. 0 2
      src/archiver_zip.c
  2. 0 1
      src/physfs.c
  3. 4 4
      src/physfs_unicode.c

+ 0 - 2
src/archiver_zip.c

@@ -157,8 +157,6 @@ static const char *zlib_error_string(int rc)
         case Z_VERSION_ERROR: return(ERR_VERSION_ERROR);
         default: return(ERR_UNKNOWN_ERROR);
     } /* switch */
-
-    return(NULL);
 } /* zlib_error_string */
 
 

+ 0 - 1
src/physfs.c

@@ -696,7 +696,6 @@ static char *calculateBaseDir(const char *argv0)
 
     /* argv0 wasn't helpful. */
     BAIL_MACRO(ERR_INVALID_ARGUMENT, NULL);
-    return(NULL);
 } /* calculateBaseDir */
 
 

+ 4 - 4
src/physfs_unicode.c

@@ -392,11 +392,11 @@ int __PHYSFS_utf8strcasecmp(const char *str1, const char *str2)
     {
         const PHYSFS_uint32 cp1 = utf8codepoint(&str1);
         const PHYSFS_uint32 cp2 = utf8codepoint(&str2);
-        if (!utf8codepointcmp(cp1, cp2)) return 0;
+        if (!utf8codepointcmp(cp1, cp2)) break;
         if (cp1 == 0) return 1;
     } /* while */
 
-    return 0;  /* shouldn't hit this. */
+    return 0;
 } /* __PHYSFS_utf8strcasecmp */
 
 
@@ -428,10 +428,10 @@ int __PHYSFS_stricmpASCII(const char *str1, const char *str2)
         else if (cp1 > cp2)
             return 1;
         else if (cp1 == 0)  /* they're both null chars? */
-            return 0;
+            break;
     } /* while */
 
-    return 0;  /* shouldn't hit this. */
+    return 0;
 } /* __PHYSFS_stricmpASCII */