Ignore:
Timestamp:
2018-01-31T12:02:00Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5595841
Parents:
a0a9cc2 (diff), 14d789c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'upstream/master' into forwardport

change tmon includes because of new stdlib

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/src/stdlib/strtold.c

    ra0a9cc2 r2b3dd78  
    3333 */
    3434
    35 #define LIBPOSIX_INTERNAL
    36 #define __POSIX_DEF__(x) posix_##x
    37 
    3835#include "../internal/common.h"
    3936#include "libc/stdbool.h"
     
    5047
    5148#include "posix/float.h"
     49
     50#include "libc/str.h"
    5251
    5352#ifndef HUGE_VALL
     
    345344        bool after_decimal = false;
    346345       
    347         while (posix_isxdigit(*str) || (!after_decimal && *str == DECIMAL_POINT)) {
     346        while (isxdigit(*str) || (!after_decimal && *str == DECIMAL_POINT)) {
    348347                if (*str == DECIMAL_POINT) {
    349348                        after_decimal = true;
     
    405404 * @return An approximate representation of the input floating-point number.
    406405 */
    407 long double posix_strtold(const char *restrict nptr, char **restrict endptr)
     406long double strtold(const char *restrict nptr, char **restrict endptr)
    408407{
    409408        assert(nptr != NULL);
     
    431430       
    432431        /* check for NaN */
    433         if (posix_strncasecmp(&nptr[i], "nan", 3) == 0) {
     432        if (strncasecmp(&nptr[i], "nan", 3) == 0) {
    434433                // FIXME: return NaN
    435434                // TODO: handle the parenthesised case
     
    443442       
    444443        /* check for Infinity */
    445         if (posix_strncasecmp(&nptr[i], "inf", 3) == 0) {
     444        if (strncasecmp(&nptr[i], "inf", 3) == 0) {
    446445                i += 3;
    447                 if (posix_strncasecmp(&nptr[i], "inity", 5) == 0) {
     446                if (strncasecmp(&nptr[i], "inity", 5) == 0) {
    448447                        i += 5;
    449448                }
     
    457456        /* check for a hex number */
    458457        if (nptr[i] == '0' && tolower(nptr[i + 1]) == 'x' &&
    459             (posix_isxdigit(nptr[i + 2]) ||
    460             (nptr[i + 2] == RADIX && posix_isxdigit(nptr[i + 3])))) {
     458            (isxdigit(nptr[i + 2]) ||
     459            (nptr[i + 2] == RADIX && isxdigit(nptr[i + 3])))) {
    461460                i += 2;
    462461               
Note: See TracChangeset for help on using the changeset viewer.