소스 검색

Try to avoid some compiler warnings

bel 8 년 전
부모
커밋
a734181940
2개의 변경된 파일14개의 추가작업 그리고 14개의 파일을 삭제
  1. 3 3
      src/civetweb.c
  2. 11 11
      test/public_server.c

+ 3 - 3
src/civetweb.c

@@ -2419,8 +2419,8 @@ skip_quoted(char **buf,
 		*buf = end_word;
 	} else {
 		end_whitespace =
-		    end_word + ((unsigned int)strspn(&end_word[1], whitespace)
-		                + (unsigned int)1);
+		    end_word + ((long unsigned int)strspn(&end_word[1], whitespace)
+		                + (long unsigned int)1);
 
 		for (p = end_word; p < end_whitespace; p++) {
 			*p = '\0';
@@ -9388,7 +9388,7 @@ mg_websocket_write_exec(struct mg_connection *conn,
 	int retval = -1;
 
 	header[0] =
-	    (unsigned char)0x80u + ((unsigned char)opcode & (unsigned char)0xFu);
+	    (unsigned char)0x80u + (((unsigned char)(unsigned)opcode) & (unsigned char)0xFu);
 
 	/* Frame format: http://tools.ietf.org/html/rfc6455#section-5.2 */
 	if (dataLen < 126) {

+ 11 - 11
test/public_server.c

@@ -200,16 +200,16 @@ START_TEST(test_the_test_environment)
 #ifdef _WIN32
 /* Try to copy the files required for AppVeyor */
 #if defined(_WIN64) || defined(__MINGW64__)
-	system("cmd /c copy C:\\OpenSSL-Win64\\libeay32.dll libeay32.dll");
-	system("cmd /c copy C:\\OpenSSL-Win64\\libssl32.dll libssl32.dll");
-	system("cmd /c copy C:\\OpenSSL-Win64\\ssleay32.dll ssleay32.dll");
-	system("cmd /c copy C:\\OpenSSL-Win64\\libeay32.dll libeay64.dll");
-	system("cmd /c copy C:\\OpenSSL-Win64\\libssl32.dll libssl64.dll");
-	system("cmd /c copy C:\\OpenSSL-Win64\\ssleay32.dll ssleay64.dll");
+	(void)system("cmd /c copy C:\\OpenSSL-Win64\\libeay32.dll libeay32.dll");
+	(void)system("cmd /c copy C:\\OpenSSL-Win64\\libssl32.dll libssl32.dll");
+	(void)system("cmd /c copy C:\\OpenSSL-Win64\\ssleay32.dll ssleay32.dll");
+	(void)system("cmd /c copy C:\\OpenSSL-Win64\\libeay32.dll libeay64.dll");
+	(void)system("cmd /c copy C:\\OpenSSL-Win64\\libssl32.dll libssl64.dll");
+	(void)system("cmd /c copy C:\\OpenSSL-Win64\\ssleay32.dll ssleay64.dll");
 #else
-	system("cmd /c copy C:\\OpenSSL-Win32\\libeay32.dll libeay32.dll");
-	system("cmd /c copy C:\\OpenSSL-Win32\\libssl32.dll libssl32.dll");
-	system("cmd /c copy C:\\OpenSSL-Win32\\ssleay32.dll ssleay32.dll");
+	(void)system("cmd /c copy C:\\OpenSSL-Win32\\libeay32.dll libeay32.dll");
+	(void)system("cmd /c copy C:\\OpenSSL-Win32\\libssl32.dll libssl32.dll");
+	(void)system("cmd /c copy C:\\OpenSSL-Win32\\ssleay32.dll ssleay32.dll");
 #endif
 #endif
 }
@@ -1202,7 +1202,7 @@ START_TEST(test_request_handlers)
 	                     "\n";
 	fwrite(cgi_script_content, strlen(cgi_script_content), 1, f);
 	fclose(f);
-	system("chmod a+x test.cgi");
+	(void)system("chmod a+x test.cgi");
 #endif
 	expected_cgi_result = "CGI test";
 
@@ -1239,7 +1239,7 @@ START_TEST(test_request_handlers)
 #else
 	sprintf(cmd_buf, "cp %s/cgi_test.cgi cgi_test.cgi", locate_test_exes());
 #endif
-	system(cmd_buf);
+	(void)system(cmd_buf);
 
 #if !defined(NO_CGI) && !defined(NO_FILES) && !defined(_WIN32)
 	/* TODO: add test for windows, check with POST */