From 39817b252f48bbc99ddffab8497bd465dcde5c79 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Fri, 4 Jan 2013 23:19:34 +0200 Subject: [PATCH] Remove remaining C++ comments from source tree. I like to use them for debugging, to show that this comment is temporary, but that also means they should not stay around. --- test/compile.c | 1 - test/force_compat.sed | 26 +++++++++++++------------- test/test_aatree.c | 9 +++------ test/test_cbtree.c | 9 +++------ test/test_cxalloc.c | 4 +--- test/test_heap.c | 11 ++++------- test/test_list.c | 6 ++++-- test/test_regex.c | 2 +- test/test_string.c | 1 - usual/base_win32.h | 4 ++-- usual/crypto/keccak.c | 2 -- usual/pgsocket.c | 3 ++- 12 files changed, 33 insertions(+), 45 deletions(-) diff --git a/test/compile.c b/test/compile.c index 16ca711..59a36b6 100644 --- a/test/compile.c +++ b/test/compile.c @@ -16,7 +16,6 @@ #include #include #include -//#include #include #include #include diff --git a/test/force_compat.sed b/test/force_compat.sed index 6b43849..33430da 100644 --- a/test/force_compat.sed +++ b/test/force_compat.sed @@ -1,13 +1,13 @@ -/FFS/s,^,//, -/FLS/s,^,//, -/STRLCPY/s,^,//, -/STRLCAT/s,^,//, -/BASENAME/s,^,//, -/DIRNAME/s,^,//, -/REGCOMP/s,^,//, -/GETADDRINFO_A/s,^,//, -/INET_NTOP/s,^,//, -/INET_PTON/s,^,//, -/GETOPT/s,^,//, -/CTYPE_ON_CHAR/s,^,//, -/FNMATCH/s,^,//, +/^#define.*FFS/s,.*,/* & */, +/^#define.*FLS/s,.*,/* & */, +/^#define.*STRLCPY/s,.*,/* & */, +/^#define.*STRLCAT/s,.*,/* & */, +/^#define.*BASENAME/s,.*,/* & */, +/^#define.*DIRNAME/s,.*,/* & */, +/^#define.*REGCOMP/s,.*,/* & */, +/^#define.*GETADDRINFO_A/s,.*,/* & */, +/^#define.*INET_NTOP/s,.*,/* & */, +/^#define.*INET_PTON/s,.*,/* & */, +/^#define.*GETOPT/s,.*,/* & */, +/^#define.*CTYPE_ON_CHAR/s,.*,/* & */, +/^#define.*FNMATCH/s,.*,/* & */, diff --git a/test/test_aatree.c b/test/test_aatree.c index 0204f44..fbcafc6 100644 --- a/test/test_aatree.c +++ b/test/test_aatree.c @@ -175,13 +175,12 @@ static int get_next(bool with_stat, bool added[]) static void test_aatree_random(void *p) { bool is_added[RSIZE]; - int prefer_remove = 0; // 0 - insert, 1 - delete + int prefer_remove = 0; /* 0 - insert, 1 - delete */ int n; - int op; // 0 - insert, 1 - delete + int op; /* 0 - insert, 1 - delete */ struct AATree tree[1]; unsigned long long total = 0; - //printf("\n\n*** rand test ***\n\n"); srandom(123123); memset(is_added, 0, sizeof(is_added)); @@ -192,14 +191,12 @@ static void test_aatree_random(void *p) op = r > 5; else op = r > 10; - //op = 0; + /* op = 0; */ n = get_next(op, is_added); if (n < 0) { - //break; if (prefer_remove == op) { prefer_remove = !prefer_remove; - //printf("** toggling remove to %d\n", prefer_remove); } continue; } diff --git a/test/test_cbtree.c b/test/test_cbtree.c index 6618a09..f52fdb6 100644 --- a/test/test_cbtree.c +++ b/test/test_cbtree.c @@ -129,13 +129,12 @@ static int get_next(bool with_stat, bool added[]) static void test_cbtree_random(void *p) { bool is_added[RSIZE]; - int prefer_remove = 0; // 0 - insert, 1 - delete + int prefer_remove = 0; /* 0 - insert, 1 - delete */ int n; - int op; // 0 - insert, 1 - delete + int op; /* 0 - insert, 1 - delete */ struct CBTree *tree; unsigned long long total = 0; - //printf("\n\n*** rand test ***\n\n"); srandom(123123); memset(is_added, 0, sizeof(is_added)); @@ -147,14 +146,12 @@ static void test_cbtree_random(void *p) op = r > 5; else op = r > 10; - //op = 0; + /* op = 0; */ n = get_next(op, is_added); if (n < 0) { - //break; if (prefer_remove == op) { prefer_remove = !prefer_remove; - //printf("** toggling remove to %d\n", prefer_remove); } continue; } diff --git a/test/test_cxalloc.c b/test/test_cxalloc.c index 54d9169..294c33b 100644 --- a/test/test_cxalloc.c +++ b/test/test_cxalloc.c @@ -24,8 +24,6 @@ static void m_log(const char *fmt, ...) va_start(ap, fmt); vsnprintf(logbuf + len, sizeof(logbuf) - len, fmt, ap); va_end(ap); - - //printf("\n%s: delta=%d\n", logbuf + len, delta); } static void *log_alloc(void *ctx, size_t len) @@ -106,7 +104,7 @@ static void test_cxalloc_tree(void *zzz) cx_destroy(cx1); - //str_check(logbuf, "A(16)R(500)F()"); + /* str_check(logbuf, "A(16)R(500)F()"); */ int_check(delta, 0); end: reset(); diff --git a/test/test_heap.c b/test/test_heap.c index 6467b91..0f37d45 100644 --- a/test/test_heap.c +++ b/test/test_heap.c @@ -183,13 +183,12 @@ static int get_next(bool with_stat, bool added[]) static void test_aatree_random(void *p) { bool is_added[RSIZE]; - int prefer_remove = 0; // 0 - insert, 1 - delete + int prefer_remove = 0; /* 0 - insert, 1 - delete */ int n; - int op; // 0 - insert, 1 - delete + int op; /* 0 - insert, 1 - delete */ struct AATree tree[1]; unsigned long long total = 0; - //printf("\n\n*** rand test ***\n\n"); srandom(123123); memset(is_added, 0, sizeof(is_added)); @@ -200,14 +199,12 @@ static void test_aatree_random(void *p) op = r > 5; else op = r > 10; - //op = 0; + /* op = 0; */ n = get_next(op, is_added); if (n < 0) { - //break; if (prefer_remove == op) { prefer_remove = !prefer_remove; - //printf("** toggling remove to %d\n", prefer_remove); } continue; } @@ -228,7 +225,7 @@ end: struct testcase_t heap_tests[] = { { "basic", test_heap_basic }, - //{ "random", test_aatree_random }, + /* { "random", test_aatree_random }, */ END_OF_TESTCASES }; diff --git a/test/test_list.c b/test/test_list.c index 7a1f40c..47368e5 100644 --- a/test/test_list.c +++ b/test/test_list.c @@ -147,8 +147,10 @@ end:; struct testcase_t list_tests[] = { { "sort", test_list_sort }, - //{ "sort2", test_list_sort2 }, - //{ "sort3", test_list_sort3 }, +#if 0 + { "sort2", test_list_sort2 }, + { "sort3", test_list_sort3 }, +#endif END_OF_TESTCASES }; diff --git a/test/test_regex.c b/test/test_regex.c index b738d28..db4fb77 100644 --- a/test/test_regex.c +++ b/test/test_regex.c @@ -95,7 +95,7 @@ static void test_regex(void *ptr) str_check(e_rx("foo(x)?.*", "foobar", 0), "(0,6)(?,?)"); str_check(e_rx("foo", "bar", 0), "NOMATCH"); str_check(e_rx("foo{5,1}", "bar", 0), "BADBR"); - //str_check(e_rx("(|)", "bar", 0), "BADPAT"); + /* str_check(e_rx("(|)", "bar", 0), "BADPAT"); */ str_check(e_rx("*", "bar", 0), "BADRPT"); str_check(e_rx("foo{", "bar", 0), "EBRACE"); str_check(e_rx("fo[o", "bar", 0), "EBRACK"); diff --git a/test/test_string.c b/test/test_string.c index aac18e5..1013213 100644 --- a/test/test_string.c +++ b/test/test_string.c @@ -173,7 +173,6 @@ static bool slshow(void *arg, const char *s) return false; } if (!s) s = "NULL"; - //printf("writing: <%s>\n", s); return mbuf_write(mb, s, strlen(s)); } diff --git a/usual/base_win32.h b/usual/base_win32.h index adbb1be..941de16 100644 --- a/usual/base_win32.h +++ b/usual/base_win32.h @@ -23,10 +23,10 @@ #define ECONNABORTED WSAECONNABORTED #define EMSGSIZE WSAEMSGSIZE -#define EINPROGRESS WSAEWOULDBLOCK // WSAEINPROGRESS +#define EINPROGRESS WSAEWOULDBLOCK /* WSAEINPROGRESS */ #undef EAGAIN -#define EAGAIN WSAEWOULDBLOCK // WSAEAGAIN +#define EAGAIN WSAEWOULDBLOCK /* WSAEAGAIN */ #ifndef EAFNOSUPPORT #define EAFNOSUPPORT ENOSYS diff --git a/usual/crypto/keccak.c b/usual/crypto/keccak.c index e405cc3..720c500 100644 --- a/usual/crypto/keccak.c +++ b/usual/crypto/keccak.c @@ -43,8 +43,6 @@ #include #include -//#define KECCAK_64BIT - /* * Decide whether to use 64- or 32-bit implementation. */ diff --git a/usual/pgsocket.c b/usual/pgsocket.c index 414217b..4311307 100644 --- a/usual/pgsocket.c +++ b/usual/pgsocket.c @@ -43,7 +43,8 @@ struct PgSocket { /* track wait state */ enum WType wait_type; - uint8_t wait_event; // EV_READ / EV_WRITE + /* EV_READ / EV_WRITE */ + uint8_t wait_event; /* should connect after sleep */ bool reconnect; -- 2.39.5