From: "Brian Norris" <computersforpeace@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: Kevin Cernekee <cernekee@gmail.com>,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Mike Frysinger <vapier.adi@gmail.com>,
Artem Bityutskiy <dedekind1@gmail.com>
Subject: [PATCH] mtd-utils: common.h: simple_strtoll type usage
Date: Tue, 15 Feb 2011 17:47:58 -0800 [thread overview]
Message-ID: <1297820878-2582-1-git-send-email-computersforpeace@gmail.com> (raw)
We must use "long long" and "unsigned long long" types when
implementing the functions "simple_strtoll()" and "simple_strtoull()",
respectively. This prevents casting/truncation errors on systems where
"long" is not the same size as "long long" (that is, on most systems).
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
include/common.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/common.h b/include/common.h
index eb8d5fc..2e5c2a0 100644
--- a/include/common.h
+++ b/include/common.h
@@ -108,9 +108,9 @@ static inline type simple_##func(const char *snum, int *error) \
return ret; \
}
simple_strtoX(strtol, long int)
-simple_strtoX(strtoll, long int)
+simple_strtoX(strtoll, long long int)
simple_strtoX(strtoul, unsigned long int)
-simple_strtoX(strtoull, unsigned long int)
+simple_strtoX(strtoull, unsigned long long int)
#include "xalloc.h"
--
1.7.0.4
next reply other threads:[~2011-02-16 1:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-16 1:47 Brian Norris [this message]
2011-02-16 2:48 ` [PATCH] mtd-utils: common.h: simple_strtoll type usage Mike Frysinger
2011-02-25 8:49 ` Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1297820878-2582-1-git-send-email-computersforpeace@gmail.com \
--to=computersforpeace@gmail.com \
--cc=cernekee@gmail.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=vapier.adi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.