Prechádzať zdrojové kódy

Clang-Format every source file

bel 10 rokov pred
rodič
commit
622ea2f659
6 zmenil súbory, kde vykonal 27 pridanie a 10 odobranie
  1. 16 0
      format.bat
  2. 3 2
      src/civetweb.c
  3. 3 3
      test/civetweb_check.h
  4. 1 1
      test/private.h
  5. 3 3
      test/public.c
  6. 1 1
      test/public.h

+ 16 - 0
format.bat

@@ -0,0 +1,16 @@
+clang-format -i src/civetweb.c
+clang-format -i src/main.c
+clang-format -i src/CivetServer.cpp
+clang-format -i src/lua_civet.h
+clang-format -i src/md5.inl
+clang-format -i src/mod_lua.inl
+clang-format -i src/timer.inl
+
+clang-format -i include/civetweb.h
+clang-format -i include/CivetServer.h
+
+clang-format -i test/public.h
+clang-format -i test/public.c
+clang-format -i test/private.h
+clang-format -i test/private.c
+clang-format -i test/civetweb_check.h

+ 3 - 2
src/civetweb.c

@@ -7136,8 +7136,9 @@ static void read_websocket(struct mg_connection *conn,
 				data_len = ((((size_t)buf[2]) << 8) + buf[3]);
 			} else if (body_len >= 10 + mask_len) {
 				header_len = 10 + mask_len;
-				data_len = (((uint64_t)ntohl(*(uint32_t *)(void *)&buf[2])) << 32) +
-				           ntohl(*(uint32_t *)(void *)&buf[6]);
+				data_len =
+				    (((uint64_t)ntohl(*(uint32_t *)(void *)&buf[2])) << 32) +
+				    ntohl(*(uint32_t *)(void *)&buf[6]);
 			}
 		}
 

+ 3 - 3
test/civetweb_check.h

@@ -30,12 +30,12 @@
 #undef pid_t
 #define pid_t int
 /* Unreferenced formal parameter. START_TEST has _i */
-#pragma warning(disable: 4100)
+#pragma warning(disable : 4100)
 /* conditional expression is constant . asserts use while(0) */
-#pragma warning(disable: 4127)
+#pragma warning(disable : 4127)
 #endif
 #include <stdint.h>
-#include <check.h>
+#include "check.h"
 #ifdef __clang__
 #pragma clang diagnostic pop
 #endif

+ 1 - 1
test/private.h

@@ -23,6 +23,6 @@
 
 #include "civetweb_check.h"
 
-Suite * make_private_suite (void);
+Suite *make_private_suite(void);
 
 #endif /* TEST_PRIVATE_H_ */

+ 3 - 3
test/public.c

@@ -170,11 +170,11 @@ START_TEST(test_mg_get_cookie)
 	ck_assert_int_eq(ret, 10);
 	ck_assert_str_eq("this+is+it", buf);
 
-    /* key with = but without value in the middle of a longer string */
+	/* key with = but without value in the middle of a longer string */
 	memset(buf, 77, sizeof(buf));
 	ret = mg_get_cookie(longcookie, "key5", buf, sizeof(buf));
 	ck_assert_int_eq(ret, 0);
-    ck_assert_str_eq("", buf);
+	ck_assert_str_eq("", buf);
 
 	/* key without = and without value in the middle of a longer string */
 	memset(buf, 77, sizeof(buf));
@@ -466,7 +466,7 @@ START_TEST(test_request_handlers)
 	const char *HTTP_PORT = "8087";
 	const char *OPTIONS[8]; /* initializer list here is rejected by CI test */
 
-	memset((void*)OPTIONS, 0, sizeof(OPTIONS));
+	memset((void *)OPTIONS, 0, sizeof(OPTIONS));
 	OPTIONS[0] = "listening_ports";
 	OPTIONS[1] = HTTP_PORT;
 	ck_assert(OPTIONS[sizeof(OPTIONS) / sizeof(OPTIONS[0]) - 1] == NULL);

+ 1 - 1
test/public.h

@@ -23,6 +23,6 @@
 
 #include "civetweb_check.h"
 
-Suite * make_public_suite (void);
+Suite *make_public_suite(void);
 
 #endif /* TEST_PUBLIC_H_ */