From 13bcca2442dea6c5782f6281dc48dce3a86e1281 Mon Sep 17 00:00:00 2001 From: Gerrit Renker Date: Sun, 23 May 2010 07:43:04 +0200 Subject: [PATCH 1/1] string: constant value This replaces the LLONG_MAX constant with the value stolen from limits.h (that value is only accessible when using -std=c99). The value of 2^63-1 assumes 64-bit and can also be computed as (1ULL << (sizeof(long long) * 8 - 1)) - 1). --- string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/string.c b/string.c index f51f3574..1d8f69b9 100644 --- a/string.c +++ b/string.c @@ -525,9 +525,9 @@ __printf_2_3 int para_printf(struct para_buffer *b, const char *fmt, ...) } } -/** \cond LLONG_MAX and LLONG_LIN might not be defined. */ +/** \cond LLONG_MAX and LLONG_MIN might not be defined. */ #ifndef LLONG_MAX -#define LLONG_MAX (1 << (sizeof(long) - 1)) +#define LLONG_MAX 9223372036854775807LL #endif #ifndef LLONG_MIN #define LLONG_MIN (-LLONG_MAX - 1LL) -- 2.39.2