summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal_tests.c4
-rw-r--r--util.c4
-rw-r--r--util.h6
3 files changed, 6 insertions, 8 deletions
diff --git a/internal_tests.c b/internal_tests.c
index 4df068a..0fcddef 100644
--- a/internal_tests.c
+++ b/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));
diff --git a/util.c b/util.c
index 4de8199..a2d0728 100644
--- a/util.c
+++ b/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;
diff --git a/util.h b/util.h
index 0234a68..b5a043f 100644
--- a/util.h
+++ b/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);