search for: int64_max

Displaying 20 results from an estimated 199 matches for "int64_max".

2002 Sep 13
2
[LLVMdev] Linux-x86 Compatability
ISSUE: INT64_MAX undefined in InstrSelectionSupport.cpp and InstructionCombining.cpp. I'm not completely sure where INT64_MAX comes from on Solaris, but C99 says that INT64_MAX is defined in stdint.h, but, for C++, only if __STDC_LIMIT_MACROS is #defined. Solaris (at least in CSIL) unfortunately does not...
2012 Mar 16
2
[PATCH v3] use INT64_MAX as max expiration
...10,8 +1410,7 @@ static int64_t qemu_next_deadline(void) delta = active_timers[QEMU_TIMER_VIRTUAL]->expire_time - qemu_get_clock(vm_clock); } else { - /* To avoid problems with overflow limit this to 2^32. */ - delta = INT32_MAX; + delta = INT64_MAX; } if (delta < 0) @@ -1427,9 +1426,11 @@ static uint64_t qemu_next_deadline_dyntick(void) int64_t rtdelta; if (use_icount) - delta = INT32_MAX; - else - delta = (qemu_next_deadline() + 999) / 1000; + delta = INT64_MAX; + else { + delta = qe...
2019 Mar 29
2
Re: [PATCH nbdkit v5 FINAL 01/19] server: Implement extents/can_extents calls for plugins and filters.
...> + * All rights reserved. We started work on this phrase but it got waylaid by extents work; maybe now is a good time to revisit that? > +struct nbdkit_extents * > +nbdkit_extents_new (uint64_t start, uint64_t end) > +{ > + struct nbdkit_extents *r; > + > + if (start >= INT64_MAX || end >= INT64_MAX) { Is this an off-by-one? INT64_MAX is a valid offset in our memory plugin, while INT64_MAX + 1 is not. > + nbdkit_error ("nbdkit_extents_new: " > + "start (%" PRIu64 ") or end (%" PRIu64 ") >= INT64_MAX",...
2002 Sep 13
3
[LLVMdev] Linux-x86 Compatability
Chris Lattner wrote: >>ISSUE: INT64_MAX undefined in InstrSelectionSupport.cpp and >>InstructionCombining.cpp. I'm not completely sure where INT64_MAX comes >>from on Solaris, but C99 says that INT64_MAX is defined in stdint.h, >>but, for C++, only if __STDC_LIMIT_MACROS is #defined. Solaris (at >>least in C...
2020 Oct 17
0
[PATCH nbdkit] common/include/tvdiff.h: Add formal specification.
...) = + 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; + behavior success: + a...
2023 Sep 05
1
[PATCH nbdkit] server: Move size parsing code (nbdkit_parse_size) to common/include
...orm specific is easier to reason about (for the same way that using size_t gives me more grief than directly using int32_t or int64_t; even though size_t is such a naturally occuring type, the fact that it is not uniform width makes it trickier to work with). > > > + > > > + if (INT64_MAX / scale < size) { > > > + *error = "could not parse size: size * scale overflows"; > > > + *pstr = str; > > > + return -1; > > > + } And thus I prefer that this comparison stay pegged to INT64_MAX, and not INT_MAX. -- Eric Blake, Princip...
2019 Feb 07
1
[PATCH nbdkit] server: utils: Fix nbdkit_parse_size to correctly handle negative values
...d value, unless 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...
2013 Nov 10
0
[LLVMdev] [cfe-dev] Goal for 3.5: Library-friendly headers
On Sun, Nov 10, 2013 at 01:42:24PM +0000, Alp Toker wrote: > |#undef NetBSD|| > ||#undef mips|| > ||#undef sparc|| > ||#undef INT64_MAX|| > ||#undef alloca| > > This is not OK to do globally -- even if LLVM doesn't care about the > definition, maybe embedding applications or OS headers do? Given that 3 of the 5 #undefs are directly relevant for me -- they exist because OS headers and/or compiler default configurat...
2002 Sep 13
0
[LLVMdev] Linux-x86 Compatability
> ISSUE: INT64_MAX undefined in InstrSelectionSupport.cpp and > InstructionCombining.cpp. I'm not completely sure where INT64_MAX comes > from on Solaris, but C99 says that INT64_MAX is defined in stdint.h, > but, for C++, only if __STDC_LIMIT_MACROS is #defined. Solaris (at > least in CSIL) unfortu...
2013 Nov 10
8
[LLVMdev] Goal for 3.5: Library-friendly headers
...tion. NDEBUG should only ever be used in source files. That way if something is crashing we can swap in a debug build without rebuilding every single dependent application. Win! *undefs* Some examples from llvm/include and clang/include: |#undef NetBSD|| ||#undef mips|| ||#undef sparc|| ||#undef INT64_MAX|| ||#undef alloca| This is not OK to do globally -- even if LLVM doesn't care about the definition, maybe embedding applications or OS headers do? |$ find include -iname '*.h' | xargs grep '^#' -- | grep -vE '^.*:.*(LLVM_|cplusplus|endif|else|include|define )'| grep -v...
2019 Feb 08
2
[PATCH nbdkit v2] server: utils: Make nbdkit_parse_size to reject negative values
...onnegated) 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 sep...
2013 Nov 10
1
[LLVMdev] [cfe-dev] Goal for 3.5: Library-friendly headers
On 10/11/2013 14:26, Joerg Sonnenberger wrote: > On Sun, Nov 10, 2013 at 01:42:24PM +0000, Alp Toker wrote: >> |#undef NetBSD|| >> ||#undef mips|| >> ||#undef sparc|| >> ||#undef INT64_MAX|| >> ||#undef alloca| >> >> This is not OK to do globally -- even if LLVM doesn't care about the >> definition, maybe embedding applications or OS headers do? > Given that 3 of the 5 #undefs are directly relevant for me -- they exist > because OS headers and/or com...
2019 Mar 23
1
Re: [PATCH nbdkit 4/8] offset: Implement mapping of extents.
...; + size_t i; > + struct nbdkit_extents *extents2; > + struct nbdkit_extent e; > + > + extents2 = nbdkit_extents_new (offs + offset); > + if (extents2 == NULL) { > + *err = errno; > + return -1; > + } Ouch - nbdkit_extents_new() returns NULL for 'start >= INT64_MAX' without setting errno. Of course, that failure path should be unreachable here, but if you are going to assign *err based on errno, then we have to make sure patch 1 guarantees sane errno settings on all failure paths. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919...
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 after #define INT32...
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:
2002 Sep 13
1
[LLVMdev] Linux-x86 Compatability
...sage----- > From: llvmdev-admin at cs.uiuc.edu [mailto:llvmdev-admin at cs.uiuc.edu]On > Behalf Of Chris Lattner > Sent: Friday, September 13, 2002 10:41 AM > To: Casey Carter > Cc: LLVMdev List > Subject: Re: [LLVMdev] Linux-x86 Compatability > > > > >Interesting. INT64_MAX is supposed to be provided by > > >include/Support/DataTypes.h. Do you know of a reliable preprocessor > > >symbol that can be used to determine whether we're on a linux box, or > > > Well, there is always __linux__, but that doesn't necessarily imply that > &...
2018 Aug 17
1
Re: [PATCH v3 1/4] mltools: Rename Yajl module as JSON_parser and move to common/mltools.
...l) as libvirt did is not going > to be pleasant. > > Currently we're OK as long as disk sizes don't exceed 8 petabytes, if > my quick calculation is correct. The problem comes anywhere that qemu outputs an unsigned 64-bit number as unsigned AND where that value is larger than INT64_MAX (jansson uses strtoll, rather than strtoull). But since disk sizes cannot exceed off_t, which is a signed 64-bit number, it does not matter whether qemu outputs those as signed or unsigned - they will still be parseable as a signed number. Thus, you are correct that disk sizes in qemu output...
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 2/5] lib: Move code for parsing, passwords and paths into libnbdkit.so.
...d, 0); -#if INT32_MAX != LONG_MAX - if (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....
2019 May 17
1
[nbdkit PATCH] truncate: Detect large image overflow with round-up
...ypes.h> #include <nbdkit-filter.h> @@ -172,8 +173,14 @@ truncate_prepare (struct nbdkit_next_ops *next_ops, void *nxdata, */ if (truncate_size >= 0) h->size = truncate_size; - if (round_up > 0) + if (round_up > 0) { + if (ROUND_UP (h->size, round_up) > INT64_MAX) { + nbdkit_error ("cannot round size %" PRId64 " up to next boundary of %u", + h->size, round_up); + return -1; + } h->size = ROUND_UP (h->size, round_up); + } if (round_down > 0) h->size = ROUND_DOWN (h->size, rou...
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