add IS_HEX_CHAR macro define
parent
0aa66e2823
commit
b3c89b2316
|
|
@ -116,6 +116,8 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind);
|
|||
#endif
|
||||
|
||||
#define IS_UPPER_HEX(ch) ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F'))
|
||||
#define IS_HEX_CHAR(ch) (IS_UPPER_HEX(ch) || (ch >= 'a' && ch <= 'f'))
|
||||
|
||||
#define STRERROR(no) (strerror(no) != NULL ? strerror(no) : "Unkown error")
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
|
|
|
|||
|
|
@ -1379,14 +1379,14 @@ static unsigned int crc_table[256] = {
|
|||
crc = crc_table[(crc ^ *pKey) & 0xFF] ^ (crc >> 8); \
|
||||
} \
|
||||
|
||||
int CRC32(void *key, const int key_len)
|
||||
int CRC32(const void *key, const int key_len)
|
||||
{
|
||||
CRC32_BODY(CRC32_XINIT)
|
||||
|
||||
return crc ^ CRC32_XOROT;
|
||||
}
|
||||
|
||||
int CRC32_ex(void *key, const int key_len, \
|
||||
int CRC32_ex(const void *key, const int key_len, \
|
||||
const int init_value)
|
||||
{
|
||||
CRC32_BODY(init_value)
|
||||
|
|
|
|||
|
|
@ -350,8 +350,8 @@ int simple_hash(const void* key, const int key_len);
|
|||
int simple_hash_ex(const void* key, const int key_len, \
|
||||
const int init_value);
|
||||
|
||||
int CRC32(void *key, const int key_len);
|
||||
int CRC32_ex(void *key, const int key_len, \
|
||||
int CRC32(const void *key, const int key_len);
|
||||
int CRC32_ex(const void *key, const int key_len, \
|
||||
const int init_value);
|
||||
|
||||
#define CRC32_FINAL(crc) (crc ^ CRC32_XOROT)
|
||||
|
|
|
|||
|
|
@ -2113,11 +2113,6 @@ char *urldecode(const char *src, const int src_len, char *dest, int *dest_len)
|
|||
|
||||
char *urldecode_ex(const char *src, const int src_len, char *dest, int *dest_len)
|
||||
{
|
||||
#define IS_HEX_CHAR(ch) \
|
||||
((ch >= '0' && ch <= '9') || \
|
||||
(ch >= 'a' && ch <= 'f') || \
|
||||
(ch >= 'A' && ch <= 'F'))
|
||||
|
||||
#define HEX_VALUE(ch, value) \
|
||||
if (ch >= '0' && ch <= '9') \
|
||||
{ \
|
||||
|
|
|
|||
Loading…
Reference in New Issue