Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

safe_strou?ll functions should operate on u?int64_t types.

long long and unsigned long long are interchangeable in most places,
but apparently not my 64-bit ubuntu 8.10 box.
  • Loading branch information...
commit a977b5563ab73b764c5b257d6ed1f182b5cd92ca 1 parent 24fda0f
@dustin dustin authored
Showing with 6 additions and 8 deletions.
  1. +2 −2 internal_tests.c
  2. +2 −2 util.c
  3. +2 −4 util.h
View
4 internal_tests.c
@@ -10,7 +10,7 @@ static void test_safe_strtoull(void);
static void test_safe_strtoll(void);
static void test_safe_strtoull() {
- unsigned long long val;
+ uint64_t val;
assert(safe_strtoull("123", &val));
assert(val == 123);
assert(safe_strtoull("+123", &val));
@@ -27,7 +27,7 @@ static void test_safe_strtoull() {
}
static void test_safe_strtoll() {
- long long val;
+ int64_t val;
assert(safe_strtoll("123", &val));
assert(val == 123);
assert(safe_strtoll("+123", &val));
View
4 util.c
@@ -7,7 +7,7 @@
#include "memcached.h"
-bool safe_strtoull(const char *str, unsigned long long *out) {
+bool safe_strtoull(const char *str, uint64_t *out) {
assert(out != NULL);
errno = 0;
*out = 0;
@@ -30,7 +30,7 @@ bool safe_strtoull(const char *str, unsigned long long *out) {
return false;
}
-bool safe_strtoll(const char *str, long long *out) {
+bool safe_strtoll(const char *str, int64_t *out) {
assert(out != NULL);
errno = 0;
*out = 0;
View
6 util.h
@@ -7,7 +7,5 @@
*
* returns true if conversion succeeded.
*/
-bool safe_strtoull(const char *str, unsigned long long *out);
-bool safe_strtoll(const char *str, long long *out);
-
-
+bool safe_strtoull(const char *str, uint64_t *out);
+bool safe_strtoll(const char *str, int64_t *out);
Please sign in to comment.
Something went wrong with that request. Please try again.