mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
fix warnings returned by gcc v10.0
This commit is contained in:
parent
8b4d92aa4c
commit
40868c4765
5 changed files with 12 additions and 9 deletions
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
/*********************************************************************************/
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue