[icecast-dev] [PATCH] Compile warnings cleanup.

Dale Ghent daleg at elemental.org
Tue Mar 9 15:45:33 PST 2004


Sorry for all the small patches. This one last one to scratch an itch :)

fprintf of variables of types uid_t, gid_t, and pid_t in main.c need to be
cast as int so gcc stops complaining about mis-matched types.

Patch is against cvs HEAD.

/dale
-------------- next part --------------
Index: src/main.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/main.c,v
retrieving revision 1.39
diff -u -r1.39 main.c
--- src/main.c	24 Feb 2004 21:02:44 -0000	1.39
+++ src/main.c	9 Mar 2004 18:54:10 -0000
@@ -343,14 +343,14 @@
 
        if(gid != -1) {
            if(!setgid(gid))
-               fprintf(stdout, "Changed groupid to %i.\n", gid);
+               fprintf(stdout, "Changed groupid to %i.\n", (int) gid);
            else
                fprintf(stdout, "Error changing groupid: %s.\n", strerror(errno));
        }
 
        if(uid != -1) {
            if(!setuid(uid))
-               fprintf(stdout, "Changed userid to %i.\n", uid);
+               fprintf(stdout, "Changed userid to %i.\n", (int) uid);
            else
                fprintf(stdout, "Error changing userid: %s.\n", strerror(errno));
        }
@@ -449,7 +449,7 @@
         pidfile = strdup (config->pidfile);
         if (pidfile && (f = fopen (config->pidfile, "w")) != NULL)
         {
-            fprintf (f, "%d\n", getpid());
+            fprintf (f, "%d\n", (int) getpid());
             fclose (f);
         }
     }


More information about the Icecast-dev mailing list