summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-01-28 18:30:32 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2021-01-29 12:04:09 +0100
commit40868c4765383549d1fe5650e6bce1ca5078b875 (patch)
treedf01685ca03d6def4ce912018aac2d723f05f613
parent8b4d92aa4cdb03d1ff0069e8e1da0a88622e192f (diff)
downloadmariadb-git-40868c4765383549d1fe5650e6bce1ca5078b875.tar.gz
fix warnings returned by gcc v10.0
-rw-r--r--storage/connect/bson.cpp5
-rw-r--r--storage/connect/bson.h2
-rw-r--r--storage/connect/bsonudf.cpp8
-rw-r--r--storage/connect/filamtxt.cpp2
-rw-r--r--storage/connect/jsonudf.cpp4
5 files changed, 12 insertions, 9 deletions
diff --git a/storage/connect/bson.cpp b/storage/connect/bson.cpp
index fc58303a73f..7728d488a00 100644
--- a/storage/connect/bson.cpp
+++ b/storage/connect/bson.cpp
@@ -1199,15 +1199,14 @@ void BJSON::SetArrayValue(PBVAL bap, PBVAL nvp, int n)
{
CheckType(bap, TYPE_JAR);
int i = 0;
- PBVAL bvp = NULL, pvp = NULL;
+ PBVAL bvp = NULL;
if (bap->To_Val)
for (bvp = GetArray(bap); bvp; i++, bvp = GetNext(bvp))
if (i == n) {
SetValueVal(bvp, nvp);
return;
- } else
- pvp = bvp;
+ }
if (!bvp)
AddArrayValue(bap, MOF(nvp));
diff --git a/storage/connect/bson.h b/storage/connect/bson.h
index 6eb6c019c1a..5420c6f2f36 100644
--- a/storage/connect/bson.h
+++ b/storage/connect/bson.h
@@ -105,7 +105,7 @@ public:
PSZ GetArrayText(PGLOBAL g, PBVAL bap, PSTRG text);
void MergeArray(PBVAL bap1,PBVAL bap2);
bool DeleteValue(PBVAL bap, int n);
- void AddArrayValue(PBVAL bap, OFFSET nvp = NULL, int* x = NULL);
+ void AddArrayValue(PBVAL bap, OFFSET nvp = 0, int* x = NULL);
inline void AddArrayValue(PBVAL bap, PBVAL nvp = NULL, int* x = NULL)
{AddArrayValue(bap, MOF(nvp), x);}
void SetArrayValue(PBVAL bap, PBVAL nvp, int n);
diff --git a/storage/connect/bsonudf.cpp b/storage/connect/bsonudf.cpp
index 719b7d7509a..533d641219e 100644
--- a/storage/connect/bsonudf.cpp
+++ b/storage/connect/bsonudf.cpp
@@ -30,6 +30,8 @@
int IsArgJson(UDF_ARGS* args, uint i);
void SetChanged(PBSON bsp);
+static PBSON BbinAlloc(PGLOBAL g, ulong len, PBVAL jsp);
+
/* --------------------------------- JSON UDF ---------------------------------- */
/*********************************************************************************/
@@ -50,7 +52,7 @@ inline void JsonFreeMem(PGLOBAL g) {
/*********************************************************************************/
/* Allocate and initialize a BSON structure. */
/*********************************************************************************/
-PBSON BbinAlloc(PGLOBAL g, ulong len, PBVAL jsp)
+static PBSON BbinAlloc(PGLOBAL g, ulong len, PBVAL jsp)
{
PBSON bsp = (PBSON)PlgDBSubAlloc(g, NULL, sizeof(BSON));
@@ -415,7 +417,7 @@ PSZ BJNX::MakeKey(UDF_ARGS *args, int i)
} // endif *s
if (n < 1)
- return NewStr("Key");
+ return NewStr((PSZ)"Key");
if (!b) {
p = (PSZ)BsonSubAlloc(n + 1);
@@ -429,7 +431,7 @@ PSZ BJNX::MakeKey(UDF_ARGS *args, int i)
return NewStr((PSZ)s);
} // endif count
- return NewStr("Key");
+ return NewStr((PSZ)"Key");
} // end of MakeKey
/*********************************************************************************/
diff --git a/storage/connect/filamtxt.cpp b/storage/connect/filamtxt.cpp
index 3c2c49de8b7..30ce19a5d37 100644
--- a/storage/connect/filamtxt.cpp
+++ b/storage/connect/filamtxt.cpp
@@ -1734,7 +1734,7 @@ bool BINFAM::OpenTableFile(PGLOBAL g) {
/*********************************************************************/
return AllocateBuffer(g);
} // end of OpenTableFile
-#endif 0
+#endif // 0
/***********************************************************************/
/* Allocate the line buffer. For mode Delete a bigger buffer has to */
diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp
index 53818cbe00b..6669b7af5d8 100644
--- a/storage/connect/jsonudf.cpp
+++ b/storage/connect/jsonudf.cpp
@@ -34,6 +34,8 @@ static char *bin_handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
static PJSON JsonNew(PGLOBAL g, JTYP type);
static PJVAL JvalNew(PGLOBAL g, JTYP type, void *vp = NULL);
static PJSNX JsnxNew(PGLOBAL g, PJSON jsp, int type, int len = 64);
+uint GetJsonGroupSize(void);
+static void SetChanged(PBSON bsp);
uint JsonGrpSize = 10;
@@ -1155,7 +1157,7 @@ PBSON JbinAlloc(PGLOBAL g, UDF_ARGS *args, ulong len, PJSON jsp)
/*********************************************************************************/
/* Set the BSON chain as changed. */
/*********************************************************************************/
-void SetChanged(PBSON bsp)
+static void SetChanged(PBSON bsp)
{
if (bsp->Bsp)
SetChanged(bsp->Bsp);