From: Jim Meyering Date: Sat, 2 Jan 1999 05:54:07 +0000 (+0000) Subject: Move inclusion of assert.h to follow that of stdio.h. X-Git-Tag: FILEUTILS-4_1-b2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bb9d3c528922b763461125a3be5035c107cc279;p=thirdparty%2Fcoreutils.git Move inclusion of assert.h to follow that of stdio.h. Some losing systems require this. Use STREQ macro instead of strcmp in a few places. --- diff --git a/src/tsort.c b/src/tsort.c index d47cdb0648..90f57a7c1e 100644 --- a/src/tsort.c +++ b/src/tsort.c @@ -25,9 +25,9 @@ # include #endif +#include #include #include -#include #include "long-options.h" #include "system.h" @@ -167,7 +167,7 @@ search_item (struct item *root, const char *str) p->right = q; /* A6. Adjust balance factors. */ - assert (strcmp (str, s->str)); + assert (!STREQ (str, s->str)); if (strcmp (str, s->str) < 0) { r = p = s->left; @@ -181,7 +181,7 @@ search_item (struct item *root, const char *str) while (p != q) { - assert (strcmp (str, p->str)); + assert (!STREQ (str, p->str)); if (strcmp (str, p->str) < 0) { p->balance = -1; @@ -275,7 +275,7 @@ record_relation (struct item *j, struct item *k) { struct successor *p; - if (strcmp (j->str, k->str)) + if (!STREQ (j->str, k->str)) { k->count++; p = xmalloc (sizeof (struct successor)); @@ -381,7 +381,7 @@ tsort (const char *file) while (1) { long int len; - + /* T2. Next Relation. */ len = readtoken (fp, DELIM, sizeof (DELIM) - 1, &tokenbuffer); if (len < 0)