<<< Date Index >>>     <<< Thread Index >>>

[PATCH] Squelch compiler warnings



# HG changeset patch
# User Ramkumar Ramachandra <artagnon@xxxxxxxxx>
# Date 1288876076 -19800
# Branch HEAD
# Node ID f7fa4bd2efda87f00b53018b81a78571425a68f2
# Parent  a23835db228d80f3c6fb16e83ce97701788bebc2
Squelch compiler warnings
* Remove unused variable 'i' in mbox.c.
* Replace several 'mktemp' with safer 'mkstemp' alternative.
* strtoul expects a 'char ** __restrict__' in its second argument: the
  supplied argument in parse_keycode in keymap.c is of type 'const
  char **'. Change this to eliminate a compiler warning.

diff -r a23835db228d -r f7fa4bd2efda keymap.c
--- a/keymap.c  Wed Sep 29 14:17:24 2010 -0700
+++ b/keymap.c  Thu Nov 04 18:37:56 2010 +0530
@@ -167,7 +167,7 @@
  */
 static int parse_keycode (const char *s)
 {
-    const char *endChar;
+    char *endChar;
     long int result = strtol(s+1, &endChar, 8);
     /* allow trailing whitespace, eg.  < 1001 > */
     while (ISSPACE(*endChar))
diff -r a23835db228d -r f7fa4bd2efda lib.c
--- a/lib.c     Wed Sep 29 14:17:24 2010 -0700
+++ b/lib.c     Thu Nov 04 18:37:56 2010 +0530
@@ -566,7 +566,7 @@
   do 
   {
     snprintf (newdir, ndlen, "%s/%s", parent, ".muttXXXXXX");
-    mktemp (newdir);
+    mkstemp (newdir);
   } 
   while ((rv = mkdir (newdir, 0700)) == -1 && errno == EEXIST);
   
diff -r a23835db228d -r f7fa4bd2efda mbox.c
--- a/mbox.c    Wed Sep 29 14:17:24 2010 -0700
+++ b/mbox.c    Thu Nov 04 18:37:56 2010 +0530
@@ -690,7 +690,6 @@
 void mbox_reset_atime (CONTEXT *ctx, struct stat *st)
 {
   struct utimbuf utimebuf;
-  int i;
   struct stat _st;
 
   if (!st)
diff -r a23835db228d -r f7fa4bd2efda muttlib.c
--- a/muttlib.c Wed Sep 29 14:17:24 2010 -0700
+++ b/muttlib.c Thu Nov 04 18:37:56 2010 +0530
@@ -75,7 +75,7 @@
   if (s[0] == '\0')
   {
     snprintf (s, l, "%s/muttXXXXXX", buf);
-    mktemp (s);
+    mkstemp (s);
   }
   else
   {
@@ -87,7 +87,7 @@
     if ((period = strrchr (tmp, '.')) != NULL)
       *period = 0;
     snprintf (s, l, "%s/%s.XXXXXX", buf, tmp);
-    mktemp (s);
+    mkstemp (s);
     if (period != NULL)
     {
       *period = '.';