search for: parse_uint64

Displaying 2 results from an estimated 2 matches for "parse_uint64".

Did you mean: parse_uint32
2012 Jul 16
2
[PATCH V4] NEW API: add new api xfs_info
...ret; +} + +static int +parse_uint32 (uint32_t *ret, const char *str) +{ + uint32_t r; + + if (sscanf (str, "%" SCNu32, &r) != 1) { + reply_with_error ("cannot parse numeric field from isoinfo: %s", str); + return -1; + } + + *ret = r; + return 0; +} + +static int +parse_uint64 (uint64_t *ret, const char *str) +{ + uint64_t r; + + if (sscanf (str, "%" SCNu64, &r) != 1) { + reply_with_error ("cannot parse numeric field from isoinfo: %s", str); + return -1; + } + + *ret = r; + return 0; +} + +static guestfs_int_xfsinfo * +parse_xfs_info (c...
2012 Apr 17
1
[PATCH 2/2] replace local_strtoull with _strtoui64 in windows
...one */ -static FLAC__uint64 local__strtoull(const char *src) -{ - FLAC__uint64 ret = 0; - int c; - FLAC__ASSERT(0 != src); - while(0 != (c = *src++)) { - c -= '0'; - if(c >= 0 && c <= 9) - ret = (ret * 10) + c; - else - break; - } - return ret; -} -#endif - FLAC__bool parse_uint64(const char *src, FLAC__uint64 *dest) { FLAC__ASSERT(0 != src); if(strlen(src) == 0 || strspn(src, "0123456789") != strlen(src)) return false; -#ifdef _MSC_VER - *dest = local__strtoull(src); -#else *dest = strtoull(src, 0, 10); -#endif return true; } -- 1.7.7