chiark
/
gitweb
/
~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
struct/buf.c: Add functions for serializing and deserializing `kludge64'.
[mLib]
/
struct
/
t
/
sym-test.c
diff --git
a/struct/t/sym-test.c
b/struct/t/sym-test.c
index 8a9435f563ff2b1144cb0e8f16082e4121b28d95..dfc2391220e1562bfb79fbf2311cc58d96e99159 100644
(file)
--- a/
struct/t/sym-test.c
+++ b/
struct/t/sym-test.c
@@
-3,6
+3,7
@@
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
+#include "macros.h"
#include "sym.h"
typedef struct word {
#include "sym.h"
typedef struct word {
@@
-31,7
+32,7
@@
int main(void)
buf[strlen(buf) - 1] = 0;
p = strtok(buf, " ");
buf[strlen(buf) - 1] = 0;
p = strtok(buf, " ");
- if (
strcmp(p, "set") == 0
) {
+ if (
STRCMP(p, ==, "set")
) {
char *k = strtok(0, " ");
int i = atoi(strtok(0, " "));
unsigned f;
char *k = strtok(0, " ");
int i = atoi(strtok(0, " "));
unsigned f;
@@
-39,14
+40,14
@@
int main(void)
w->i = i;
if (!f)
n++;
w->i = i;
if (!f)
n++;
- } else if (
strcmp(p, "get") == 0
) {
+ } else if (
STRCMP(p, ==, "get")
) {
char *k = strtok(0, " ");
word *w = sym_find(&t, k, -1, 0, 0);
if (w)
printf("%i\n", w->i);
else
puts("*MISSING*");
char *k = strtok(0, " ");
word *w = sym_find(&t, k, -1, 0, 0);
if (w)
printf("%i\n", w->i);
else
puts("*MISSING*");
- } else if (
strcmp(p, "del") == 0
) {
+ } else if (
STRCMP(p, ==, "del")
) {
char *k = strtok(0, " ");
word *w = sym_find(&t, k, -1, 0, 0);
if (w) {
char *k = strtok(0, " ");
word *w = sym_find(&t, k, -1, 0, 0);
if (w) {
@@
-54,9
+55,9
@@
int main(void)
n--;
} else
puts("*MISSING*");
n--;
} else
puts("*MISSING*");
- } else if (
strcmp(p, "count") == 0
) {
+ } else if (
STRCMP(p, ==, "count")
) {
printf("%lu\n", (unsigned long)n);
printf("%lu\n", (unsigned long)n);
- } else if (
strcmp(p, "show") == 0
) {
+ } else if (
STRCMP(p, ==, "show")
) {
sym_iter i;
word *w;
word **v, **vv;
sym_iter i;
word *w;
word **v, **vv;