Commit 30c90890 authored by Monty's avatar Monty

Fixed compiler warnings from CONNECT

parent 5a20b30f
......@@ -83,7 +83,7 @@ BDOC::BDOC(PGLOBAL G) : BJSON(G, NULL)
PBVAL BDOC::ParseJson(PGLOBAL g, char* js, size_t lng)
{
size_t i;
bool b = false, ptyp = (bool *)pty;
bool b = false;
PBVAL bvp = NULL;
s = js;
......@@ -145,7 +145,7 @@ PBVAL BDOC::ParseJson(PGLOBAL g, char* js, size_t lng)
b = false;
break;
} // endif b
/* fall through */
default:
if (bvp->Type != TYPE_UNKNOWN) {
bvp->To_Val = ParseAsArray(i);
......@@ -683,7 +683,7 @@ bool BDOC::SerializeArray(OFFSET arp, bool b)
} else if (jp->WriteChr('['))
return true;
for (vp; vp; vp = MVP(vp->Next)) {
for (; vp; vp = MVP(vp->Next)) {
if (first)
first = false;
else if ((!b || jp->Prty()) && jp->WriteChr(','))
......@@ -718,7 +718,7 @@ bool BDOC::SerializeObject(OFFSET obp)
if (jp->WriteChr('{'))
return true;
for (prp; prp; prp = GetNext(prp)) {
for (; prp; prp = GetNext(prp)) {
if (first)
first = false;
else if (jp->WriteChr(','))
......
......@@ -87,6 +87,7 @@ static PBSON BbinAlloc(PGLOBAL g, ulong len, PBVAL jsp)
/*********************************************************************************/
/* SubAlloc a new BJNX class with protection against memory exhaustion. */
/*********************************************************************************/
#ifdef NOT_USED
static PBJNX BjnxNew(PGLOBAL g, PBVAL vlp, int type, int len)
{
PBJNX bjnx;
......@@ -103,7 +104,7 @@ static PBJNX BjnxNew(PGLOBAL g, PBVAL vlp, int type, int len)
return bjnx;
} /* end of BjnxNew */
#endif
/* ----------------------------------- BSNX ------------------------------------ */
/*********************************************************************************/
......@@ -286,7 +287,7 @@ my_bool BJNX::ParseJpath(PGLOBAL g)
{
char* p, * p1 = NULL, * p2 = NULL, * pbuf = NULL;
int i;
my_bool a, mul = false;
my_bool a;
if (Parsed)
return false; // Already done
......@@ -497,7 +498,8 @@ void BJNX::SetJsonValue(PGLOBAL g, PVAL vp, PBVAL vlp)
break;
case TYPE_NULL:
vp->SetNull(true);
default:
/* fall through */
default:
vp->Reset();
} // endswitch Type
......@@ -540,7 +542,6 @@ PVAL BJNX::GetColumnValue(PGLOBAL g, PBVAL row, int i)
/*********************************************************************************/
PBVAL BJNX::GetRowValue(PGLOBAL g, PBVAL row, int i)
{
my_bool expd = false;
PBVAL bap;
PBVAL vlp = NULL;
......@@ -1083,7 +1084,7 @@ my_bool BJNX::CheckPath(PGLOBAL g, UDF_ARGS *args, PBVAL jsp, PBVAL& jvp, int n)
PSZ BJNX::Locate(PGLOBAL g, PBVAL jsp, PBVAL jvp, int k)
{
PSZ str = NULL;
my_bool b = false, err = true;
my_bool err = true;
g->Message[0] = 0;
......@@ -1204,7 +1205,7 @@ my_bool BJNX::LocateValue(PGLOBAL g, PBVAL jvp)
PSZ BJNX::LocateAll(PGLOBAL g, PBVAL jsp, PBVAL bvp, int mx)
{
PSZ str = NULL;
my_bool b = false, err = true;
my_bool err = true;
PJPN jnp;
if (!jsp) {
......@@ -2894,7 +2895,7 @@ my_bool bson_array_grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
return true;
PGLOBAL g = (PGLOBAL)initid->ptr;
PBJNX bxp = new(g) BJNX(g);
(void) new(g) BJNX(g);
JsonMemSave(g);
return false;
......@@ -2967,7 +2968,7 @@ my_bool bson_object_grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
return true;
PGLOBAL g = (PGLOBAL)initid->ptr;
PBJNX bxp = new(g) BJNX(g);
(void) new(g) BJNX(g);
JsonMemSave(g);
return false;
......@@ -3037,7 +3038,7 @@ my_bool bson_test_init(UDF_INIT* initid, UDF_ARGS* args, char* message) {
char* bson_test(UDF_INIT* initid, UDF_ARGS* args, char* result,
unsigned long* res_length, char* is_null, char* error) {
char* str = NULL, * sap = NULL, * fn = NULL;
char* str = NULL, * fn = NULL;
int pretty = 1;
PBVAL bvp;
PGLOBAL g = (PGLOBAL)initid->ptr;
......@@ -5035,7 +5036,7 @@ char* bbin_array_add_values(UDF_INIT* initid, UDF_ARGS* args, char* result,
if (!CheckMemory(g, initid, args, args->arg_count, true)) {
uint i = 0;
BJNX bnx(g);
PBVAL arp, top, jvp = NULL;
PBVAL arp, top;
PBVAL bvp = bnx.MakeValue(args, 0, true, &top);
if (bvp->Type == TYPE_JAR) {
......@@ -5659,7 +5660,7 @@ char *bbin_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
if (g->Xchk) {
bsp = (PBSON)g->Xchk;
} else if (!CheckMemory(g, initid, args, 1, true, true)) {
char *path = MakePSZ(g, args, 1);
// char *path = MakePSZ(g, args, 1);
BJNX bnx(g, NULL, TYPE_STRING, initid->max_length);
PBVAL top, jvp = NULL;
PBVAL jsp = bnx.MakeValue(args, 0, true, &top);
......
......@@ -838,7 +838,7 @@ PBVAL BCUTIL::MakeBson(PGLOBAL g, PBVAL jsp, int n)
/***********************************************************************/
PBVAL BCUTIL::GetRowValue(PGLOBAL g, PBVAL row, int i)
{
int nod = Cp->Nod, n = nod - 1;
int nod = Cp->Nod;
JNODE *nodes = Cp->Nodes;
PBVAL arp;
PBVAL bvp = NULL;
......@@ -1970,6 +1970,7 @@ PSZ BSONCOL::GetJpath(PGLOBAL g, bool proj)
return NULL;
for (p1 = p2 = mgopath; *p1; p1++)
{
if (i) { // Inside []
if (isdigit(*p1)) {
if (!proj)
......@@ -2007,14 +2008,14 @@ PSZ BSONCOL::GetJpath(PGLOBAL g, bool proj)
p2--; // Suppress last :*
break;
} // endif p2
/* fall through */
default:
*p2++ = *p1;
break;
} // endswitch p1;
*p2 = 0;
return mgopath;
}
*p2 = 0;
return mgopath;
} else
return NULL;
......
......@@ -1038,7 +1038,7 @@ bool TDBJSN::OpenDB(PGLOBAL g)
/*********************************************************************/
/* Lrecl is Ok. */
/*********************************************************************/
size_t linelen = Lrecl;
MODE mode = Mode;
// Buffer must be allocated in g->Sarea
......@@ -1683,7 +1683,6 @@ PVAL JSONCOL::MakeJson(PGLOBAL g, PJSON jsp, int n)
/***********************************************************************/
PJVAL JSONCOL::GetRowValue(PGLOBAL g, PJSON row, int i)
{
int n = Nod - 1;
PJVAL val = NULL;
for (; i < Nod && row; i++) {
......@@ -1810,7 +1809,6 @@ void JSONCOL::ReadColumn(PGLOBAL g)
/***********************************************************************/
PVAL JSONCOL::GetColumnValue(PGLOBAL g, PJSON row, int i)
{
int n = Nod - 1;
PJAR arp;
PJVAL val = NULL;
......
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