small code fixes
This commit is contained in:
parent
31319a3dc7
commit
65a1f03939
|
@ -46,9 +46,6 @@
|
||||||
|
|
||||||
#define countof(a) (sizeof(a)/sizeof(*(a)))
|
#define countof(a) (sizeof(a)/sizeof(*(a)))
|
||||||
|
|
||||||
// an invalid pointer
|
|
||||||
#define _PSL_INTERNAL 1
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char
|
char
|
||||||
label_buf[48];
|
label_buf[48];
|
||||||
|
|
|
@ -144,11 +144,6 @@ static void _vector_sort(_psl_vector_t *v)
|
||||||
qsort_r(v->entry, v->cur, sizeof(_psl_vector_t *), _compare, 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 !)
|
// 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)
|
static int _suffix_compare(const _psl_entry_t *s1, const _psl_entry_t *s2)
|
||||||
|
|
|
@ -39,8 +39,6 @@
|
||||||
|
|
||||||
#include <libpsl.h>
|
#include <libpsl.h>
|
||||||
|
|
||||||
#define countof(a) (sizeof(a)/sizeof(*(a)))
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ok,
|
ok,
|
||||||
failed;
|
failed;
|
||||||
|
@ -121,7 +119,7 @@ int main(int argc, const char * const *argv)
|
||||||
const char *valgrind = getenv("TESTS_VALGRIND");
|
const char *valgrind = getenv("TESTS_VALGRIND");
|
||||||
|
|
||||||
if (valgrind && *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]);
|
snprintf(cmd, sizeof(cmd), "TESTS_VALGRIND="" %s %s", valgrind, argv[0]);
|
||||||
return system(cmd) != 0;
|
return system(cmd) != 0;
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
|
|
||||||
#include <libpsl.h>
|
#include <libpsl.h>
|
||||||
|
|
||||||
#define countof(a) (sizeof(a)/sizeof(*(a)))
|
|
||||||
#define TESTDATA DATADIR"/test_psl.txt"
|
#define TESTDATA DATADIR"/test_psl.txt"
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -143,7 +142,7 @@ int main(int argc, const char * const *argv)
|
||||||
const char *valgrind = getenv("TESTS_VALGRIND");
|
const char *valgrind = getenv("TESTS_VALGRIND");
|
||||||
|
|
||||||
if (valgrind && *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]);
|
snprintf(cmd, sizeof(cmd), "TESTS_VALGRIND="" %s %s", valgrind, argv[0]);
|
||||||
return system(cmd) != 0;
|
return system(cmd) != 0;
|
||||||
|
|
Loading…
Reference in New Issue