Changeset 9675296 in mainline for kernel/generic/src/lib/strtol.c


Ignore:
Timestamp:
2019-07-04T13:00:35Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
53afa639
Parents:
98c4c16
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-07-04 12:49:24)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-07-04 13:00:35)
Message:

Some clang fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/lib/strtol.c

    r98c4c16 r9675296  
    245245}
    246246
    247 static inline intmax_t _strtosigned(const char *nptr, char **endptr, int base,
    248     intmax_t min, intmax_t max, errno_t *err, bool nonstd)
    249 {
    250         bool sgn = false;
    251         uintmax_t number = _strtoumax(nptr, endptr, base, &sgn, err, nonstd);
    252 
    253         if (number > (uintmax_t) max) {
    254                 if (sgn && (number - 1 == (uintmax_t) max)) {
    255                         return min;
    256                 }
    257 
    258                 *err = nonstd ? EOVERFLOW : ERANGE;
    259                 return (sgn ? min : max);
    260         }
    261 
    262         return (sgn ? -number : number);
    263 }
    264 
    265247static inline uintmax_t _strtounsigned(const char *nptr, char **endptr, int base,
    266248    uintmax_t max, errno_t *err, bool nonstd)
Note: See TracChangeset for help on using the changeset viewer.