Fix strtol isspace calls.

This commit is contained in:
Jonas 'Sortie' Termansen 2015-05-13 18:26:24 +02:00
parent 1d7c157848
commit 8c0252300e
12 changed files with 14 additions and 2 deletions

View File

@ -24,6 +24,7 @@
#define STRTOL strtoimax
#define STRTOL_CHAR char
#define STRTOL_UCHAR unsigned char
#define STRTOL_L(x) x
#define STRTOL_ISSPACE isspace
#define STRTOL_INT intmax_t

View File

@ -24,6 +24,7 @@
#define STRTOL strtoumax
#define STRTOL_CHAR char
#define STRTOL_UCHAR unsigned char
#define STRTOL_L(x) x
#define STRTOL_ISSPACE isspace
#define STRTOL_INT uintmax_t

View File

@ -24,6 +24,7 @@
#define STRTOL wcstoimax
#define STRTOL_CHAR wchar_t
#define STRTOL_UCHAR wint_t
#define STRTOL_L(x) L##x
#define STRTOL_ISSPACE iswspace
#define STRTOL_INT intmax_t

View File

@ -24,6 +24,7 @@
#define STRTOL wcstoumax
#define STRTOL_CHAR wchar_t
#define STRTOL_UCHAR wint_t
#define STRTOL_L(x) L##x
#define STRTOL_ISSPACE iswspace
#define STRTOL_INT uintmax_t

View File

@ -1,6 +1,6 @@
/*******************************************************************************
Copyright(C) Jonas 'Sortie' Termansen 2011, 2013, 2014.
Copyright(C) Jonas 'Sortie' Termansen 2011, 2013, 2014, 2015.
This file is part of the Sortix C Library.
@ -25,6 +25,7 @@
#ifndef STRTOL
#define STRTOL strtol
#define STRTOL_CHAR char
#define STRTOL_UCHAR unsigned char
#define STRTOL_L(x) x
#define STRTOL_ISSPACE isspace
#define STRTOL_INT long
@ -138,7 +139,7 @@ STRTOL_INT STRTOL(const STRTOL_CHAR* restrict str,
const STRTOL_CHAR* original_str = str;
// Skip any leading white space.
while ( STRTOL_ISSPACE(*str) )
while ( STRTOL_ISSPACE((STRTOL_UCHAR) *str) )
str++;
bool negative = false;

View File

@ -24,6 +24,7 @@
#define STRTOL strtoll
#define STRTOL_CHAR char
#define STRTOL_UCHAR unsigned char
#define STRTOL_L(x) x
#define STRTOL_ISSPACE isspace
#define STRTOL_INT long long

View File

@ -24,6 +24,7 @@
#define STRTOL strtoul
#define STRTOL_CHAR char
#define STRTOL_UCHAR unsigned char
#define STRTOL_L(x) x
#define STRTOL_ISSPACE isspace
#define STRTOL_INT unsigned long

View File

@ -24,6 +24,7 @@
#define STRTOL strtoull
#define STRTOL_CHAR char
#define STRTOL_UCHAR unsigned char
#define STRTOL_L(x) x
#define STRTOL_ISSPACE isspace
#define STRTOL_INT unsigned long long

View File

@ -24,6 +24,7 @@
#define STRTOL wcstol
#define STRTOL_CHAR wchar_t
#define STRTOL_UCHAR wint_t
#define STRTOL_L(x) L##x
#define STRTOL_ISSPACE iswspace
#define STRTOL_INT long

View File

@ -24,6 +24,7 @@
#define STRTOL wcstoll
#define STRTOL_CHAR wchar_t
#define STRTOL_UCHAR wint_t
#define STRTOL_L(x) L##x
#define STRTOL_ISSPACE iswspace
#define STRTOL_INT long long

View File

@ -24,6 +24,7 @@
#define STRTOL wcstoul
#define STRTOL_CHAR wchar_t
#define STRTOL_UCHAR wint_t
#define STRTOL_L(x) L##x
#define STRTOL_ISSPACE iswspace
#define STRTOL_INT unsigned long

View File

@ -24,6 +24,7 @@
#define STRTOL wcstoull
#define STRTOL_CHAR wchar_t
#define STRTOL_UCHAR wint_t
#define STRTOL_L(x) L##x
#define STRTOL_ISSPACE iswspace
#define STRTOL_INT unsigned long long