diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2017-05-23 19:35:50 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2017-05-23 19:35:50 +0200 |
commit | 3e36eb230b65d53acc8e02b00a024e72ed249425 (patch) | |
tree | be89d99353fc70488a5b43707fac12b960f2f29b /storage/connect/json.h | |
parent | e8333389c89c946d3794ec9ea708d308318301a3 (diff) | |
download | mariadb-git-3e36eb230b65d53acc8e02b00a024e72ed249425.tar.gz |
Fix gcc compiler warnings reported by Sergei
modified: storage/connect/array.cpp
modified: storage/connect/array.h
modified: storage/connect/blkfil.cpp
modified: storage/connect/blkfil.h
modified: storage/connect/block.h
modified: storage/connect/colblk.cpp
modified: storage/connect/colblk.h
modified: storage/connect/csort.h
modified: storage/connect/filamvct.cpp
modified: storage/connect/filter.cpp
modified: storage/connect/filter.h
modified: storage/connect/global.h
modified: storage/connect/json.h
modified: storage/connect/plgdbsem.h
modified: storage/connect/plgdbutl.cpp
modified: storage/connect/tabcol.cpp
modified: storage/connect/tabcol.h
modified: storage/connect/tabdos.cpp
modified: storage/connect/tabdos.h
modified: storage/connect/tabjson.cpp
modified: storage/connect/table.cpp
modified: storage/connect/tabodbc.cpp
modified: storage/connect/tabodbc.h
modified: storage/connect/tabsys.h
modified: storage/connect/tabxml.h
modified: storage/connect/value.cpp
modified: storage/connect/value.h
modified: storage/connect/xindex.cpp
modified: storage/connect/xindex.h
modified: storage/connect/xobject.cpp
modified: storage/connect/xobject.h
modified: storage/connect/xtable.h
Set values as nullable when retrieving catalog info
modified: storage/connect/jdbconn.cpp
modified: storage/connect/mysql-test/connect/r/odbc_oracle.result
modified: storage/connect/odbconn.cpp
Change format of Jpath
modified: storage/connect/json.cpp
modified: storage/connect/jsonudf.cpp
modified: storage/connect/mysql-test/connect/r/json.result
modified: storage/connect/mysql-test/connect/r/json_udf.result
modified: storage/connect/mysql-test/connect/r/json_udf_bin.result
modified: storage/connect/mysql-test/connect/r/zip.result
modified: storage/connect/mysql-test/connect/t/json.test
modified: storage/connect/mysql-test/connect/t/json_udf.test
modified: storage/connect/mysql-test/connect/t/json_udf_bin.test
modified: storage/connect/mysql-test/connect/t/zip.test
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabjson.h
modified: storage/connect/tabmgo.cpp
Change null representation from ??? to <null>
modified: storage/connect/json.cpp
Change the name of UDF that are equal to a native JSON function name
modified: storage/connect/jsonudf.cpp
modified: storage/connect/jsonudf.h
modified: storage/connect/mysql-test/connect/t/json_udf.inc
modified: storage/connect/mysql-test/connect/t/json_udf2.inc
Fix bug in making JSON project info
modified: storage/connect/mongofam.cpp
Fix COMPUTE when one argument is null
modified: storage/connect/value.cpp
Value is null only when nullable
modified: storage/connect/value.h
Diffstat (limited to 'storage/connect/json.h')
-rw-r--r-- | storage/connect/json.h | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/storage/connect/json.h b/storage/connect/json.h index 4ea169e1b18..685c1dddcf2 100644 --- a/storage/connect/json.h +++ b/storage/connect/json.h @@ -1,7 +1,7 @@ /**************** json H Declares Source Code File (.H) ****************/ /* Name: json.h Version 1.2 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2014 - 2015 */ +/* (C) Copyright to the author Olivier BERTRAND 2014 - 2017 */ /* */ /* This file contains the JSON classes declares. */ /***********************************************************************/ @@ -13,11 +13,12 @@ #define X #endif -enum JTYP {TYPE_STRG = 1, - TYPE_DBL = 2, - TYPE_BOOL = 4, - TYPE_BINT = 5, - TYPE_INTG = 7, +enum JTYP {TYPE_STRG = TYPE_STRING, + TYPE_DBL = TYPE_DOUBLE, + TYPE_BOOL = TYPE_TINY, + TYPE_BINT = TYPE_BIGINT, + TYPE_DTM = TYPE_DATE, + TYPE_INTG = TYPE_INT, TYPE_JSON = 12, TYPE_JAR, TYPE_JOB, @@ -125,14 +126,14 @@ class JPAIR : public BLOCK { friend PJOB ParseObject(PGLOBAL, int&, STRG&, bool*); friend bool SerializeObject(JOUT *, PJOB); public: - JPAIR(PSZ key) : BLOCK() {Key = key; Val = NULL; Next = NULL;} + JPAIR(PCSZ key) : BLOCK() {Key = key; Val = NULL; Next = NULL;} - inline PSZ GetKey(void) {return Key;} + inline PCSZ GetKey(void) {return Key;} inline PJVAL GetVal(void) {return Val;} inline PJPR GetNext(void) {return Next;} protected: - PSZ Key; // This pair key name + PCSZ Key; // This pair key name PJVAL Val; // To the value of the pair PJPR Next; // To the next pair }; // end of class JPAIR @@ -150,7 +151,7 @@ class JSON : public BLOCK { virtual JTYP GetValType(void) {X return TYPE_JSON;} virtual void InitArray(PGLOBAL g) {X} //virtual PJVAL AddValue(PGLOBAL g, PJVAL jvp = NULL, int *x = NULL) {X return NULL;} - virtual PJPR AddPair(PGLOBAL g, PSZ key) {X return NULL;} + virtual PJPR AddPair(PGLOBAL g, PCSZ key) {X return NULL;} virtual PJAR GetKeyList(PGLOBAL g) {X return NULL;} virtual PJVAL GetValue(const char *key) {X return NULL;} virtual PJOB GetObject(void) {return NULL;} @@ -166,13 +167,13 @@ class JSON : public BLOCK { virtual PSZ GetText(PGLOBAL g, PSZ text) {X return NULL;} virtual bool Merge(PGLOBAL g, PJSON jsp) { X return true; } virtual bool SetValue(PGLOBAL g, PJVAL jvp, int i) { X return true; } - virtual void SetValue(PGLOBAL g, PJVAL jvp, PSZ key) {X} + virtual void SetValue(PGLOBAL g, PJVAL jvp, PCSZ key) {X} virtual void SetValue(PVAL valp) {X} virtual void SetValue(PJSON jsp) {X} virtual void SetString(PGLOBAL g, PSZ s, short c) {X} virtual void SetInteger(PGLOBAL g, int n) {X} virtual void SetFloat(PGLOBAL g, double f) {X} - virtual void DeleteKey(char *k) {X} + virtual void DeleteKey(PCSZ k) {X} virtual bool DeleteValue(int i) {X return true;} virtual bool IsNull(void) {X return true;} @@ -195,14 +196,14 @@ class JOBJECT : public JSON { virtual void Clear(void) {First = Last = NULL; Size = 0;} virtual JTYP GetType(void) {return TYPE_JOB;} virtual PJPR GetFirst(void) {return First;} - virtual PJPR AddPair(PGLOBAL g, PSZ key); + virtual PJPR AddPair(PGLOBAL g, PCSZ key); virtual PJOB GetObject(void) {return this;} virtual PJVAL GetValue(const char* key); virtual PJAR GetKeyList(PGLOBAL g); virtual PSZ GetText(PGLOBAL g, PSZ text); virtual bool Merge(PGLOBAL g, PJSON jsp); - virtual void SetValue(PGLOBAL g, PJVAL jvp, PSZ key); - virtual void DeleteKey(char *k); + virtual void SetValue(PGLOBAL g, PJVAL jvp, PCSZ key); + virtual void DeleteKey(PCSZ k); virtual bool IsNull(void); protected: @@ -253,7 +254,7 @@ class JVALUE : public JSON { JVALUE(PJSON jsp) : JSON() {Jsp = jsp; Value = NULL; Next = NULL; Del = false;} JVALUE(PGLOBAL g, PVAL valp); - JVALUE(PGLOBAL g, PSZ strp); + JVALUE(PGLOBAL g, PCSZ strp); using JSON::GetValue; using JSON::SetValue; |