OCT 1. 更正ARRAY_SIZE编译警告
This commit is contained in:
parent
24ea2e2525
commit
ba11669324
|
@ -12,6 +12,7 @@
|
||||||
#include "zlog_module.h"
|
#include "zlog_module.h"
|
||||||
#ifdef JSON_SCHEMA_ON
|
#ifdef JSON_SCHEMA_ON
|
||||||
#include "json_schema/jsoncdaccord.h"
|
#include "json_schema/jsoncdaccord.h"
|
||||||
|
#include "common.h"
|
||||||
#endif
|
#endif
|
||||||
#define CURRENT_PROTOCOL_VERSION (1)
|
#define CURRENT_PROTOCOL_VERSION (1)
|
||||||
|
|
||||||
|
@ -30,14 +31,14 @@ typedef struct {
|
||||||
} JSON_SCHEMA_CTX, *PJSON_SCHEMA_CTX;
|
} JSON_SCHEMA_CTX, *PJSON_SCHEMA_CTX;
|
||||||
|
|
||||||
static JSON_SCHEMA_CTX g_json_sch[] = {
|
static JSON_SCHEMA_CTX g_json_sch[] = {
|
||||||
{"{\"type\":\"object\",\"required\":[\"ver\"]}", "Missing required field [ver]" },
|
{"{\"type\":\"object\",\"required\":[\"ver\"]}", "Missing required field [ver]" },
|
||||||
{"{\"type\":\"object\",\"required\":[\"cryptoType\"]}", "Missing required field [cryptoType]" },
|
{"{\"type\":\"object\",\"required\":[\"cryptoType\"]}", "Missing required field [cryptoType]" },
|
||||||
{"{\"type\":\"object\",\"required\":[\"timeStamp\"]}", "Missing required field [timeStamp]" },
|
{"{\"type\":\"object\",\"required\":[\"timeStamp\"]}", "Missing required field [timeStamp]" },
|
||||||
{"{\"type\":\"object\",\"required\":[\"msgContent\"]}", "Missing required field [msgContent]" },
|
{"{\"type\":\"object\",\"required\":[\"msgContent\"]}", "Missing required field [msgContent]" },
|
||||||
{"{\"properties\":{\"ver\":{\"type\":\"integer\"}}}", "[ver] should be an integer value" },
|
{"{\"properties\":{\"ver\":{\"type\":\"integer\"}}}", "[ver] should be an integer value" },
|
||||||
{"{\"properties\":{\"cryptoType\":{\"type\":\"integer\"}}}", "[cryptoType] should be an integer value"},
|
{"{\"properties\":{\"cryptoType\":{\"type\":\"integer\"}}}", "[cryptoType] should be an integer value"},
|
||||||
{"{\"properties\":{\"cryptoType\":{\"minimum\":0,\"maximum\":4}}}", "Undefined type in field [cryptoType]" },
|
{"{\"properties\":{\"cryptoType\":{\"minimum\":0,\"maximum\":4}}}", "Undefined type in field [cryptoType]" },
|
||||||
{"{\"properties\":{\"timeStamp\":{\"type\":\"integer\"}}}", "[timeStamp] should be an integer value" },
|
{"{\"properties\":{\"timeStamp\":{\"type\":\"integer\"}}}", "[timeStamp] should be an integer value" },
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *proto_schema_validation(const char *pJsonStr) {
|
const char *proto_schema_validation(const char *pJsonStr) {
|
||||||
|
@ -115,7 +116,7 @@ const char *proto_decode_context(const char *pString, unsigned int *pVer, unsign
|
||||||
char *pMsgContent = NULL;
|
char *pMsgContent = NULL;
|
||||||
cJSON *pRoot;
|
cJSON *pRoot;
|
||||||
#ifdef JSON_SCHEMA_ON
|
#ifdef JSON_SCHEMA_ON
|
||||||
const char *pSchJson;
|
const char *pSchJson;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pErrCode == NULL) {
|
if (pErrCode == NULL) {
|
||||||
|
|
Loading…
Reference in New Issue