diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/byte_order_generic.h | 8 | ||||
-rw-r--r-- | include/byte_order_generic_x86.h | 1 | ||||
-rw-r--r-- | include/json_lib.h | 1 | ||||
-rw-r--r-- | include/my_byteorder.h | 4 | ||||
-rw-r--r-- | include/my_compare.h | 4 | ||||
-rw-r--r-- | include/myisampack.h | 10 |
6 files changed, 15 insertions, 13 deletions
diff --git a/include/byte_order_generic.h b/include/byte_order_generic.h index 8381941b9b9..d2b729a241d 100644 --- a/include/byte_order_generic.h +++ b/include/byte_order_generic.h @@ -28,10 +28,10 @@ (((uint32) (uchar) (A)[2]) << 16) |\ (((uint32) (uchar) (A)[1]) << 8) | \ ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (int32) (((int32) ((uchar) (A)[0])) |\ - (((int32) ((uchar) (A)[1]) << 8)) |\ - (((int32) ((uchar) (A)[2]) << 16)) |\ - (((int32) ((int16) (A)[3]) << 24))) +#define sint4korr(A) (int32) (((uint32) ((uchar) (A)[0])) |\ + (((uint32) ((uchar) (A)[1]) << 8)) |\ + (((uint32) ((uchar) (A)[2]) << 16)) |\ + (((uint32) ((uchar) (A)[3]) << 24))) #define sint8korr(A) (longlong) uint8korr(A) #define uint2korr(A) (uint16) (((uint16) ((uchar) (A)[0])) |\ ((uint16) ((uchar) (A)[1]) << 8)) diff --git a/include/byte_order_generic_x86.h b/include/byte_order_generic_x86.h index 72e00be8c2c..c47564478c6 100644 --- a/include/byte_order_generic_x86.h +++ b/include/byte_order_generic_x86.h @@ -17,6 +17,7 @@ /* Optimized function-like macros for the x86 architecture (_WIN32 included). */ + #define sint2korr(A) (*((const int16 *) (A))) #define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ (((uint32) 255L << 24) | \ diff --git a/include/json_lib.h b/include/json_lib.h index b6add6d13a3..bb649928eaa 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -172,6 +172,7 @@ enum json_states { enum json_value_types { + JSON_VALUE_UNINITALIZED=0, JSON_VALUE_OBJECT=1, JSON_VALUE_ARRAY=2, JSON_VALUE_STRING=3, diff --git a/include/my_byteorder.h b/include/my_byteorder.h index c302781d9fc..abdf19a3632 100644 --- a/include/my_byteorder.h +++ b/include/my_byteorder.h @@ -31,10 +31,10 @@ format (low byte first). There are 'korr' (assume 'corrector') variants for integer types, but 'get' (assume 'getter') for floating point types. */ -#if defined(__i386__) || defined(_WIN32) +#if (defined(__i386__) || defined(_WIN32)) && !defined(WITH_UBSAN) #define MY_BYTE_ORDER_ARCH_OPTIMIZED #include "byte_order_generic_x86.h" -#elif defined(__x86_64__) +#elif defined(__x86_64__) && !defined(WITH_UBSAN) #include "byte_order_generic_x86_64.h" #else #include "byte_order_generic.h" diff --git a/include/my_compare.h b/include/my_compare.h index e9c0513d11c..f936bbe6b0c 100644 --- a/include/my_compare.h +++ b/include/my_compare.h @@ -1,5 +1,5 @@ /* Copyright (c) 2011, Oracle and/or its affiliates. - Copyright (c) 1991, 2020, MariaDB Corporation. + Copyright (c) 1991, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -95,7 +95,7 @@ static inline uchar get_rec_bits(const uchar *ptr, uchar ofs, uint len) { uint16 val= ptr[0]; if (ofs + len > 8) - val|= (uint16)((uint16)(ptr[1]) << 8); + val|= (uint16)(((uint) ptr[1]) << 8); return (uchar) ((val >> ofs) & ((1 << len) - 1)); } diff --git a/include/myisampack.h b/include/myisampack.h index 6bfe1958fbc..f3c5fe7114a 100644 --- a/include/myisampack.h +++ b/include/myisampack.h @@ -30,7 +30,7 @@ #define mi_uint1korr(A) ((uint8)(*A)) #define mi_sint2korr(A) ((int16) (((int16) (((const uchar*) (A))[1])) |\ - ((int16) ((int16) ((const char*) (A))[0]) << 8))) + ((int16) ((uint16) ((const uchar*) (A))[0]) << 8))) #define mi_sint3korr(A) ((int32) (((((const uchar*) (A))[0]) & 128) ? \ (((uint32) 255L << 24) | \ (((uint32) ((const uchar*) (A))[0]) << 16) |\ @@ -39,10 +39,10 @@ (((uint32) ((const uchar*) (A))[0]) << 16) |\ (((uint32) ((const uchar*) (A))[1]) << 8) | \ ((uint32) ((const uchar*) (A))[2]))) -#define mi_sint4korr(A) ((int32) (((int32) (((const uchar*) (A))[3])) |\ - ((int32) (((const uchar*) (A))[2]) << 8) |\ - ((int32) (((const uchar*) (A))[1]) << 16) |\ - ((int32) ((int16) ((const char*) (A))[0]) << 24))) +#define mi_sint4korr(A) ((int32) (((uint32) (((const uchar*) (A))[3])) |\ + ((uint32) (((const uchar*) (A))[2]) << 8) |\ + ((uint32) (((const uchar*) (A))[1]) << 16) |\ + ((uint32) (((const uchar*) (A))[0]) << 24))) #define mi_sint8korr(A) ((longlong) mi_uint8korr(A)) #define mi_uint2korr(A) ((uint16) (((uint16) (((const uchar*) (A))[1])) |\ ((uint16) (((const uchar*) (A))[0]) << 8))) |