Commit 40868c47 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

fix warnings returned by gcc v10.0

parent 8b4d92aa
...@@ -1199,15 +1199,14 @@ void BJSON::SetArrayValue(PBVAL bap, PBVAL nvp, int n) ...@@ -1199,15 +1199,14 @@ void BJSON::SetArrayValue(PBVAL bap, PBVAL nvp, int n)
{ {
CheckType(bap, TYPE_JAR); CheckType(bap, TYPE_JAR);
int i = 0; int i = 0;
PBVAL bvp = NULL, pvp = NULL; PBVAL bvp = NULL;
if (bap->To_Val) if (bap->To_Val)
for (bvp = GetArray(bap); bvp; i++, bvp = GetNext(bvp)) for (bvp = GetArray(bap); bvp; i++, bvp = GetNext(bvp))
if (i == n) { if (i == n) {
SetValueVal(bvp, nvp); SetValueVal(bvp, nvp);
return; return;
} else }
pvp = bvp;
if (!bvp) if (!bvp)
AddArrayValue(bap, MOF(nvp)); AddArrayValue(bap, MOF(nvp));
......
...@@ -105,7 +105,7 @@ class BJSON : public BLOCK { ...@@ -105,7 +105,7 @@ class BJSON : public BLOCK {
PSZ GetArrayText(PGLOBAL g, PBVAL bap, PSTRG text); PSZ GetArrayText(PGLOBAL g, PBVAL bap, PSTRG text);
void MergeArray(PBVAL bap1,PBVAL bap2); void MergeArray(PBVAL bap1,PBVAL bap2);
bool DeleteValue(PBVAL bap, int n); 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) inline void AddArrayValue(PBVAL bap, PBVAL nvp = NULL, int* x = NULL)
{AddArrayValue(bap, MOF(nvp), x);} {AddArrayValue(bap, MOF(nvp), x);}
void SetArrayValue(PBVAL bap, PBVAL nvp, int n); void SetArrayValue(PBVAL bap, PBVAL nvp, int n);
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
int IsArgJson(UDF_ARGS* args, uint i); int IsArgJson(UDF_ARGS* args, uint i);
void SetChanged(PBSON bsp); void SetChanged(PBSON bsp);
static PBSON BbinAlloc(PGLOBAL g, ulong len, PBVAL jsp);
/* --------------------------------- JSON UDF ---------------------------------- */ /* --------------------------------- JSON UDF ---------------------------------- */
/*********************************************************************************/ /*********************************************************************************/
...@@ -50,7 +52,7 @@ inline void JsonFreeMem(PGLOBAL g) { ...@@ -50,7 +52,7 @@ inline void JsonFreeMem(PGLOBAL g) {
/*********************************************************************************/ /*********************************************************************************/
/* Allocate and initialize a BSON structure. */ /* 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)); PBSON bsp = (PBSON)PlgDBSubAlloc(g, NULL, sizeof(BSON));
...@@ -415,7 +417,7 @@ PSZ BJNX::MakeKey(UDF_ARGS *args, int i) ...@@ -415,7 +417,7 @@ PSZ BJNX::MakeKey(UDF_ARGS *args, int i)
} // endif *s } // endif *s
if (n < 1) if (n < 1)
return NewStr("Key"); return NewStr((PSZ)"Key");
if (!b) { if (!b) {
p = (PSZ)BsonSubAlloc(n + 1); p = (PSZ)BsonSubAlloc(n + 1);
...@@ -429,7 +431,7 @@ PSZ BJNX::MakeKey(UDF_ARGS *args, int i) ...@@ -429,7 +431,7 @@ PSZ BJNX::MakeKey(UDF_ARGS *args, int i)
return NewStr((PSZ)s); return NewStr((PSZ)s);
} // endif count } // endif count
return NewStr("Key"); return NewStr((PSZ)"Key");
} // end of MakeKey } // end of MakeKey
/*********************************************************************************/ /*********************************************************************************/
......
...@@ -1734,7 +1734,7 @@ bool BINFAM::OpenTableFile(PGLOBAL g) { ...@@ -1734,7 +1734,7 @@ bool BINFAM::OpenTableFile(PGLOBAL g) {
/*********************************************************************/ /*********************************************************************/
return AllocateBuffer(g); return AllocateBuffer(g);
} // end of OpenTableFile } // end of OpenTableFile
#endif 0 #endif // 0
/***********************************************************************/ /***********************************************************************/
/* Allocate the line buffer. For mode Delete a bigger buffer has to */ /* Allocate the line buffer. For mode Delete a bigger buffer has to */
......
...@@ -34,6 +34,8 @@ static char *bin_handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result, ...@@ -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 PJSON JsonNew(PGLOBAL g, JTYP type);
static PJVAL JvalNew(PGLOBAL g, JTYP type, void *vp = NULL); static PJVAL JvalNew(PGLOBAL g, JTYP type, void *vp = NULL);
static PJSNX JsnxNew(PGLOBAL g, PJSON jsp, int type, int len = 64); static PJSNX JsnxNew(PGLOBAL g, PJSON jsp, int type, int len = 64);
uint GetJsonGroupSize(void);
static void SetChanged(PBSON bsp);
uint JsonGrpSize = 10; uint JsonGrpSize = 10;
...@@ -1155,7 +1157,7 @@ PBSON JbinAlloc(PGLOBAL g, UDF_ARGS *args, ulong len, PJSON jsp) ...@@ -1155,7 +1157,7 @@ PBSON JbinAlloc(PGLOBAL g, UDF_ARGS *args, ulong len, PJSON jsp)
/*********************************************************************************/ /*********************************************************************************/
/* Set the BSON chain as changed. */ /* Set the BSON chain as changed. */
/*********************************************************************************/ /*********************************************************************************/
void SetChanged(PBSON bsp) static void SetChanged(PBSON bsp)
{ {
if (bsp->Bsp) if (bsp->Bsp)
SetChanged(bsp->Bsp); SetChanged(bsp->Bsp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment