summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-04-21 09:01:01 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-04-21 09:01:01 +0300
commit80ed136e6dd4a021b1fc9b7bd7077bf989c3d247 (patch)
treecc24f0e4e9241920329865a1b66c1d086aaeaa9a /include
parent675c22c065110be03a5fab82442d2c3dc32aefff (diff)
parenta0588d54a20488b17a178244989e1abc5151a88a (diff)
downloadmariadb-git-80ed136e6dd4a021b1fc9b7bd7077bf989c3d247.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'include')
-rw-r--r--include/byte_order_generic.h8
-rw-r--r--include/byte_order_generic_x86.h1
-rw-r--r--include/json_lib.h1
-rw-r--r--include/my_byteorder.h4
-rw-r--r--include/my_compare.h4
-rw-r--r--include/myisampack.h10
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)))