tweak to conform with syntax policy
authorJim Meyering <meyering@redhat.com>
Thu, 12 Jun 2008 19:38:17 +0000 (21:38 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 12 Jun 2008 19:38:17 +0000 (21:38 +0200)
Use "<" or "<=" rather than ">" or ">=".
Use "Type const *", rather than "const Type *".

src/comm.c

index 9742fb3..2bf8761 100644 (file)
@@ -141,7 +141,7 @@ and column three contains lines common to both files.\n\
    2 for a line only in file 2, 3 for a line in both. */
 
 static void
-writeline (const struct linebuffer *line, FILE *stream, int class)
+writeline (struct linebuffer const *line, FILE *stream, int class)
 {
   switch (class)
     {
@@ -185,8 +185,8 @@ writeline (const struct linebuffer *line, FILE *stream, int class)
    This funtion was copied (nearly) verbatim from `src/join.c'. */
 
 static void
-check_order (const struct linebuffer *prev,
-            const struct linebuffer *current,
+check_order (struct linebuffer const *prev,
+            struct linebuffer const *current,
             int whatfile)
 {
 
@@ -206,7 +206,7 @@ check_order (const struct linebuffer *prev,
              order = memcmp (prev->buffer, current->buffer, len);
            }
 
-         if (order > 0)
+         if (0 < order)
            {
              error ((check_input_order == CHECK_ORDER_ENABLED
                      ? EXIT_FAILURE : 0),
@@ -301,15 +301,15 @@ compare_files (char **infiles)
       else
        {
          seen_unpairable = true;
-         if (order > 0)
-           writeline (thisline[1], stdout, 2);
-         else
+         if (order <= 0)
            writeline (thisline[0], stdout, 1);
+         else
+           writeline (thisline[1], stdout, 2);
        }
 
       /* Step the file the line came from.
         If the files match, step both files.  */
-      if (order >= 0)
+      if (0 <= order)
        fill_up[1] = true;
       if (order <= 0)
        fill_up[0] = true;