--- parser3/src/main/pa_string.C 2016/12/29 15:24:49 1.259 +++ parser3/src/main/pa_string.C 2020/10/10 06:08:37 1.263 @@ -1,7 +1,7 @@ /** @file Parser: string class. @see untalength_t.C. - Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -12,10 +12,13 @@ #include "pa_charset.h" #include "pa_vregex.h" -volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.259 2016/12/29 15:24:49 moko Exp $" IDENT_PA_STRING_H; +volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.263 2020/10/10 06:08:37 moko Exp $" IDENT_PA_STRING_H; const String String::Empty; +#define COMPILE_ASSERT(x) extern int assert_checker[(x) ? 1 : -1] +COMPILE_ASSERT(sizeof(String::Languages) == sizeof(CORD)); + // pa_atoui is based on Manuel Novoa III _strto_l for uClibc template inline T pa_ato_any(const char *str, int base, const String* problem_source,const T max){ @@ -83,10 +86,16 @@ template inline T pa_ato_any } unsigned int pa_atoui(const char *str, int base, const String* problem_source){ + if(!str) + return 0; + return pa_ato_any(str, base, problem_source, UINT_MAX); } unsigned long long pa_atoul(const char *str, int base, const String* problem_source){ + if(!str) + return 0; + return pa_ato_any(str, base, problem_source, ULLONG_MAX); }