Wine Devel: reformat the shrink program

Dimitrie O. Paun dpaun at rogers.com
Mon Jan 26 22:46:51 CST 2004


ChangeLog
    Reformat and cleanup the shrink.c file included in the
    documentation for consistency with the Wine source.

Index: documentation/implementation.sgml
===================================================================
RCS file: /var/cvs/wine/documentation/implementation.sgml,v
retrieving revision 1.9
diff -u -r1.9 implementation.sgml
--- documentation/implementation.sgml	25 Sep 2003 23:48:39 -0000	1.9
+++ documentation/implementation.sgml	27 Jan 2004 04:44:31 -0000
@@ -403,31 +403,25 @@
 #include <stdio.h>
 #include <string.h>
 
-void 
-main (void)
+int main (void)
 {
-  char buff[256], lastline[256];
-  int count;
+    char buff[256], lastline[256] = "";
+    int count = 0;
 
-  count = 0;
-  lastline[0] = 0;
-
-  while (!feof (stdin))
+    while (!feof (stdin))
     {
-      fgets (buff, sizeof (buff), stdin);
-      if (strcmp (buff, lastline) == 0)
-	{
-	  count++;
-	}
-      else
+        fgets (buff, sizeof (buff), stdin);
+        if (strcmp (buff, lastline))
 	{
-	  if (count > 1)
-	    fprintf (stdout, "# Last line repeated %i times #\n", count);
-	  fprintf (stdout, "%s", buff);
-	  strcpy (lastline, buff);
+	    if (count > 1)
+	        printf ("# Last line repeated %i times #\n", count);
+	    printf ("%s", buff);
+	    strcpy (lastline, buff);
 	    count = 1;
 	}
+        else count++;
     }
+    return 0;
 }
       </programlisting>
       </para>


-- 
Dimi.




More information about the wine-patches mailing list