|
|
| version 1.76, 2015/06/02 18:46:05 | version 1.78, 2015/10/06 22:20:50 |
|---|---|
| Line 112 static void math2(Request& r, MethodPara | Line 112 static void math2(Request& r, MethodPara |
| MATH2(pow) | MATH2(pow) |
| inline bool is_salt_body_char(int c) { | inline bool is_salt_body_char(unsigned char c) { |
| return pa_isalnum(c) || c == '.' || c=='/'; | return pa_isalnum(c) || c == '.' || c=='/'; |
| } | } |
| static size_t calc_prefix_size(const char* salt) { | static size_t calc_prefix_size(const char* salt) { |
| if(strlen(salt)) { | if(strlen(salt)) { |
| if(!is_salt_body_char((unsigned char)salt[0])) { // $... {... | if(!is_salt_body_char((unsigned char)salt[0])) { // $... {... |
| Line 507 static void _crc32(Request& r, MethodPar | Line 508 static void _crc32(Request& r, MethodPar |
| r.write_no_lang(*new VInt(pa_crc32(string, strlen(string)))); | r.write_no_lang(*new VInt(pa_crc32(string, strlen(string)))); |
| } | } |
| static void toBase(unsigned int value, unsigned int base, char*& ptr){ | static void toBase(unsigned long long int value, unsigned int base, char*& ptr){ |
| static const char* hex="0123456789ABCDEF"; | static const char* hex="0123456789ABCDEF"; |
| int rest = value % base; | int rest = value % base; |
| if(value >= base) | if(value >= base) |
| Line 540 static void _convert(Request& r, MethodP | Line 541 static void _convert(Request& r, MethodP |
| str++; | str++; |
| } | } |
| unsigned int value=pa_atoui(str, base_from); | unsigned long long int value=pa_atoul(str, base_from); |
| char result_cstr[sizeof(unsigned int)*8+1/*minus for negative number*/+1/*terminator*/]; | char result_cstr[sizeof(unsigned long long int)*8+1/*minus for negative number*/+1/*terminator*/]; |
| char* ptr=result_cstr; | char* ptr=result_cstr; |
| if(negative) | if(negative) |
| *ptr++='-'; | *ptr++='-'; |