소스 검색

Fix some warnings

bel2125 3 년 전
부모
커밋
68df179765
3개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 1
      src/civetweb.c
  2. 4 4
      unittest/public_func.c
  3. 1 1
      unittest/public_server.c

+ 1 - 1
src/civetweb.c

@@ -14624,7 +14624,7 @@ handle_request(struct mg_connection *conn)
 	char req_str[1024];
 	sprintf(req_str, "REQUEST: %s %s\n", ri->request_method, ri->local_uri);
 	OutputDebugStringA(req_str);
-	/**/
+	*/
 
 	/* 2. if this ip has limited speed, set it for this connection */
 	conn->throttle = set_throttle(conn->dom_ctx->config[THROTTLE],

+ 4 - 4
unittest/public_func.c

@@ -597,16 +597,16 @@ START_TEST(test_mg_base64)
 	len = 9999;
 	mg_base64_encode((unsigned char *)nonalpha,
 	                 (int)strlen(nonalpha),
-	                 buf,
+	                 (unsigned char *)buf,
 	                 &len);
 	ck_assert_str_eq(buf, nonalpha_b64_enc);
 	ck_assert_int_eq((int)len, (int)strlen(nonalpha_b64_enc) + 1);
 
 	memset(buf, 77, sizeof(buf));
 	len = 9999;
-	ret = mg_base64_decode((unsigned char *)alpha_b64_enc,
+	ret = mg_base64_decode((char *)alpha_b64_enc,
 	                       (int)strlen(alpha_b64_enc),
-	                       buf,
+	                       (unsigned char *)buf,
 	                       &len);
 	ck_assert_int_eq(ret, -1);
 	ck_assert_int_eq((int)len, (int)strlen(alpha) + 1);
@@ -614,7 +614,7 @@ START_TEST(test_mg_base64)
 
 	memset(buf, 77, sizeof(buf));
 	len = 9999;
-	ret = mg_base64_decode((unsigned char *)"AAA*AAA", 7, buf, &len);
+	ret = mg_base64_decode((char *)"AAA*AAA", 7, (unsigned char *)buf, &len);
 	ck_assert_int_eq(ret, 3);
 }
 END_TEST

+ 1 - 1
unittest/public_server.c

@@ -361,7 +361,7 @@ test_mg_start(const struct mg_callbacks *callbacks,
 		/* Give the server some time to start in the test VM. */
 		/* Don't need to do this if mg_start failed. */
 		test_sleep(SLEEP_AFTER_MG_START);
-		ck_assert_int_eq(error.code, 0);
+		ck_assert_uint_eq(error.code, 0);
 		ck_assert_str_eq(error.text, "");
 	} else if (line > 0) {
 		/* mg_start is not supposed to fail anywhere, except for