Commit f0b62e19 by Nils Goroll

whitespace ocd

parent 3bf0b33a
/*
* Copyright (c) 2014 UPLEX - Nils Goroll Systemoptimierung
* Copyright (c) 2014-2015 UPLEX - Nils Goroll Systemoptimierung
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
......@@ -39,10 +39,9 @@
#include "gen/dcs_classifier.h" /* need DCS_* */
#include "dcs_match.h"
int
test (const char *fixup_remove_name, const char *fixup_reorder_name);
static void fixup_out (FILE *f_remove, FILE *f_reorder, const int i, const int r);
int test (const char *, const char *);
static void fixup_out (FILE *, FILE *, const int, const int);
int
main (int argc, char *argv[]) {
dcs_match_init();
......@@ -69,8 +68,10 @@ test_p_diff (const char *label, const int i, const char *testkey, const int r) {
if (dcs_entry[i].type != dcs_entry[r].type) {
printf("\ti: %8d (id %8d)\t%s\t%s\n"
"type\tr: %8d (id %8d)\t%s\t%s\n",
i, dcs_entry[i].id, dcs_entry[i].key, dcs_type[dcs_entry[i].type],
r, dcs_entry[r].id, dcs_entry[r].key, dcs_type[dcs_entry[r].type]);
i, dcs_entry[i].id,
dcs_entry[i].key, dcs_type[dcs_entry[i].type],
r, dcs_entry[r].id,
dcs_entry[r].key, dcs_type[dcs_entry[r].type]);
} else {
printf("\ti: %8d (id %8d)\t%s\n"
"\tr: %8d (id %8d)\t%s\n",
......@@ -180,15 +181,20 @@ test (const char *fixup_remove_name, const char *fixup_reorder_name) {
assert(strlen(dcs_entry[r].key) < KEYLIM);
/* append the negative token from entry r to entry i */
/*
* append the negative token from entry r to
* entry i
*/
if (nkey[0] == '\0')
strcpy(nkey, dcs_entry[i].key);
if ((ntoke = strchr(ntok, '*')) != NULL) {
assert((strlen(nkey) + (ntoke - ntok)) < KEYLIM);
assert((strlen(nkey) + (ntoke - ntok))
< KEYLIM);
strncat(nkey, ntok, (ntoke - ntok));
} else {
assert((strlen(nkey) + strlen(ntok)) < KEYLIM);
assert((strlen(nkey) + strlen(ntok))
< KEYLIM);
strcat(nkey, ntok);
}
r = dcs_match(nkey, mem, DCS_MATCH_MEM_SZ);
......@@ -240,7 +246,7 @@ test (const char *fixup_remove_name, const char *fixup_reorder_name) {
np = strtok_r(NULL, "*", &save);
}
}
r = dcs_match(poskey, mem, DCS_MATCH_MEM_SZ);
if (i != r) {
test_p_diff("miss np", i, poskey, r);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment