search for: strtol

Displaying 20 results from an estimated 283 matches for "strtol".

Did you mean: xstrtol
2019 Jan 11
2
strtoi output of empty string inconsistent across platforms
...uot;). > indeed consistent with R's documentation on strtoi(). > What machine would that be? >> But on all the other machines I've seen, 0L is >> returned. This seems to be consistent with the output of >> a simple C program using the underlying strtol function >> (see data.table link for this program, and for full >> sessionInfo() of some environments with differing >> output). >> So, what is the correct output of strtoi("", base = 2L)? >> Is the cross-platform inconsistency to be...
2014 Dec 15
2
Replace atoi and atol with strtol strtoul:Need Help
Hello, I am working on replacing atoi () and atol() functions with strtol() and strtoul() . I came across many files which uses statement like these time_t secs= atoi(data_span.c_str()), here time_t Datatype is not known but wikipedia says that it is integer so is it necessary to replace atoi with strtol over here ?? And is their any document which helps me what each...
2014 Dec 19
2
Replace atoi and atol with strtol strtoul:Need Help
On Sat, Dec 20, 2014 at 12:42:08AM +0530, Priyank Bhatt wrote: > As James said I am attaching two file *date.cc* and *datematchdecider.cc* Please send patches, not complete source files: http://trac.xapian.org/browser/git/xapian-core/HACKING#L1176 Patches are much smaller, and don't require the reviewer to work out the exact version of the source file you started from. Cheers, Olly
2019 Jan 11
2
strtoi output of empty string inconsistent across platforms
...eger_ (which seems consistent with ?strtoi: "Values which cannot be interpreted as integers or would overflow are returned as NA_integer_"). But on all the other machines I've seen, 0L is returned. This seems to be consistent with the output of a simple C program using the underlying strtol function (see data.table link for this program, and for full sessionInfo() of some environments with differing output). So, what is the correct output of strtoi("", base = 2L)? Is the cross-platform inconsistency to be expected/documentable? Michael Chirico [[alternative HTML version...
2005 Apr 17
3
RFC: hexadecimal constants and decimal points
...se are some points stimulated by reading about C history (and related in their implementation). 1) On some platforms > as.integer("0xA") [1] 10 but not all (not on Solaris nor Windows). We do not define what is allowed, and rely on the OS's implementation of strtod (yes, not strtol). It seems that glibc does allow hex: C99 mandates it but C89 seems not to allow it. I think that was a mistake, and strtol should have been used. Then C89 does mandate the handling of hex constants and also octal ones. So changing to strtol would change the meaning of as.integer("011&qu...
2015 Apr 10
2
[LLVMdev] Intercepting dlinfo in memory sanitizer
Thanks! I'll try that. In order to avoid starting a new thread, let me ask you the next question. One of the shared libraries I load calls strtol and msan fails to intercept it. Why would this be? The library seems to be otherwise implemented. One of the potential culprits I saw is that strtol is marked as strong in libc. Is there any workaround? Keno On Thu, Apr 9, 2015 at 3:00 PM, Evgeniy Stepanov <eugeni.stepanov at gmail.com> wro...
2014 Dec 16
2
Replace atoi and atol with strtol strtoul:Need Help
...definition of "val" also. Is that ok to do so ? Just need to clarify . On 16 December 2014 at 04:34, Olly Betts <olly at survex.com> wrote: > > On Tue, Dec 16, 2014 at 02:32:31AM +0530, Priyank Bhatt wrote: > > I am working on replacing atoi () and atol() functions with strtol() and > > strtoul() . I came across many files which uses statement like these > > time_t secs= atoi(data_span.c_str()), here time_t Datatype is not known > but > > wikipedia says that it is integer so is it necessary to replace atoi > with > > strtol over here ?? &g...
2014 Dec 19
2
Replace atoi and atol with strtol strtoul:Need Help
On Thu, Dec 18, 2014 at 11:38:42PM +0000, James Aylett wrote: > Collapsing is done using a valueno (you can tell because collapse_key > is of type Xapian::valueno), which is a 32 bit unsigned integer (see > here: > https://getting-started-with-xapian.readthedocs.org/en/latest/concepts/indexing/values.html). > For 32 bit unsigned you need unsigned long. Xapian::valueno is actually a
2019 Jan 11
0
strtoi output of empty string inconsistent across platforms
...rned > as NA_integer_"). indeed consistent with R's documentation on strtoi(). What machine would that be? > But on all the other machines I've seen, 0L is > returned. This seems to be consistent with the output of a > simple C program using the underlying strtol function (see > data.table link for this program, and for full > sessionInfo() of some environments with differing output). > So, what is the correct output of strtoi("", base = 2L)? > Is the cross-platform inconsistency to be > expected/documentable?...
2019 Jan 12
0
strtoi output of empty string inconsistent across platforms
...consistent with R's documentation on strtoi(). > > What machine would that be? > > >> But on all the other machines I've seen, 0L is > >> returned. This seems to be consistent with the output of > >> a simple C program using the underlying strtol function > >> (see data.table link for this program, and for full > >> sessionInfo() of some environments with differing > >> output). > > >> So, what is the correct output of strtoi("", base = 2L)? > > >> Is the cross...
2023 May 24
1
Synthesize low batt (LB) fron SNMP UPS which does not support this?
...*val, *low; val = dstate_getinfo("battery.charge"); low = dstate_getinfo("battery.charge.low"); - + upsdebugx(2, "%s: charge val/low %s/%s']", __func__, val, low); if (val && low && (strtol(val, NULL, 10) < strtol(low, NULL, 10))) { snprintfcat(status_buf, sizeof(status_buf), " LB"); upsdebugx(2, "%s: appending LB flag [charge '%s' below '%s']", __func__, val, low); @@ -1127,6 +1131,7 @@...
2019 Jan 25
0
[klibc:update-dash] dash: Fix some cosmetic differences from upstream dash
...eturn signo; } #ifdef SIGRTMIN - if ( !strncasecmp(string, "RTMIN", 5) ) { + if (!strncasecmp(string, "RTMIN", 5)) { char *ep; - if ( string[5] && string[5] != '+' ) + if (string[5] && string[5] != '+') return -1; - i = SIGRTMIN + strtol(string+5, &ep, 10); - if ( *ep || i < SIGRTMIN || i > SIGRTMAX ) + signo = SIGRTMIN + strtol(string+5, &ep, 10); + if (*ep || signo < SIGRTMIN || signo > SIGRTMAX) return -1; - return i; + return signo; } - if ( !strncasecmp(string, "RTMAX", 5) ) { + if (!...
2020 Mar 28
0
[klibc:update-dash] dash: Fix some cosmetic differences from upstream dash
...eturn signo; } #ifdef SIGRTMIN - if ( !strncasecmp(string, "RTMIN", 5) ) { + if (!strncasecmp(string, "RTMIN", 5)) { char *ep; - if ( string[5] && string[5] != '+' ) + if (string[5] && string[5] != '+') return -1; - i = SIGRTMIN + strtol(string+5, &ep, 10); - if ( *ep || i < SIGRTMIN || i > SIGRTMAX ) + signo = SIGRTMIN + strtol(string+5, &ep, 10); + if (*ep || signo < SIGRTMIN || signo > SIGRTMAX) return -1; - return i; + return signo; } - if ( !strncasecmp(string, "RTMAX", 5) ) { + if (!...
2006 Nov 04
2
[LLVMdev] Port succesful
...n windows. I will also add other beckend in the future (Sparc, PowerPC). I hope windows using Visual C++ will be soon officially supported :) About the problem I had with system and ltdl.c, it was resolved preaty easily by defining __WINDOWS__ globally in project. I also added a global macro for strtoll because the windows version is strtol (not strtoll). macro replaces strtoll with strtol and it compiles. I found really a lot of warnings in the project. Should I clean them? GCC probably doesn't throw them, so I don't know ... I don't even want to try to compile with VS8 which is...
2020 Jan 22
0
[PATCH] com32/modules: introduce play module
...uint16_t pitch, uint16_t duration) +{ + unsigned int ms = BASE_TEMPO * duration / tempo; + + switch (pitch) { + case T_REST: + beep_off(); + break; + default: + beep_on(pitch); + break; + } + + msleep(ms); +} + +int main(int argc, char *argv[]) +{ + int i; + unsigned int tempo = 0; + + tempo = strtol(argv[1], NULL, 10); + if (!tempo) { + printf("usage: play [<tempo>] [<pitch> <duration>...]\n"); + return 1; + } + + for (i = 2; i + 1 < argc; i += 2) { + uint16_t pitch; + uint16_t duration; + + pitch = strtol(argv[i], NULL, 10); + duration = strtol(argv[i + 1]...
2009 Feb 16
2
[Bug 577] New: cannot set spi/reqid numbers higher than 0x7fffffff (policy match)
...OS/Version: All Status: NEW Severity: normal Priority: P1 Component: iptables AssignedTo: laforge at netfilter.org ReportedBy: chris at linuxinfotag.de When using the -m policy match, the option argument for --spi is converted using strtol(), which returns a signed 32 bit value, so the highest positive value is 0x7fffffff. Instead strtoul() should be used. The same applies for the --reqid option argument. Setting a rule like iptables -A FORWARD -m policy --dir in --spi cafe2342 -j ACCEPT and looking at the chain afterwards will giv...
2014 Dec 18
4
Replace atoi and atol with strtol strtoul:Need Help
Hello, I came across the file *omega.cc* which is in directory* xapain-application/omega/* In this file , atoi is used in *Percentage Relevance cutoff *(293 line no) as Percentage lies between 0-100 their is no need to modify atoi . But do we need to check for error's ? Second Implementation is in *collapsing* (301) in which we collapse set of document under a key,range of this key has not
2020 May 22
6
RFC: *scanf vs. overflow
...as long been known that the C specification of *scanf() leaves behavior undefined for things like int i; sscanf("9999999999999999", "%i", &i); C11 7.21.6.2 P12 "Matches an optionally signed integer, whose format is the same as expected for the subject sequence of the strtol function with the value 0 for the base argument." C11 7.21.6.2 P10 "If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the object, the behavior is undefined." as there is an overflow when consuming the input which matches...
2023 May 24
1
Synthesize low batt (LB) fron SNMP UPS which does not support this?
...t; val = dstate_getinfo("battery.charge"); > low = dstate_getinfo("battery.charge.low"); > - > + upsdebugx(2, "%s: charge val/low %s/%s']", __func__, val, low); > if (val && low && (strtol(val, NULL, 10) < strtol(low, NULL, 10))) { > snprintfcat(status_buf, sizeof(status_buf), " LB"); > upsdebugx(2, "%s: appending LB flag [charge '%s' below '%s']", __func__, val, low); > @@ -1127,6 +1131,7 @@...
2001 Aug 14
2
fixup_imports No implementation for NTDLL.DLL
...r:win32:fixup_imports No implementation for ADVAPI32.DLL.73(ConvertSecurityDescriptorToStringSecurityDescriptorW), setting to 0xdeadbeef err:win32:fixup_imports No implementation for ADVAPI32.DLL.305(LsaGetUserName), setting to 0xdeadbeef err:win32:fixup_imports No implementation for NTDLL.DLL.1162(strtol), setting to 0xdeadbeef err:win32:fixup_imports No implementation for NTDLL.DLL.1101(_ultow), setting to 0xdeadbeef err:win32:fixup_imports No implementation for NTDLL.DLL.515(RtlInitializeCriticalSectionAndSpinCount), setting to 0xdeadbeef err:win32:fixup_imports No implementation for NTDLL.DLL.24...