[PATCH] Squelch compiler warnings
- To: mutt-dev@xxxxxxxx
- Subject: [PATCH] Squelch compiler warnings
- From: Ramkumar Ramachandra <artagnon@xxxxxxxxx>
- Date: Thu, 04 Nov 2010 18:41:55 +0530
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :content-transfer-encoding:subject:x-mercurial-node:message-id :user-agent:date:from:to; bh=ZKOJUPfbvV6U8SW4+cGT53+Kr7HUyykdrxzvEWLz7XE=; b=sy7+HrJqVrOt0znAuvVxRunGm4rbof9EGT6kPpE7wG12mEAJlpFQFo/VlN43O0OMc/ 6MLRZNGeSf4M9StjG0S6ZAQ7yg97WArwyap3k2uJ5J+8aNnXDNkdESNXwSBAKOhirW61 l54ieEMarTiM3UH/uVU7XnLZtI06UYsfiNDbQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:content-transfer-encoding:subject :x-mercurial-node:message-id:user-agent:date:from:to; b=tPh5Az4UxW4u67vcbg27NjsB04+IaV/x1pbhLIGzN291UQS6g23hWn9g/yHtFfkNMz rETTyOzQE6XGhdYXvi0ucih6+DQBCD57gsmwSKkY/9Ck7ZHsBIln+wd6IM4g8U7GAk5M 5YerkGxvVdlMBNaZD6tpENh2vb+6fz5+RVn1k=
- List-post: <mailto:mutt-dev@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-dev"
- Sender: owner-mutt-dev@xxxxxxxx
- User-agent: Mercurial-patchbomb/1.6.4
# 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 = '.';