From 65a1f039392b18114a0cea844f689480356536f1 Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Sun, 30 Mar 2014 21:52:00 +0200 Subject: [PATCH] small code fixes --- src/psl.c | 3 --- src/psl2c.c | 5 ----- tests/test-is-public-all.c | 4 +--- tests/test-registrable-domain.c | 3 +-- 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/psl.c b/src/psl.c index 0aaf374..9374273 100644 --- a/src/psl.c +++ b/src/psl.c @@ -46,9 +46,6 @@ #define countof(a) (sizeof(a)/sizeof(*(a))) -// an invalid pointer -#define _PSL_INTERNAL 1 - typedef struct { char label_buf[48]; diff --git a/src/psl2c.c b/src/psl2c.c index 1c29d84..c5bf12f 100644 --- a/src/psl2c.c +++ b/src/psl2c.c @@ -144,11 +144,6 @@ static void _vector_sort(_psl_vector_t *v) qsort_r(v->entry, v->cur, sizeof(_psl_vector_t *), _compare, v); } -static inline int _vector_size(_psl_vector_t *v) -{ - return v ? v->cur : 0; -} - // by this kind of sorting, we can easily see if a domain matches or not (match = supercookie !) static int _suffix_compare(const _psl_entry_t *s1, const _psl_entry_t *s2) diff --git a/tests/test-is-public-all.c b/tests/test-is-public-all.c index ed3d638..2d7f2b9 100644 --- a/tests/test-is-public-all.c +++ b/tests/test-is-public-all.c @@ -39,8 +39,6 @@ #include -#define countof(a) (sizeof(a)/sizeof(*(a))) - static int ok, failed; @@ -121,7 +119,7 @@ int main(int argc, const char * const *argv) const char *valgrind = getenv("TESTS_VALGRIND"); if (valgrind && *valgrind) { - char cmd[strlen(valgrind)+strlen(argv[0])+32]; + char cmd[strlen(valgrind) + strlen(argv[0]) + 32]; snprintf(cmd, sizeof(cmd), "TESTS_VALGRIND="" %s %s", valgrind, argv[0]); return system(cmd) != 0; diff --git a/tests/test-registrable-domain.c b/tests/test-registrable-domain.c index 7afecf8..ebd1da6 100644 --- a/tests/test-registrable-domain.c +++ b/tests/test-registrable-domain.c @@ -39,7 +39,6 @@ #include -#define countof(a) (sizeof(a)/sizeof(*(a))) #define TESTDATA DATADIR"/test_psl.txt" static int @@ -143,7 +142,7 @@ int main(int argc, const char * const *argv) const char *valgrind = getenv("TESTS_VALGRIND"); if (valgrind && *valgrind) { - char cmd[strlen(valgrind)+strlen(argv[0])+32]; + char cmd[strlen(valgrind) + strlen(argv[0]) + 32]; snprintf(cmd, sizeof(cmd), "TESTS_VALGRIND="" %s %s", valgrind, argv[0]); return system(cmd) != 0;