From: Gerrit Renker Date: Sun, 23 May 2010 05:43:04 +0000 (+0200) Subject: string: constant value X-Git-Tag: v0.4.3~20^2~2^2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=13bcca2442dea6c5782f6281dc48dce3a86e1281;hp=a924e1306eaef8444cd5f3b1ed010bca4bcb3f98 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). --- 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)