]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Enable C4254,C4295,C4514 and C4702 on MSVC.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sat, 25 Feb 2012 07:45:19 +0000 (16:45 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sat, 25 Feb 2012 07:45:19 +0000 (16:45 +0900)
CMakeLists.txt
libarchive/archive_read.c

index bcaf84318bc6b6cf4c877026e9f53bf51a81b1d2..3aca2bea3af333ab391d1d47ec115534b30b8258 100644 (file)
@@ -76,6 +76,13 @@ IF (MSVC)
   # Enable level 4 C4061: The enumerate has no associated handler in a switch
   #                       statement.
   SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061")
+  # Enable level 4 C4254: A larger bit field was assigned to a smaller bit
+  #                       field.
+  SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254")
+  # Enable level 4 C4295: An array was initialized but the last character in
+  #                       the array is not a null; accessing the array may
+  #                       produce unexpected results.
+  SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4295")
   # Enable level 4 C4296: An unsigned variable was used in a comparison
   #                       operation with zero.
   SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4296")
@@ -86,6 +93,11 @@ IF (MSVC)
   #                       the body of the module; therefore, the function is
   #                       dead code.
   SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4505")
+  # Enable level 4 C4514: The optimizer removed an inline function that is not
+  #                       called.
+  SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4514")
+  # Enable level 4 C4702: Unreachable code.
+  SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4702")
   # Enable level 4 C4706: The test value in a conditional expression was the
   #                       result of an assignment.
   SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4706")
index 42eb06192b7cc02b324138d75b3b1fa2d85acd5b..e99906f825aeea43d57af5d7dd01a3ce54704908 100644 (file)
@@ -201,7 +201,6 @@ client_skip_proxy(struct archive_read_filter *self, int64_t request)
                        request -= get;
                        total += get;
                }
-               return total;
        } else if (self->archive->client.seeker != NULL
                && request > 64 * 1024) {
                /* If the client provided a seeker but not a skipper,