search for: int64_min

Displaying 17 results from an estimated 17 matches for "int64_min".

Did you mean: int64_max
2004 Oct 19
1
[LLVMdev] Missing default for INT64_MIN in include/llvm/Support/DataTypes.h.in
Here is a patch -- on a side note I see that a patch checking _MSC_VER has gone in which defines a lot of limits that should really come from <limits.h> ... Anyone care to comment on this? m. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diff.txt URL:
2004 Sep 29
0
[LLVMdev] INT64_MIN
We need to define also INT64_MIN along with INT64_MAX llvm\lib\System\TimeValue.cpp(19) : error C2065: 'INT64_MIN' : undeclared identifier I've attached a patch that define it right after the INT64_MAX, but I think it's a better solution to define both in the specific #ifdef part for VC in the same file, right...
2020 Oct 17
0
[PATCH nbdkit] common/include/tvdiff.h: Add formal specification.
...d_timeval (struct timeval tv) = + tv.tv_sec >= 0 && tv.tv_usec >= 0 && tv.tv_usec < 1000000; + logic integer tv_to_microseconds (struct timeval tv) = + tv.tv_sec * 1000000 + tv.tv_usec; + */ + +#ifdef FRAMA_C + +/*@ + assigns *r; + behavior success: + assumes INT64_MIN <= a + b <= INT64_MAX; + ensures *r == a + b; + ensures \result == \false; + behavior overflow: + assumes !(INT64_MIN <= a + b <= INT64_MAX); + ensures \result == \true; + */ +extern bool __builtin_add_overflow (int64_t a, int64_t b, int64_t *r); +/*@ + assigns *r; +...
2019 Feb 07
1
[PATCH nbdkit] server: utils: Fix nbdkit_parse_size to correctly handle negative values
...less the original (nonnegated) value would overflow." Later validation doesn't catch the situation when parsed value is within the valid range but original string passed to a function represented negative number. Thus nbdkit_parse_size() incorrectly parsed values in a range [-UINT64_MAX; INT64_MIN -1] translating them into an unsigned range of a valid values: [1; INT64_MAX]. In this patch: 1. strtoll() is used instead of strtoumax() to reflect the nature of the 'size' which cannot be negative and isn't expected to exceed INT64_MAX. 2. Error reporting separates cases where the s...
2019 Feb 08
2
[PATCH nbdkit v2] server: utils: Make nbdkit_parse_size to reject negative values
...value would overflow." Later validation doesn't catch the situation when parsed value appeared within the valid range (due to negation) but original string passed to a function literally represented negative number. Thus nbdkit_parse_size() treats negative values in a range [-UINT64_MAX; INT64_MIN - 1] as positive values in a range [1; INT64_MAX] due to negation performed by strtoumax(). In this patch: 1. strtoimax() is used instead of strtoumax() to reflect the nature of the 'size' which cannot be negative and is not expected to exceed INT64_MAX. 2. Error reporting separates case...
2023 Sep 03
1
[PATCH nbdkit] server: Move size parsing code (nbdkit_parse_size) to common/include
This is the first part of a pair of patch series which aim to let us use nbdkit_parse_size (or rather, an equivalent common function) in nbdcopy, so we can write: nbdcopy --request-size=32M ... We can't do that now which was annoying me earlier in the week. This commit creates a new function called human_size_parse which is basically nbdkit_parse_size, and turns nbdkit_parse_size into a
2004 Oct 25
2
[LLVMdev] Remaining Visual C patches
...ding some #includes and some typecasts, fixing alloca for visual C etc. I guess I just wrote too many mails so it was lost in the process, so here is a diff which includes all changes I have made, except those related to hash_map differences since my solution here is just too ugly. I fixed the INT64_MIN as pointed out by Misha Brukman and I made yet another fix for the variable length array in LiveVariables.cpp, this time using alloca. I hope these patches are acceptable, please tell me which ones have to be modified (if any) and I will do it ASAP. Meanwhile I will work on a proper solution to...
2023 Sep 03
5
[PATCH libnbd 0/5] copy: Allow human sizes for --queue-size, etc
See companion patch: Subject: [PATCH nbdkit] server: Move size parsing code (nbdkit_parse_size) to common/include This is the second part of the patch. It adds the new human_size_parse function to libnbd and then uses it for parsing --queue-size, --request-size and --sparse. The main complication here is that there was already a common/utils/human-size.h header which ends up (eventually)
2004 Oct 25
0
[LLVMdev] Remaining Visual C patches
...ca for visual C etc. Oops, sorry about that. :( > I guess I just wrote too many mails so it was lost in the process, so > here is a diff which includes all changes I have made, except those > related to hash_map differences since my solution here is just too ugly. Ok. > I fixed the INT64_MIN as pointed out by Misha Brukman and I made yet > another fix for the variable length array in LiveVariables.cpp, this > time using alloca. I hope these patches are acceptable, please tell me > which ones have to be modified (if any) and I will do it ASAP. Meanwhile > I will work on a pr...
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 2/5] lib: Move code for parsing, passwords and paths into libnbdkit.so.
...(r < INT32_MIN || r > INT32_MAX) - errno = ERANGE; -#endif - PARSE_COMMON_TAIL; -} - -int -nbdkit_parse_int64_t (const char *what, const char *str, int64_t *rp) -{ - long long r; - char *end; - - errno = 0; - r = strtoll (str, &end, 0); -#if INT64_MAX != LONGLONG_MAX - if (r < INT64_MIN || r > INT64_MAX) - errno = ERANGE; -#endif - PARSE_COMMON_TAIL; -} - -/* Functions for parsing unsigned integers. */ - -/* strtou* functions have surprising behaviour if the first character - * (after whitespace) is '-', so reject this early. - */ -#define PARSE_ERROR_IF_NEGATIVE...
2019 Sep 23
0
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...if > + PARSE_COMMON_TAIL; > +} > + > +int > +nbdkit_parse_int64_t (const char *what, const char *str, int64_t *rp) > +{ > + long long r; > + char *end; > + > + errno = 0; > + r = strtoll (str, &end, 0); > +#if INT64_MAX != LONGLONG_MAX > + if (r < INT64_MIN || r > INT64_MAX) > + errno = ERANGE; > +#endif > + PARSE_COMMON_TAIL; > +} Probably a dead #if, but doesn't hurt to leave it in. > + > +int > +nbdkit_parse_ssize_t (const char *what, const char *str, ssize_t *rp) > +{ > + long long r; > + char *end; &gt...
2023 Mar 01
6
[libnbd PATCH 0/6] common: catch up with nbdkit
If we compare the "common" subdirectory between nbdkit @ 6b4178d0fdfe ("ci: Temporarily disable perl in MacOS", 2023-02-27) and libnbd @ d05cd8f384a7 ("Version 1.15.11.", 2023-02-28), we find differences. We can categorize these differences along two (orthogonal) axes: - Intentional or unintentional. Intentional differences are for example when one of the libnbd
2019 Sep 21
2
[PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...(r < INT32_MIN || r > INT32_MAX) + errno = ERANGE; +#endif + PARSE_COMMON_TAIL; +} + +int +nbdkit_parse_int64_t (const char *what, const char *str, int64_t *rp) +{ + long long r; + char *end; + + errno = 0; + r = strtoll (str, &end, 0); +#if INT64_MAX != LONGLONG_MAX + if (r < INT64_MIN || r > INT64_MAX) + errno = ERANGE; +#endif + PARSE_COMMON_TAIL; +} + +int +nbdkit_parse_ssize_t (const char *what, const char *str, ssize_t *rp) +{ + long long r; + char *end; + + errno = 0; + r = strtoll (str, &end, 0); +#if SSIZE_MAX != LONGLONG_MAX +#ifndef SSIZE_MIN +#define SSI...
2020 Mar 26
9
[PATCH nbdkit 5/9 patch split 1/5] Create libnbdkit.so.
This is the previous 5/9 patch posted earlier today, split into reviewable chunks. This passes bisection with -x 'make && make check', but I didn't work very hard on the commit messages, so I refer you back to the original patch to explain how it works: https://www.redhat.com/archives/libguestfs/2020-March/msg00248.html Rich.
2019 Sep 23
2
[PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...(r < INT32_MIN || r > INT32_MAX) + errno = ERANGE; +#endif + PARSE_COMMON_TAIL; +} + +int +nbdkit_parse_int64_t (const char *what, const char *str, int64_t *rp) +{ + long long r; + char *end; + + errno = 0; + r = strtoll (str, &end, 0); +#if INT64_MAX != LONGLONG_MAX + if (r < INT64_MIN || r > INT64_MAX) + errno = ERANGE; +#endif + PARSE_COMMON_TAIL; +} + +/* Functions for parsing unsigned integers. */ + +/* strtou* functions have surprising behaviour if the first character + * (after whitespace) is '-', so reject this early. + */ +#define PARSE_ERROR_IF_NEGATIVE...
2019 Sep 23
2
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
On Mon, Sep 23, 2019 at 12:05:11PM -0500, Eric Blake wrote: > > + int nbdkit_parse_long (const char *what, const char *str, long *r); > > + int nbdkit_parse_unsigned_long (const char *what, > > + const char *str, unsigned long *r); > > Do we really want to encourage the use of parse_long and > parse_unsigned_long? Those differ between
2020 Mar 26
15
[PATCH nbdkit 0/9] Create libnbdkit.so
This creates libnbdkit.so as discussed in the following thread: https://www.redhat.com/archives/libguestfs/2020-March/thread.html#00203 test-delay-shutdown.sh fails for unclear reasons. This series starts by reverting "tests: Don't strand hung nbdkit processes" which is because several other tests fail randomly unless I revert this patch. I didn't investigate this yet so it