Test case
1 generated file · +14 −0test/inputs/schema/integer-type.schema
Mschema-cjsondefault / TopLevel.c+14 −0
| @@ -25,41 +25,55 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | ||
| 25 | 25 | if (!cJSON_HasObjectItem(j, "above_i32_max")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 26 | 26 | if (cJSON_HasObjectItem(j, "above_i32_max")) { |
| 27 | 27 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "above_i32_max"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 28 | + if (cJSON_GetObjectItemCaseSensitive(j, "above_i32_max")->valuedouble < 0) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 29 | + if (cJSON_GetObjectItemCaseSensitive(j, "above_i32_max")->valuedouble > 2147483648) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 28 | 30 | x->above_i32_max = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "above_i32_max")); |
| 29 | 31 | } |
| 30 | 32 | if (!cJSON_HasObjectItem(j, "below_i32_min")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 31 | 33 | if (cJSON_HasObjectItem(j, "below_i32_min")) { |
| 32 | 34 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "below_i32_min"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 35 | + if (cJSON_GetObjectItemCaseSensitive(j, "below_i32_min")->valuedouble < -2147483649) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 36 | + if (cJSON_GetObjectItemCaseSensitive(j, "below_i32_min")->valuedouble > 0) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 33 | 37 | x->below_i32_min = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "below_i32_min")); |
| 34 | 38 | } |
| 35 | 39 | if (!cJSON_HasObjectItem(j, "i32_range")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 36 | 40 | if (cJSON_HasObjectItem(j, "i32_range")) { |
| 37 | 41 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "i32_range"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 42 | + if (cJSON_GetObjectItemCaseSensitive(j, "i32_range")->valuedouble < -2147483648) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 43 | + if (cJSON_GetObjectItemCaseSensitive(j, "i32_range")->valuedouble > 2147483647) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 38 | 44 | x->i32_range = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "i32_range")); |
| 39 | 45 | } |
| 40 | 46 | if (!cJSON_HasObjectItem(j, "large_bounds")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 41 | 47 | if (cJSON_HasObjectItem(j, "large_bounds")) { |
| 42 | 48 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "large_bounds"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 49 | + if (cJSON_GetObjectItemCaseSensitive(j, "large_bounds")->valuedouble < -9007199254740991) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 50 | + if (cJSON_GetObjectItemCaseSensitive(j, "large_bounds")->valuedouble > 9007199254740991) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 43 | 51 | x->large_bounds = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "large_bounds")); |
| 44 | 52 | } |
| 45 | 53 | if (!cJSON_HasObjectItem(j, "only_maximum")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 46 | 54 | if (cJSON_HasObjectItem(j, "only_maximum")) { |
| 47 | 55 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "only_maximum"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 56 | + if (cJSON_GetObjectItemCaseSensitive(j, "only_maximum")->valuedouble > 0) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 48 | 57 | x->only_maximum = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "only_maximum")); |
| 49 | 58 | } |
| 50 | 59 | if (!cJSON_HasObjectItem(j, "only_minimum")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 51 | 60 | if (cJSON_HasObjectItem(j, "only_minimum")) { |
| 52 | 61 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "only_minimum"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 62 | + if (cJSON_GetObjectItemCaseSensitive(j, "only_minimum")->valuedouble < 0) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 53 | 63 | x->only_minimum = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "only_minimum")); |
| 54 | 64 | } |
| 55 | 65 | if (!cJSON_HasObjectItem(j, "small_negative")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 56 | 66 | if (cJSON_HasObjectItem(j, "small_negative")) { |
| 57 | 67 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "small_negative"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 68 | + if (cJSON_GetObjectItemCaseSensitive(j, "small_negative")->valuedouble < -100) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 69 | + if (cJSON_GetObjectItemCaseSensitive(j, "small_negative")->valuedouble > 0) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 58 | 70 | x->small_negative = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "small_negative")); |
| 59 | 71 | } |
| 60 | 72 | if (!cJSON_HasObjectItem(j, "small_positive")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 61 | 73 | if (cJSON_HasObjectItem(j, "small_positive")) { |
| 62 | 74 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "small_positive"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 75 | + if (cJSON_GetObjectItemCaseSensitive(j, "small_positive")->valuedouble < 0) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 76 | + if (cJSON_GetObjectItemCaseSensitive(j, "small_positive")->valuedouble > 100) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 63 | 77 | x->small_positive = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "small_positive")); |
| 64 | 78 | } |
| 65 | 79 | if (!cJSON_HasObjectItem(j, "unbounded")) { cJSON_DeleteTopLevel(x); return NULL; } |
Test case
1 generated file · +10 −0test/inputs/schema/minmax-integer.schema
Mschema-cjsondefault / TopLevel.c+10 −0
| @@ -30,26 +30,34 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | ||
| 30 | 30 | if (!cJSON_HasObjectItem(j, "intersection")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 31 | 31 | if (cJSON_HasObjectItem(j, "intersection")) { |
| 32 | 32 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "intersection"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 33 | + if (cJSON_GetObjectItemCaseSensitive(j, "intersection")->valuedouble < 4) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 34 | + if (cJSON_GetObjectItemCaseSensitive(j, "intersection")->valuedouble > 5) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 33 | 35 | x->intersection = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "intersection")); |
| 34 | 36 | } |
| 35 | 37 | if (!cJSON_HasObjectItem(j, "max")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 36 | 38 | if (cJSON_HasObjectItem(j, "max")) { |
| 37 | 39 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "max"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 40 | + if (cJSON_GetObjectItemCaseSensitive(j, "max")->valuedouble > 5) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 38 | 41 | x->max = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "max")); |
| 39 | 42 | } |
| 40 | 43 | if (!cJSON_HasObjectItem(j, "min")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 41 | 44 | if (cJSON_HasObjectItem(j, "min")) { |
| 42 | 45 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "min"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 46 | + if (cJSON_GetObjectItemCaseSensitive(j, "min")->valuedouble < 3) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 43 | 47 | x->min = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "min")); |
| 44 | 48 | } |
| 45 | 49 | if (!cJSON_HasObjectItem(j, "minmax")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 46 | 50 | if (cJSON_HasObjectItem(j, "minmax")) { |
| 47 | 51 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "minmax"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 52 | + if (cJSON_GetObjectItemCaseSensitive(j, "minmax")->valuedouble < 3) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 53 | + if (cJSON_GetObjectItemCaseSensitive(j, "minmax")->valuedouble > 5) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 48 | 54 | x->minmax = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "minmax")); |
| 49 | 55 | } |
| 50 | 56 | if (!cJSON_HasObjectItem(j, "minMaxIntersection")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 51 | 57 | if (cJSON_HasObjectItem(j, "minMaxIntersection")) { |
| 52 | 58 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 59 | + if (cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection")->valuedouble < 3) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 60 | + if (cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection")->valuedouble > 5) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 53 | 61 | x->min_max_intersection = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection")); |
| 54 | 62 | } |
| 55 | 63 | if (!cJSON_HasObjectItem(j, "minMaxUnion")) { cJSON_DeleteTopLevel(x); return NULL; } |
| @@ -60,6 +68,8 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | ||
| 60 | 68 | if (!cJSON_HasObjectItem(j, "union")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 61 | 69 | if (cJSON_HasObjectItem(j, "union")) { |
| 62 | 70 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "union"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 71 | + if (cJSON_GetObjectItemCaseSensitive(j, "union")->valuedouble < 3) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 72 | + if (cJSON_GetObjectItemCaseSensitive(j, "union")->valuedouble > 6) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 63 | 73 | x->top_level_union = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "union")); |
| 64 | 74 | } |
| 65 | 75 | } |
Test case
2 generated files · +0 −319test/inputs/schema/minmaxlength.schema
Dschema-cjsondefault / TopLevel.c+0 −248
| @@ -1,248 +0,0 @@ | ||
| 1 | -/** | |
| 2 | - * TopLevel.c | |
| 3 | - * This file has been autogenerated using quicktype https://github.com/quicktype/quicktype - DO NOT EDIT | |
| 4 | - */ | |
| 5 | - | |
| 6 | -#include "TopLevel.h" | |
| 7 | - | |
| 8 | -struct InUnion * cJSON_GetInUnionValue(const cJSON * j) { | |
| 9 | - struct InUnion * x = cJSON_malloc(sizeof(struct InUnion)); | |
| 10 | - if (NULL != x) { | |
| 11 | - memset(x, 0, sizeof(struct InUnion)); | |
| 12 | - if (cJSON_IsNumber(j)) { | |
| 13 | - x->type = cJSON_Number; | |
| 14 | - x->value.number = cJSON_GetNumberValue(j); | |
| 15 | - } | |
| 16 | - else if (cJSON_IsString(j)) { | |
| 17 | - x->type = cJSON_String; | |
| 18 | - x->value.string = strdup(cJSON_GetStringValue(j)); | |
| 19 | - } | |
| 20 | - } | |
| 21 | - return x; | |
| 22 | -} | |
| 23 | - | |
| 24 | -cJSON * cJSON_CreateInUnion(const struct InUnion * x) { | |
| 25 | - cJSON * j = NULL; | |
| 26 | - if (NULL != x) { | |
| 27 | - if (cJSON_Number == x->type) { | |
| 28 | - j = cJSON_CreateNumber(x->value.number); | |
| 29 | - } | |
| 30 | - else if (cJSON_String == x->type) { | |
| 31 | - j = cJSON_CreateString(x->value.string); | |
| 32 | - } | |
| 33 | - } | |
| 34 | - return j; | |
| 35 | -} | |
| 36 | - | |
| 37 | -void cJSON_DeleteInUnion(struct InUnion * x) { | |
| 38 | - if (NULL != x) { | |
| 39 | - if (cJSON_Number == x->type) { | |
| 40 | - } | |
| 41 | - else if (cJSON_String == x->type) { | |
| 42 | - cJSON_free(x->value.string); | |
| 43 | - } | |
| 44 | - cJSON_free(x); | |
| 45 | - } | |
| 46 | -} | |
| 47 | - | |
| 48 | -struct TopLevel * cJSON_ParseTopLevel(const char * s) { | |
| 49 | - struct TopLevel * x = NULL; | |
| 50 | - if (NULL != s) { | |
| 51 | - cJSON * j = cJSON_Parse(s); | |
| 52 | - if (NULL != j) { | |
| 53 | - x = cJSON_GetTopLevelValue(j); | |
| 54 | - cJSON_Delete(j); | |
| 55 | - } | |
| 56 | - } | |
| 57 | - return x; | |
| 58 | -} | |
| 59 | - | |
| 60 | -struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | |
| 61 | - struct TopLevel * x = NULL; | |
| 62 | - if (NULL != j) { | |
| 63 | - if (NULL != (x = cJSON_malloc(sizeof(struct TopLevel)))) { | |
| 64 | - memset(x, 0, sizeof(struct TopLevel)); | |
| 65 | - if (!cJSON_HasObjectItem(j, "intersection")) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 66 | - if (cJSON_HasObjectItem(j, "intersection")) { | |
| 67 | - if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "intersection"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 68 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "intersection")->valuestring) < 4) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 69 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "intersection")->valuestring) > 5) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 70 | - x->intersection = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "intersection"))); | |
| 71 | - } | |
| 72 | - else { | |
| 73 | - if (NULL != (x->intersection = cJSON_malloc(sizeof(char)))) { | |
| 74 | - x->intersection[0] = '\0'; | |
| 75 | - } | |
| 76 | - } | |
| 77 | - if (!cJSON_HasObjectItem(j, "inUnion")) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 78 | - if (cJSON_HasObjectItem(j, "inUnion")) { | |
| 79 | - if (!cJSON_IsInUnion(cJSON_GetObjectItemCaseSensitive(j, "inUnion"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 80 | - x->in_union = cJSON_GetInUnionValue(cJSON_GetObjectItemCaseSensitive(j, "inUnion")); | |
| 81 | - if (NULL == x->in_union) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 82 | - } | |
| 83 | - if (!cJSON_HasObjectItem(j, "maxlength")) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 84 | - if (cJSON_HasObjectItem(j, "maxlength")) { | |
| 85 | - if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "maxlength"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 86 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "maxlength")->valuestring) > 5) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 87 | - x->maxlength = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "maxlength"))); | |
| 88 | - } | |
| 89 | - else { | |
| 90 | - if (NULL != (x->maxlength = cJSON_malloc(sizeof(char)))) { | |
| 91 | - x->maxlength[0] = '\0'; | |
| 92 | - } | |
| 93 | - } | |
| 94 | - if (!cJSON_HasObjectItem(j, "minlength")) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 95 | - if (cJSON_HasObjectItem(j, "minlength")) { | |
| 96 | - if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "minlength"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 97 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "minlength")->valuestring) < 3) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 98 | - x->minlength = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "minlength"))); | |
| 99 | - } | |
| 100 | - else { | |
| 101 | - if (NULL != (x->minlength = cJSON_malloc(sizeof(char)))) { | |
| 102 | - x->minlength[0] = '\0'; | |
| 103 | - } | |
| 104 | - } | |
| 105 | - if (!cJSON_HasObjectItem(j, "minMaxIntersection")) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 106 | - if (cJSON_HasObjectItem(j, "minMaxIntersection")) { | |
| 107 | - if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 108 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection")->valuestring) < 3) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 109 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection")->valuestring) > 5) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 110 | - x->min_max_intersection = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection"))); | |
| 111 | - } | |
| 112 | - else { | |
| 113 | - if (NULL != (x->min_max_intersection = cJSON_malloc(sizeof(char)))) { | |
| 114 | - x->min_max_intersection[0] = '\0'; | |
| 115 | - } | |
| 116 | - } | |
| 117 | - if (!cJSON_HasObjectItem(j, "minmaxlength")) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 118 | - if (cJSON_HasObjectItem(j, "minmaxlength")) { | |
| 119 | - if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "minmaxlength"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 120 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "minmaxlength")->valuestring) < 3) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 121 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "minmaxlength")->valuestring) > 5) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 122 | - x->minmaxlength = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "minmaxlength"))); | |
| 123 | - } | |
| 124 | - else { | |
| 125 | - if (NULL != (x->minmaxlength = cJSON_malloc(sizeof(char)))) { | |
| 126 | - x->minmaxlength[0] = '\0'; | |
| 127 | - } | |
| 128 | - } | |
| 129 | - if (!cJSON_HasObjectItem(j, "minMaxUnion")) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 130 | - if (cJSON_HasObjectItem(j, "minMaxUnion")) { | |
| 131 | - if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "minMaxUnion"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 132 | - x->min_max_union = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "minMaxUnion"))); | |
| 133 | - } | |
| 134 | - else { | |
| 135 | - if (NULL != (x->min_max_union = cJSON_malloc(sizeof(char)))) { | |
| 136 | - x->min_max_union[0] = '\0'; | |
| 137 | - } | |
| 138 | - } | |
| 139 | - if (!cJSON_HasObjectItem(j, "union")) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 140 | - if (cJSON_HasObjectItem(j, "union")) { | |
| 141 | - if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "union"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 142 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "union")->valuestring) < 3) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 143 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "union")->valuestring) > 6) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 144 | - x->top_level_union = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "union"))); | |
| 145 | - } | |
| 146 | - else { | |
| 147 | - if (NULL != (x->top_level_union = cJSON_malloc(sizeof(char)))) { | |
| 148 | - x->top_level_union[0] = '\0'; | |
| 149 | - } | |
| 150 | - } | |
| 151 | - } | |
| 152 | - } | |
| 153 | - return x; | |
| 154 | -} | |
| 155 | - | |
| 156 | -cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) { | |
| 157 | - cJSON * j = NULL; | |
| 158 | - if (NULL != x) { | |
| 159 | - if (NULL != (j = cJSON_CreateObject())) { | |
| 160 | - if (NULL != x->intersection) { | |
| 161 | - cJSON_AddStringToObject(j, "intersection", x->intersection); | |
| 162 | - } | |
| 163 | - else { | |
| 164 | - cJSON_AddStringToObject(j, "intersection", ""); | |
| 165 | - } | |
| 166 | - cJSON_AddItemToObject(j, "inUnion", cJSON_CreateInUnion(x->in_union)); | |
| 167 | - if (NULL != x->maxlength) { | |
| 168 | - cJSON_AddStringToObject(j, "maxlength", x->maxlength); | |
| 169 | - } | |
| 170 | - else { | |
| 171 | - cJSON_AddStringToObject(j, "maxlength", ""); | |
| 172 | - } | |
| 173 | - if (NULL != x->minlength) { | |
| 174 | - cJSON_AddStringToObject(j, "minlength", x->minlength); | |
| 175 | - } | |
| 176 | - else { | |
| 177 | - cJSON_AddStringToObject(j, "minlength", ""); | |
| 178 | - } | |
| 179 | - if (NULL != x->min_max_intersection) { | |
| 180 | - cJSON_AddStringToObject(j, "minMaxIntersection", x->min_max_intersection); | |
| 181 | - } | |
| 182 | - else { | |
| 183 | - cJSON_AddStringToObject(j, "minMaxIntersection", ""); | |
| 184 | - } | |
| 185 | - if (NULL != x->minmaxlength) { | |
| 186 | - cJSON_AddStringToObject(j, "minmaxlength", x->minmaxlength); | |
| 187 | - } | |
| 188 | - else { | |
| 189 | - cJSON_AddStringToObject(j, "minmaxlength", ""); | |
| 190 | - } | |
| 191 | - if (NULL != x->min_max_union) { | |
| 192 | - cJSON_AddStringToObject(j, "minMaxUnion", x->min_max_union); | |
| 193 | - } | |
| 194 | - else { | |
| 195 | - cJSON_AddStringToObject(j, "minMaxUnion", ""); | |
| 196 | - } | |
| 197 | - if (NULL != x->top_level_union) { | |
| 198 | - cJSON_AddStringToObject(j, "union", x->top_level_union); | |
| 199 | - } | |
| 200 | - else { | |
| 201 | - cJSON_AddStringToObject(j, "union", ""); | |
| 202 | - } | |
| 203 | - } | |
| 204 | - } | |
| 205 | - return j; | |
| 206 | -} | |
| 207 | - | |
| 208 | -char * cJSON_PrintTopLevel(const struct TopLevel * x) { | |
| 209 | - char * s = NULL; | |
| 210 | - if (NULL != x) { | |
| 211 | - cJSON * j = cJSON_CreateTopLevel(x); | |
| 212 | - if (NULL != j) { | |
| 213 | - s = cJSON_Print(j); | |
| 214 | - cJSON_Delete(j); | |
| 215 | - } | |
| 216 | - } | |
| 217 | - return s; | |
| 218 | -} | |
| 219 | - | |
| 220 | -void cJSON_DeleteTopLevel(struct TopLevel * x) { | |
| 221 | - if (NULL != x) { | |
| 222 | - if (NULL != x->intersection) { | |
| 223 | - cJSON_free(x->intersection); | |
| 224 | - } | |
| 225 | - if (NULL != x->in_union) { | |
| 226 | - cJSON_DeleteInUnion(x->in_union); | |
| 227 | - } | |
| 228 | - if (NULL != x->maxlength) { | |
| 229 | - cJSON_free(x->maxlength); | |
| 230 | - } | |
| 231 | - if (NULL != x->minlength) { | |
| 232 | - cJSON_free(x->minlength); | |
| 233 | - } | |
| 234 | - if (NULL != x->min_max_intersection) { | |
| 235 | - cJSON_free(x->min_max_intersection); | |
| 236 | - } | |
| 237 | - if (NULL != x->minmaxlength) { | |
| 238 | - cJSON_free(x->minmaxlength); | |
| 239 | - } | |
| 240 | - if (NULL != x->min_max_union) { | |
| 241 | - cJSON_free(x->min_max_union); | |
| 242 | - } | |
| 243 | - if (NULL != x->top_level_union) { | |
| 244 | - cJSON_free(x->top_level_union); | |
| 245 | - } | |
| 246 | - cJSON_free(x); | |
| 247 | - } | |
| 248 | -} |
Dschema-cjsondefault / TopLevel.h+0 −71
| @@ -1,71 +0,0 @@ | ||
| 1 | -/** | |
| 2 | - * TopLevel.h | |
| 3 | - * This file has been autogenerated using quicktype https://github.com/quicktype/quicktype - DO NOT EDIT | |
| 4 | - * This file depends of https://github.com/DaveGamble/cJSON, https://github.com/joelguittet/c-list and https://github.com/joelguittet/c-hashtable | |
| 5 | - * To parse json data from json string use the following: struct <type> * data = cJSON_Parse<type>(<string>); | |
| 6 | - * To get json data from cJSON object use the following: struct <type> * data = cJSON_Get<type>Value(<cjson>); | |
| 7 | - * To get cJSON object from json data use the following: cJSON * cjson = cJSON_Create<type>(<data>); | |
| 8 | - * To print json string from json data use the following: char * string = cJSON_Print<type>(<data>); | |
| 9 | - * To delete json data use the following: cJSON_Delete<type>(<data>); | |
| 10 | - */ | |
| 11 | - | |
| 12 | -#ifndef __TOPLEVEL_H__ | |
| 13 | -#define __TOPLEVEL_H__ | |
| 14 | - | |
| 15 | -#ifdef __cplusplus | |
| 16 | -extern "C" { | |
| 17 | -#endif | |
| 18 | - | |
| 19 | -#include <stdint.h> | |
| 20 | -#include <stdbool.h> | |
| 21 | -#include <stdlib.h> | |
| 22 | -#include <string.h> | |
| 23 | -#include <cJSON.h> | |
| 24 | -#include <hashtable.h> | |
| 25 | -#include <list.h> | |
| 26 | - | |
| 27 | -#ifndef cJSON_Bool | |
| 28 | -#define cJSON_Bool (cJSON_True | cJSON_False) | |
| 29 | -#endif | |
| 30 | -#ifndef cJSON_Map | |
| 31 | -#define cJSON_Map (1 << 16) | |
| 32 | -#endif | |
| 33 | -#ifndef cJSON_Enum | |
| 34 | -#define cJSON_Enum (1 << 17) | |
| 35 | -#endif | |
| 36 | - | |
| 37 | -struct InUnion { | |
| 38 | - int type; | |
| 39 | - union { | |
| 40 | - double number; | |
| 41 | - char * string; | |
| 42 | - } value; | |
| 43 | -}; | |
| 44 | - | |
| 45 | -struct TopLevel { | |
| 46 | - char * intersection; | |
| 47 | - struct InUnion * in_union; | |
| 48 | - char * maxlength; | |
| 49 | - char * minlength; | |
| 50 | - char * min_max_intersection; | |
| 51 | - char * minmaxlength; | |
| 52 | - char * min_max_union; | |
| 53 | - char * top_level_union; | |
| 54 | -}; | |
| 55 | - | |
| 56 | -#define cJSON_IsInUnion(j) (cJSON_IsNumber(j) || cJSON_IsString(j)) | |
| 57 | -struct InUnion * cJSON_GetInUnionValue(const cJSON * j); | |
| 58 | -cJSON * cJSON_CreateInUnion(const struct InUnion * x); | |
| 59 | -void cJSON_DeleteInUnion(struct InUnion * x); | |
| 60 | - | |
| 61 | -struct TopLevel * cJSON_ParseTopLevel(const char * s); | |
| 62 | -struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j); | |
| 63 | -cJSON * cJSON_CreateTopLevel(const struct TopLevel * x); | |
| 64 | -char * cJSON_PrintTopLevel(const struct TopLevel * x); | |
| 65 | -void cJSON_DeleteTopLevel(struct TopLevel * x); | |
| 66 | - | |
| 67 | -#ifdef __cplusplus | |
| 68 | -} | |
| 69 | -#endif | |
| 70 | - | |
| 71 | -#endif /* __TOPLEVEL_H__ */ |
Test case
1 generated file · +0 −2test/inputs/schema/renaming-bug.schema
Mschema-cjsondefault / TopLevel.c+0 −2
| @@ -591,7 +591,6 @@ struct Berry * cJSON_GetBerryValue(const cJSON * j) { | ||
| 591 | 591 | } |
| 592 | 592 | if (cJSON_HasObjectItem(j, "name")) { |
| 593 | 593 | if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "name"))) { cJSON_DeleteBerry(x); return NULL; } |
| 594 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "name")->valuestring) < 1) { cJSON_DeleteBerry(x); return NULL; } | |
| 595 | 594 | x->name = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "name"))); |
| 596 | 595 | } |
| 597 | 596 | if (cJSON_HasObjectItem(j, "shapes")) { |
| @@ -1021,7 +1020,6 @@ struct Vehicle * cJSON_GetVehicleValue(const cJSON * j) { | ||
| 1021 | 1020 | } |
| 1022 | 1021 | if (cJSON_HasObjectItem(j, "id")) { |
| 1023 | 1022 | if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "id"))) { cJSON_DeleteVehicle(x); return NULL; } |
| 1024 | - if (strlen(cJSON_GetObjectItemCaseSensitive(j, "id")->valuestring) < 1) { cJSON_DeleteVehicle(x); return NULL; } | |
| 1025 | 1023 | x->id = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "id"))); |
| 1026 | 1024 | } |
| 1027 | 1025 | if (cJSON_HasObjectItem(j, "speed")) { |
Test case
1 generated file · +161 −0test/inputs/schema/vega-lite.schema
Mschema-cjsondefault / TopLevel.c+161 −0
| @@ -3048,6 +3048,8 @@ struct MarkConfig * cJSON_GetMarkConfigValue(const cJSON * j) { | ||
| 3048 | 3048 | } |
| 3049 | 3049 | if (cJSON_HasObjectItem(j, "angle")) { |
| 3050 | 3050 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "angle"))) { cJSON_DeleteMarkConfig(x); return NULL; } |
| 3051 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble < 0) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3052 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble > 360) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3051 | 3053 | if (NULL != (x->angle = cJSON_malloc(sizeof(double)))) { |
| 3052 | 3054 | *x->angle = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "angle")); |
| 3053 | 3055 | } |
| @@ -3094,6 +3096,8 @@ struct MarkConfig * cJSON_GetMarkConfigValue(const cJSON * j) { | ||
| 3094 | 3096 | } |
| 3095 | 3097 | if (cJSON_HasObjectItem(j, "fillOpacity")) { |
| 3096 | 3098 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity"))) { cJSON_DeleteMarkConfig(x); return NULL; } |
| 3099 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble < 0) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3100 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble > 1) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3097 | 3101 | if (NULL != (x->fill_opacity = cJSON_malloc(sizeof(double)))) { |
| 3098 | 3102 | *x->fill_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")); |
| 3099 | 3103 | } |
| @@ -3104,6 +3108,7 @@ struct MarkConfig * cJSON_GetMarkConfigValue(const cJSON * j) { | ||
| 3104 | 3108 | } |
| 3105 | 3109 | if (cJSON_HasObjectItem(j, "fontSize")) { |
| 3106 | 3110 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fontSize"))) { cJSON_DeleteMarkConfig(x); return NULL; } |
| 3111 | + if (cJSON_GetObjectItemCaseSensitive(j, "fontSize")->valuedouble < 0) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3107 | 3112 | if (NULL != (x->font_size = cJSON_malloc(sizeof(double)))) { |
| 3108 | 3113 | *x->font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fontSize")); |
| 3109 | 3114 | } |
| @@ -3139,6 +3144,8 @@ struct MarkConfig * cJSON_GetMarkConfigValue(const cJSON * j) { | ||
| 3139 | 3144 | } |
| 3140 | 3145 | if (cJSON_HasObjectItem(j, "opacity")) { |
| 3141 | 3146 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "opacity"))) { cJSON_DeleteMarkConfig(x); return NULL; } |
| 3147 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble < 0) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3148 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble > 1) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3142 | 3149 | if (NULL != (x->opacity = cJSON_malloc(sizeof(double)))) { |
| 3143 | 3150 | *x->opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "opacity")); |
| 3144 | 3151 | } |
| @@ -3152,6 +3159,7 @@ struct MarkConfig * cJSON_GetMarkConfigValue(const cJSON * j) { | ||
| 3152 | 3159 | } |
| 3153 | 3160 | if (cJSON_HasObjectItem(j, "radius")) { |
| 3154 | 3161 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "radius"))) { cJSON_DeleteMarkConfig(x); return NULL; } |
| 3162 | + if (cJSON_GetObjectItemCaseSensitive(j, "radius")->valuedouble < 0) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3155 | 3163 | if (NULL != (x->radius = cJSON_malloc(sizeof(double)))) { |
| 3156 | 3164 | *x->radius = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "radius")); |
| 3157 | 3165 | } |
| @@ -3162,6 +3170,7 @@ struct MarkConfig * cJSON_GetMarkConfigValue(const cJSON * j) { | ||
| 3162 | 3170 | } |
| 3163 | 3171 | if (cJSON_HasObjectItem(j, "size")) { |
| 3164 | 3172 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "size"))) { cJSON_DeleteMarkConfig(x); return NULL; } |
| 3173 | + if (cJSON_GetObjectItemCaseSensitive(j, "size")->valuedouble < 0) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3165 | 3174 | if (NULL != (x->size = cJSON_malloc(sizeof(double)))) { |
| 3166 | 3175 | *x->size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "size")); |
| 3167 | 3176 | } |
| @@ -3194,18 +3203,23 @@ struct MarkConfig * cJSON_GetMarkConfigValue(const cJSON * j) { | ||
| 3194 | 3203 | } |
| 3195 | 3204 | if (cJSON_HasObjectItem(j, "strokeOpacity")) { |
| 3196 | 3205 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity"))) { cJSON_DeleteMarkConfig(x); return NULL; } |
| 3206 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble < 0) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3207 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble > 1) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3197 | 3208 | if (NULL != (x->stroke_opacity = cJSON_malloc(sizeof(double)))) { |
| 3198 | 3209 | *x->stroke_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")); |
| 3199 | 3210 | } |
| 3200 | 3211 | } |
| 3201 | 3212 | if (cJSON_HasObjectItem(j, "strokeWidth")) { |
| 3202 | 3213 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth"))) { cJSON_DeleteMarkConfig(x); return NULL; } |
| 3214 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")->valuedouble < 0) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3203 | 3215 | if (NULL != (x->stroke_width = cJSON_malloc(sizeof(double)))) { |
| 3204 | 3216 | *x->stroke_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")); |
| 3205 | 3217 | } |
| 3206 | 3218 | } |
| 3207 | 3219 | if (cJSON_HasObjectItem(j, "tension")) { |
| 3208 | 3220 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "tension"))) { cJSON_DeleteMarkConfig(x); return NULL; } |
| 3221 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble < 0) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3222 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble > 1) { cJSON_DeleteMarkConfig(x); return NULL; } | |
| 3209 | 3223 | if (NULL != (x->tension = cJSON_malloc(sizeof(double)))) { |
| 3210 | 3224 | *x->tension = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "tension")); |
| 3211 | 3225 | } |
| @@ -3511,18 +3525,23 @@ struct AxisConfig * cJSON_GetAxisConfigValue(const cJSON * j) { | ||
| 3511 | 3525 | } |
| 3512 | 3526 | if (cJSON_HasObjectItem(j, "gridOpacity")) { |
| 3513 | 3527 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "gridOpacity"))) { cJSON_DeleteAxisConfig(x); return NULL; } |
| 3528 | + if (cJSON_GetObjectItemCaseSensitive(j, "gridOpacity")->valuedouble < 0) { cJSON_DeleteAxisConfig(x); return NULL; } | |
| 3529 | + if (cJSON_GetObjectItemCaseSensitive(j, "gridOpacity")->valuedouble > 1) { cJSON_DeleteAxisConfig(x); return NULL; } | |
| 3514 | 3530 | if (NULL != (x->grid_opacity = cJSON_malloc(sizeof(double)))) { |
| 3515 | 3531 | *x->grid_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "gridOpacity")); |
| 3516 | 3532 | } |
| 3517 | 3533 | } |
| 3518 | 3534 | if (cJSON_HasObjectItem(j, "gridWidth")) { |
| 3519 | 3535 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "gridWidth"))) { cJSON_DeleteAxisConfig(x); return NULL; } |
| 3536 | + if (cJSON_GetObjectItemCaseSensitive(j, "gridWidth")->valuedouble < 0) { cJSON_DeleteAxisConfig(x); return NULL; } | |
| 3520 | 3537 | if (NULL != (x->grid_width = cJSON_malloc(sizeof(double)))) { |
| 3521 | 3538 | *x->grid_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "gridWidth")); |
| 3522 | 3539 | } |
| 3523 | 3540 | } |
| 3524 | 3541 | if (cJSON_HasObjectItem(j, "labelAngle")) { |
| 3525 | 3542 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "labelAngle"))) { cJSON_DeleteAxisConfig(x); return NULL; } |
| 3543 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelAngle")->valuedouble < -360) { cJSON_DeleteAxisConfig(x); return NULL; } | |
| 3544 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelAngle")->valuedouble > 360) { cJSON_DeleteAxisConfig(x); return NULL; } | |
| 3526 | 3545 | if (NULL != (x->label_angle = cJSON_malloc(sizeof(double)))) { |
| 3527 | 3546 | *x->label_angle = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "labelAngle")); |
| 3528 | 3547 | } |
| @@ -3547,6 +3566,7 @@ struct AxisConfig * cJSON_GetAxisConfigValue(const cJSON * j) { | ||
| 3547 | 3566 | } |
| 3548 | 3567 | if (cJSON_HasObjectItem(j, "labelFontSize")) { |
| 3549 | 3568 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "labelFontSize"))) { cJSON_DeleteAxisConfig(x); return NULL; } |
| 3569 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelFontSize")->valuedouble < 0) { cJSON_DeleteAxisConfig(x); return NULL; } | |
| 3550 | 3570 | if (NULL != (x->label_font_size = cJSON_malloc(sizeof(double)))) { |
| 3551 | 3571 | *x->label_font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "labelFontSize")); |
| 3552 | 3572 | } |
| @@ -3610,12 +3630,14 @@ struct AxisConfig * cJSON_GetAxisConfigValue(const cJSON * j) { | ||
| 3610 | 3630 | } |
| 3611 | 3631 | if (cJSON_HasObjectItem(j, "tickSize")) { |
| 3612 | 3632 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "tickSize"))) { cJSON_DeleteAxisConfig(x); return NULL; } |
| 3633 | + if (cJSON_GetObjectItemCaseSensitive(j, "tickSize")->valuedouble < 0) { cJSON_DeleteAxisConfig(x); return NULL; } | |
| 3613 | 3634 | if (NULL != (x->tick_size = cJSON_malloc(sizeof(double)))) { |
| 3614 | 3635 | *x->tick_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "tickSize")); |
| 3615 | 3636 | } |
| 3616 | 3637 | } |
| 3617 | 3638 | if (cJSON_HasObjectItem(j, "tickWidth")) { |
| 3618 | 3639 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "tickWidth"))) { cJSON_DeleteAxisConfig(x); return NULL; } |
| 3640 | + if (cJSON_GetObjectItemCaseSensitive(j, "tickWidth")->valuedouble < 0) { cJSON_DeleteAxisConfig(x); return NULL; } | |
| 3619 | 3641 | if (NULL != (x->tick_width = cJSON_malloc(sizeof(double)))) { |
| 3620 | 3642 | *x->tick_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "tickWidth")); |
| 3621 | 3643 | } |
| @@ -3644,6 +3666,7 @@ struct AxisConfig * cJSON_GetAxisConfigValue(const cJSON * j) { | ||
| 3644 | 3666 | } |
| 3645 | 3667 | if (cJSON_HasObjectItem(j, "titleFontSize")) { |
| 3646 | 3668 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "titleFontSize"))) { cJSON_DeleteAxisConfig(x); return NULL; } |
| 3669 | + if (cJSON_GetObjectItemCaseSensitive(j, "titleFontSize")->valuedouble < 0) { cJSON_DeleteAxisConfig(x); return NULL; } | |
| 3647 | 3670 | if (NULL != (x->title_font_size = cJSON_malloc(sizeof(double)))) { |
| 3648 | 3671 | *x->title_font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "titleFontSize")); |
| 3649 | 3672 | } |
| @@ -4028,18 +4051,23 @@ struct VgAxisConfig * cJSON_GetVgAxisConfigValue(const cJSON * j) { | ||
| 4028 | 4051 | } |
| 4029 | 4052 | if (cJSON_HasObjectItem(j, "gridOpacity")) { |
| 4030 | 4053 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "gridOpacity"))) { cJSON_DeleteVgAxisConfig(x); return NULL; } |
| 4054 | + if (cJSON_GetObjectItemCaseSensitive(j, "gridOpacity")->valuedouble < 0) { cJSON_DeleteVgAxisConfig(x); return NULL; } | |
| 4055 | + if (cJSON_GetObjectItemCaseSensitive(j, "gridOpacity")->valuedouble > 1) { cJSON_DeleteVgAxisConfig(x); return NULL; } | |
| 4031 | 4056 | if (NULL != (x->grid_opacity = cJSON_malloc(sizeof(double)))) { |
| 4032 | 4057 | *x->grid_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "gridOpacity")); |
| 4033 | 4058 | } |
| 4034 | 4059 | } |
| 4035 | 4060 | if (cJSON_HasObjectItem(j, "gridWidth")) { |
| 4036 | 4061 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "gridWidth"))) { cJSON_DeleteVgAxisConfig(x); return NULL; } |
| 4062 | + if (cJSON_GetObjectItemCaseSensitive(j, "gridWidth")->valuedouble < 0) { cJSON_DeleteVgAxisConfig(x); return NULL; } | |
| 4037 | 4063 | if (NULL != (x->grid_width = cJSON_malloc(sizeof(double)))) { |
| 4038 | 4064 | *x->grid_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "gridWidth")); |
| 4039 | 4065 | } |
| 4040 | 4066 | } |
| 4041 | 4067 | if (cJSON_HasObjectItem(j, "labelAngle")) { |
| 4042 | 4068 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "labelAngle"))) { cJSON_DeleteVgAxisConfig(x); return NULL; } |
| 4069 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelAngle")->valuedouble < -360) { cJSON_DeleteVgAxisConfig(x); return NULL; } | |
| 4070 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelAngle")->valuedouble > 360) { cJSON_DeleteVgAxisConfig(x); return NULL; } | |
| 4043 | 4071 | if (NULL != (x->label_angle = cJSON_malloc(sizeof(double)))) { |
| 4044 | 4072 | *x->label_angle = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "labelAngle")); |
| 4045 | 4073 | } |
| @@ -4064,6 +4092,7 @@ struct VgAxisConfig * cJSON_GetVgAxisConfigValue(const cJSON * j) { | ||
| 4064 | 4092 | } |
| 4065 | 4093 | if (cJSON_HasObjectItem(j, "labelFontSize")) { |
| 4066 | 4094 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "labelFontSize"))) { cJSON_DeleteVgAxisConfig(x); return NULL; } |
| 4095 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelFontSize")->valuedouble < 0) { cJSON_DeleteVgAxisConfig(x); return NULL; } | |
| 4067 | 4096 | if (NULL != (x->label_font_size = cJSON_malloc(sizeof(double)))) { |
| 4068 | 4097 | *x->label_font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "labelFontSize")); |
| 4069 | 4098 | } |
| @@ -4121,12 +4150,14 @@ struct VgAxisConfig * cJSON_GetVgAxisConfigValue(const cJSON * j) { | ||
| 4121 | 4150 | } |
| 4122 | 4151 | if (cJSON_HasObjectItem(j, "tickSize")) { |
| 4123 | 4152 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "tickSize"))) { cJSON_DeleteVgAxisConfig(x); return NULL; } |
| 4153 | + if (cJSON_GetObjectItemCaseSensitive(j, "tickSize")->valuedouble < 0) { cJSON_DeleteVgAxisConfig(x); return NULL; } | |
| 4124 | 4154 | if (NULL != (x->tick_size = cJSON_malloc(sizeof(double)))) { |
| 4125 | 4155 | *x->tick_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "tickSize")); |
| 4126 | 4156 | } |
| 4127 | 4157 | } |
| 4128 | 4158 | if (cJSON_HasObjectItem(j, "tickWidth")) { |
| 4129 | 4159 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "tickWidth"))) { cJSON_DeleteVgAxisConfig(x); return NULL; } |
| 4160 | + if (cJSON_GetObjectItemCaseSensitive(j, "tickWidth")->valuedouble < 0) { cJSON_DeleteVgAxisConfig(x); return NULL; } | |
| 4130 | 4161 | if (NULL != (x->tick_width = cJSON_malloc(sizeof(double)))) { |
| 4131 | 4162 | *x->tick_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "tickWidth")); |
| 4132 | 4163 | } |
| @@ -4155,6 +4186,7 @@ struct VgAxisConfig * cJSON_GetVgAxisConfigValue(const cJSON * j) { | ||
| 4155 | 4186 | } |
| 4156 | 4187 | if (cJSON_HasObjectItem(j, "titleFontSize")) { |
| 4157 | 4188 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "titleFontSize"))) { cJSON_DeleteVgAxisConfig(x); return NULL; } |
| 4189 | + if (cJSON_GetObjectItemCaseSensitive(j, "titleFontSize")->valuedouble < 0) { cJSON_DeleteVgAxisConfig(x); return NULL; } | |
| 4158 | 4190 | if (NULL != (x->title_font_size = cJSON_malloc(sizeof(double)))) { |
| 4159 | 4191 | *x->title_font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "titleFontSize")); |
| 4160 | 4192 | } |
| @@ -4492,6 +4524,8 @@ struct BarConfig * cJSON_GetBarConfigValue(const cJSON * j) { | ||
| 4492 | 4524 | } |
| 4493 | 4525 | if (cJSON_HasObjectItem(j, "angle")) { |
| 4494 | 4526 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "angle"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4527 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4528 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble > 360) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4495 | 4529 | if (NULL != (x->angle = cJSON_malloc(sizeof(double)))) { |
| 4496 | 4530 | *x->angle = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "angle")); |
| 4497 | 4531 | } |
| @@ -4505,6 +4539,7 @@ struct BarConfig * cJSON_GetBarConfigValue(const cJSON * j) { | ||
| 4505 | 4539 | } |
| 4506 | 4540 | if (cJSON_HasObjectItem(j, "binSpacing")) { |
| 4507 | 4541 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "binSpacing"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4542 | + if (cJSON_GetObjectItemCaseSensitive(j, "binSpacing")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4508 | 4543 | if (NULL != (x->bin_spacing = cJSON_malloc(sizeof(double)))) { |
| 4509 | 4544 | *x->bin_spacing = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "binSpacing")); |
| 4510 | 4545 | } |
| @@ -4515,6 +4550,7 @@ struct BarConfig * cJSON_GetBarConfigValue(const cJSON * j) { | ||
| 4515 | 4550 | } |
| 4516 | 4551 | if (cJSON_HasObjectItem(j, "continuousBandSize")) { |
| 4517 | 4552 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "continuousBandSize"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4553 | + if (cJSON_GetObjectItemCaseSensitive(j, "continuousBandSize")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4518 | 4554 | if (NULL != (x->continuous_band_size = cJSON_malloc(sizeof(double)))) { |
| 4519 | 4555 | *x->continuous_band_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "continuousBandSize")); |
| 4520 | 4556 | } |
| @@ -4528,6 +4564,7 @@ struct BarConfig * cJSON_GetBarConfigValue(const cJSON * j) { | ||
| 4528 | 4564 | } |
| 4529 | 4565 | if (cJSON_HasObjectItem(j, "discreteBandSize")) { |
| 4530 | 4566 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "discreteBandSize"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4567 | + if (cJSON_GetObjectItemCaseSensitive(j, "discreteBandSize")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4531 | 4568 | if (NULL != (x->discrete_band_size = cJSON_malloc(sizeof(double)))) { |
| 4532 | 4569 | *x->discrete_band_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "discreteBandSize")); |
| 4533 | 4570 | } |
| @@ -4556,6 +4593,8 @@ struct BarConfig * cJSON_GetBarConfigValue(const cJSON * j) { | ||
| 4556 | 4593 | } |
| 4557 | 4594 | if (cJSON_HasObjectItem(j, "fillOpacity")) { |
| 4558 | 4595 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4596 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4597 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble > 1) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4559 | 4598 | if (NULL != (x->fill_opacity = cJSON_malloc(sizeof(double)))) { |
| 4560 | 4599 | *x->fill_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")); |
| 4561 | 4600 | } |
| @@ -4566,6 +4605,7 @@ struct BarConfig * cJSON_GetBarConfigValue(const cJSON * j) { | ||
| 4566 | 4605 | } |
| 4567 | 4606 | if (cJSON_HasObjectItem(j, "fontSize")) { |
| 4568 | 4607 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fontSize"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4608 | + if (cJSON_GetObjectItemCaseSensitive(j, "fontSize")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4569 | 4609 | if (NULL != (x->font_size = cJSON_malloc(sizeof(double)))) { |
| 4570 | 4610 | *x->font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fontSize")); |
| 4571 | 4611 | } |
| @@ -4601,6 +4641,8 @@ struct BarConfig * cJSON_GetBarConfigValue(const cJSON * j) { | ||
| 4601 | 4641 | } |
| 4602 | 4642 | if (cJSON_HasObjectItem(j, "opacity")) { |
| 4603 | 4643 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "opacity"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4644 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4645 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble > 1) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4604 | 4646 | if (NULL != (x->opacity = cJSON_malloc(sizeof(double)))) { |
| 4605 | 4647 | *x->opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "opacity")); |
| 4606 | 4648 | } |
| @@ -4614,6 +4656,7 @@ struct BarConfig * cJSON_GetBarConfigValue(const cJSON * j) { | ||
| 4614 | 4656 | } |
| 4615 | 4657 | if (cJSON_HasObjectItem(j, "radius")) { |
| 4616 | 4658 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "radius"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4659 | + if (cJSON_GetObjectItemCaseSensitive(j, "radius")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4617 | 4660 | if (NULL != (x->radius = cJSON_malloc(sizeof(double)))) { |
| 4618 | 4661 | *x->radius = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "radius")); |
| 4619 | 4662 | } |
| @@ -4624,6 +4667,7 @@ struct BarConfig * cJSON_GetBarConfigValue(const cJSON * j) { | ||
| 4624 | 4667 | } |
| 4625 | 4668 | if (cJSON_HasObjectItem(j, "size")) { |
| 4626 | 4669 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "size"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4670 | + if (cJSON_GetObjectItemCaseSensitive(j, "size")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4627 | 4671 | if (NULL != (x->size = cJSON_malloc(sizeof(double)))) { |
| 4628 | 4672 | *x->size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "size")); |
| 4629 | 4673 | } |
| @@ -4656,18 +4700,23 @@ struct BarConfig * cJSON_GetBarConfigValue(const cJSON * j) { | ||
| 4656 | 4700 | } |
| 4657 | 4701 | if (cJSON_HasObjectItem(j, "strokeOpacity")) { |
| 4658 | 4702 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4703 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4704 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble > 1) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4659 | 4705 | if (NULL != (x->stroke_opacity = cJSON_malloc(sizeof(double)))) { |
| 4660 | 4706 | *x->stroke_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")); |
| 4661 | 4707 | } |
| 4662 | 4708 | } |
| 4663 | 4709 | if (cJSON_HasObjectItem(j, "strokeWidth")) { |
| 4664 | 4710 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4711 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4665 | 4712 | if (NULL != (x->stroke_width = cJSON_malloc(sizeof(double)))) { |
| 4666 | 4713 | *x->stroke_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")); |
| 4667 | 4714 | } |
| 4668 | 4715 | } |
| 4669 | 4716 | if (cJSON_HasObjectItem(j, "tension")) { |
| 4670 | 4717 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "tension"))) { cJSON_DeleteBarConfig(x); return NULL; } |
| 4718 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble < 0) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4719 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble > 1) { cJSON_DeleteBarConfig(x); return NULL; } | |
| 4671 | 4720 | if (NULL != (x->tension = cJSON_malloc(sizeof(double)))) { |
| 4672 | 4721 | *x->tension = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "tension")); |
| 4673 | 4722 | } |
| @@ -4959,6 +5008,7 @@ struct LegendConfig * cJSON_GetLegendConfigValue(const cJSON * j) { | ||
| 4959 | 5008 | } |
| 4960 | 5009 | if (cJSON_HasObjectItem(j, "gradientHeight")) { |
| 4961 | 5010 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "gradientHeight"))) { cJSON_DeleteLegendConfig(x); return NULL; } |
| 5011 | + if (cJSON_GetObjectItemCaseSensitive(j, "gradientHeight")->valuedouble < 0) { cJSON_DeleteLegendConfig(x); return NULL; } | |
| 4962 | 5012 | if (NULL != (x->gradient_height = cJSON_malloc(sizeof(double)))) { |
| 4963 | 5013 | *x->gradient_height = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "gradientHeight")); |
| 4964 | 5014 | } |
| @@ -4985,12 +5035,14 @@ struct LegendConfig * cJSON_GetLegendConfigValue(const cJSON * j) { | ||
| 4985 | 5035 | } |
| 4986 | 5036 | if (cJSON_HasObjectItem(j, "gradientStrokeWidth")) { |
| 4987 | 5037 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "gradientStrokeWidth"))) { cJSON_DeleteLegendConfig(x); return NULL; } |
| 5038 | + if (cJSON_GetObjectItemCaseSensitive(j, "gradientStrokeWidth")->valuedouble < 0) { cJSON_DeleteLegendConfig(x); return NULL; } | |
| 4988 | 5039 | if (NULL != (x->gradient_stroke_width = cJSON_malloc(sizeof(double)))) { |
| 4989 | 5040 | *x->gradient_stroke_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "gradientStrokeWidth")); |
| 4990 | 5041 | } |
| 4991 | 5042 | } |
| 4992 | 5043 | if (cJSON_HasObjectItem(j, "gradientWidth")) { |
| 4993 | 5044 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "gradientWidth"))) { cJSON_DeleteLegendConfig(x); return NULL; } |
| 5045 | + if (cJSON_GetObjectItemCaseSensitive(j, "gradientWidth")->valuedouble < 0) { cJSON_DeleteLegendConfig(x); return NULL; } | |
| 4994 | 5046 | if (NULL != (x->gradient_width = cJSON_malloc(sizeof(double)))) { |
| 4995 | 5047 | *x->gradient_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "gradientWidth")); |
| 4996 | 5048 | } |
| @@ -5013,6 +5065,7 @@ struct LegendConfig * cJSON_GetLegendConfigValue(const cJSON * j) { | ||
| 5013 | 5065 | } |
| 5014 | 5066 | if (cJSON_HasObjectItem(j, "labelFontSize")) { |
| 5015 | 5067 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "labelFontSize"))) { cJSON_DeleteLegendConfig(x); return NULL; } |
| 5068 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelFontSize")->valuedouble < 0) { cJSON_DeleteLegendConfig(x); return NULL; } | |
| 5016 | 5069 | if (NULL != (x->label_font_size = cJSON_malloc(sizeof(double)))) { |
| 5017 | 5070 | *x->label_font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "labelFontSize")); |
| 5018 | 5071 | } |
| @@ -5025,6 +5078,7 @@ struct LegendConfig * cJSON_GetLegendConfigValue(const cJSON * j) { | ||
| 5025 | 5078 | } |
| 5026 | 5079 | if (cJSON_HasObjectItem(j, "labelOffset")) { |
| 5027 | 5080 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "labelOffset"))) { cJSON_DeleteLegendConfig(x); return NULL; } |
| 5081 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelOffset")->valuedouble < 0) { cJSON_DeleteLegendConfig(x); return NULL; } | |
| 5028 | 5082 | if (NULL != (x->label_offset = cJSON_malloc(sizeof(double)))) { |
| 5029 | 5083 | *x->label_offset = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "labelOffset")); |
| 5030 | 5084 | } |
| @@ -5086,12 +5140,14 @@ struct LegendConfig * cJSON_GetLegendConfigValue(const cJSON * j) { | ||
| 5086 | 5140 | } |
| 5087 | 5141 | if (cJSON_HasObjectItem(j, "symbolSize")) { |
| 5088 | 5142 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "symbolSize"))) { cJSON_DeleteLegendConfig(x); return NULL; } |
| 5143 | + if (cJSON_GetObjectItemCaseSensitive(j, "symbolSize")->valuedouble < 0) { cJSON_DeleteLegendConfig(x); return NULL; } | |
| 5089 | 5144 | if (NULL != (x->symbol_size = cJSON_malloc(sizeof(double)))) { |
| 5090 | 5145 | *x->symbol_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "symbolSize")); |
| 5091 | 5146 | } |
| 5092 | 5147 | } |
| 5093 | 5148 | if (cJSON_HasObjectItem(j, "symbolStrokeWidth")) { |
| 5094 | 5149 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "symbolStrokeWidth"))) { cJSON_DeleteLegendConfig(x); return NULL; } |
| 5150 | + if (cJSON_GetObjectItemCaseSensitive(j, "symbolStrokeWidth")->valuedouble < 0) { cJSON_DeleteLegendConfig(x); return NULL; } | |
| 5095 | 5151 | if (NULL != (x->symbol_stroke_width = cJSON_malloc(sizeof(double)))) { |
| 5096 | 5152 | *x->symbol_stroke_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "symbolStrokeWidth")); |
| 5097 | 5153 | } |
| @@ -5978,12 +6034,16 @@ struct ScaleConfig * cJSON_GetScaleConfigValue(const cJSON * j) { | ||
| 5978 | 6034 | memset(x, 0, sizeof(struct ScaleConfig)); |
| 5979 | 6035 | if (cJSON_HasObjectItem(j, "bandPaddingInner")) { |
| 5980 | 6036 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "bandPaddingInner"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6037 | + if (cJSON_GetObjectItemCaseSensitive(j, "bandPaddingInner")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6038 | + if (cJSON_GetObjectItemCaseSensitive(j, "bandPaddingInner")->valuedouble > 1) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 5981 | 6039 | if (NULL != (x->band_padding_inner = cJSON_malloc(sizeof(double)))) { |
| 5982 | 6040 | *x->band_padding_inner = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "bandPaddingInner")); |
| 5983 | 6041 | } |
| 5984 | 6042 | } |
| 5985 | 6043 | if (cJSON_HasObjectItem(j, "bandPaddingOuter")) { |
| 5986 | 6044 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "bandPaddingOuter"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6045 | + if (cJSON_GetObjectItemCaseSensitive(j, "bandPaddingOuter")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6046 | + if (cJSON_GetObjectItemCaseSensitive(j, "bandPaddingOuter")->valuedouble > 1) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 5987 | 6047 | if (NULL != (x->band_padding_outer = cJSON_malloc(sizeof(double)))) { |
| 5988 | 6048 | *x->band_padding_outer = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "bandPaddingOuter")); |
| 5989 | 6049 | } |
| @@ -5996,72 +6056,87 @@ struct ScaleConfig * cJSON_GetScaleConfigValue(const cJSON * j) { | ||
| 5996 | 6056 | } |
| 5997 | 6057 | if (cJSON_HasObjectItem(j, "continuousPadding")) { |
| 5998 | 6058 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "continuousPadding"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6059 | + if (cJSON_GetObjectItemCaseSensitive(j, "continuousPadding")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 5999 | 6060 | if (NULL != (x->continuous_padding = cJSON_malloc(sizeof(double)))) { |
| 6000 | 6061 | *x->continuous_padding = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "continuousPadding")); |
| 6001 | 6062 | } |
| 6002 | 6063 | } |
| 6003 | 6064 | if (cJSON_HasObjectItem(j, "maxBandSize")) { |
| 6004 | 6065 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "maxBandSize"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6066 | + if (cJSON_GetObjectItemCaseSensitive(j, "maxBandSize")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6005 | 6067 | if (NULL != (x->max_band_size = cJSON_malloc(sizeof(double)))) { |
| 6006 | 6068 | *x->max_band_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "maxBandSize")); |
| 6007 | 6069 | } |
| 6008 | 6070 | } |
| 6009 | 6071 | if (cJSON_HasObjectItem(j, "maxFontSize")) { |
| 6010 | 6072 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "maxFontSize"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6073 | + if (cJSON_GetObjectItemCaseSensitive(j, "maxFontSize")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6011 | 6074 | if (NULL != (x->max_font_size = cJSON_malloc(sizeof(double)))) { |
| 6012 | 6075 | *x->max_font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "maxFontSize")); |
| 6013 | 6076 | } |
| 6014 | 6077 | } |
| 6015 | 6078 | if (cJSON_HasObjectItem(j, "maxOpacity")) { |
| 6016 | 6079 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "maxOpacity"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6080 | + if (cJSON_GetObjectItemCaseSensitive(j, "maxOpacity")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6081 | + if (cJSON_GetObjectItemCaseSensitive(j, "maxOpacity")->valuedouble > 1) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6017 | 6082 | if (NULL != (x->max_opacity = cJSON_malloc(sizeof(double)))) { |
| 6018 | 6083 | *x->max_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "maxOpacity")); |
| 6019 | 6084 | } |
| 6020 | 6085 | } |
| 6021 | 6086 | if (cJSON_HasObjectItem(j, "maxSize")) { |
| 6022 | 6087 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "maxSize"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6088 | + if (cJSON_GetObjectItemCaseSensitive(j, "maxSize")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6023 | 6089 | if (NULL != (x->max_size = cJSON_malloc(sizeof(double)))) { |
| 6024 | 6090 | *x->max_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "maxSize")); |
| 6025 | 6091 | } |
| 6026 | 6092 | } |
| 6027 | 6093 | if (cJSON_HasObjectItem(j, "maxStrokeWidth")) { |
| 6028 | 6094 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "maxStrokeWidth"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6095 | + if (cJSON_GetObjectItemCaseSensitive(j, "maxStrokeWidth")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6029 | 6096 | if (NULL != (x->max_stroke_width = cJSON_malloc(sizeof(double)))) { |
| 6030 | 6097 | *x->max_stroke_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "maxStrokeWidth")); |
| 6031 | 6098 | } |
| 6032 | 6099 | } |
| 6033 | 6100 | if (cJSON_HasObjectItem(j, "minBandSize")) { |
| 6034 | 6101 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "minBandSize"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6102 | + if (cJSON_GetObjectItemCaseSensitive(j, "minBandSize")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6035 | 6103 | if (NULL != (x->min_band_size = cJSON_malloc(sizeof(double)))) { |
| 6036 | 6104 | *x->min_band_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "minBandSize")); |
| 6037 | 6105 | } |
| 6038 | 6106 | } |
| 6039 | 6107 | if (cJSON_HasObjectItem(j, "minFontSize")) { |
| 6040 | 6108 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "minFontSize"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6109 | + if (cJSON_GetObjectItemCaseSensitive(j, "minFontSize")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6041 | 6110 | if (NULL != (x->min_font_size = cJSON_malloc(sizeof(double)))) { |
| 6042 | 6111 | *x->min_font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "minFontSize")); |
| 6043 | 6112 | } |
| 6044 | 6113 | } |
| 6045 | 6114 | if (cJSON_HasObjectItem(j, "minOpacity")) { |
| 6046 | 6115 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "minOpacity"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6116 | + if (cJSON_GetObjectItemCaseSensitive(j, "minOpacity")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6117 | + if (cJSON_GetObjectItemCaseSensitive(j, "minOpacity")->valuedouble > 1) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6047 | 6118 | if (NULL != (x->min_opacity = cJSON_malloc(sizeof(double)))) { |
| 6048 | 6119 | *x->min_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "minOpacity")); |
| 6049 | 6120 | } |
| 6050 | 6121 | } |
| 6051 | 6122 | if (cJSON_HasObjectItem(j, "minSize")) { |
| 6052 | 6123 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "minSize"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6124 | + if (cJSON_GetObjectItemCaseSensitive(j, "minSize")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6053 | 6125 | if (NULL != (x->min_size = cJSON_malloc(sizeof(double)))) { |
| 6054 | 6126 | *x->min_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "minSize")); |
| 6055 | 6127 | } |
| 6056 | 6128 | } |
| 6057 | 6129 | if (cJSON_HasObjectItem(j, "minStrokeWidth")) { |
| 6058 | 6130 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "minStrokeWidth"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6131 | + if (cJSON_GetObjectItemCaseSensitive(j, "minStrokeWidth")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6059 | 6132 | if (NULL != (x->min_stroke_width = cJSON_malloc(sizeof(double)))) { |
| 6060 | 6133 | *x->min_stroke_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "minStrokeWidth")); |
| 6061 | 6134 | } |
| 6062 | 6135 | } |
| 6063 | 6136 | if (cJSON_HasObjectItem(j, "pointPadding")) { |
| 6064 | 6137 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "pointPadding"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6138 | + if (cJSON_GetObjectItemCaseSensitive(j, "pointPadding")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6139 | + if (cJSON_GetObjectItemCaseSensitive(j, "pointPadding")->valuedouble > 1) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6065 | 6140 | if (NULL != (x->point_padding = cJSON_malloc(sizeof(double)))) { |
| 6066 | 6141 | *x->point_padding = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "pointPadding")); |
| 6067 | 6142 | } |
| @@ -6080,6 +6155,7 @@ struct ScaleConfig * cJSON_GetScaleConfigValue(const cJSON * j) { | ||
| 6080 | 6155 | } |
| 6081 | 6156 | if (cJSON_HasObjectItem(j, "textXRangeStep")) { |
| 6082 | 6157 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "textXRangeStep"))) { cJSON_DeleteScaleConfig(x); return NULL; } |
| 6158 | + if (cJSON_GetObjectItemCaseSensitive(j, "textXRangeStep")->valuedouble < 0) { cJSON_DeleteScaleConfig(x); return NULL; } | |
| 6083 | 6159 | if (NULL != (x->text_x_range_step = cJSON_malloc(sizeof(double)))) { |
| 6084 | 6160 | *x->text_x_range_step = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "textXRangeStep")); |
| 6085 | 6161 | } |
| @@ -7194,6 +7270,8 @@ struct VgMarkConfig * cJSON_GetVgMarkConfigValue(const cJSON * j) { | ||
| 7194 | 7270 | } |
| 7195 | 7271 | if (cJSON_HasObjectItem(j, "angle")) { |
| 7196 | 7272 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "angle"))) { cJSON_DeleteVgMarkConfig(x); return NULL; } |
| 7273 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble < 0) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7274 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble > 360) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7197 | 7275 | if (NULL != (x->angle = cJSON_malloc(sizeof(double)))) { |
| 7198 | 7276 | *x->angle = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "angle")); |
| 7199 | 7277 | } |
| @@ -7230,6 +7308,8 @@ struct VgMarkConfig * cJSON_GetVgMarkConfigValue(const cJSON * j) { | ||
| 7230 | 7308 | } |
| 7231 | 7309 | if (cJSON_HasObjectItem(j, "fillOpacity")) { |
| 7232 | 7310 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity"))) { cJSON_DeleteVgMarkConfig(x); return NULL; } |
| 7311 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble < 0) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7312 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble > 1) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7233 | 7313 | if (NULL != (x->fill_opacity = cJSON_malloc(sizeof(double)))) { |
| 7234 | 7314 | *x->fill_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")); |
| 7235 | 7315 | } |
| @@ -7240,6 +7320,7 @@ struct VgMarkConfig * cJSON_GetVgMarkConfigValue(const cJSON * j) { | ||
| 7240 | 7320 | } |
| 7241 | 7321 | if (cJSON_HasObjectItem(j, "fontSize")) { |
| 7242 | 7322 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fontSize"))) { cJSON_DeleteVgMarkConfig(x); return NULL; } |
| 7323 | + if (cJSON_GetObjectItemCaseSensitive(j, "fontSize")->valuedouble < 0) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7243 | 7324 | if (NULL != (x->font_size = cJSON_malloc(sizeof(double)))) { |
| 7244 | 7325 | *x->font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fontSize")); |
| 7245 | 7326 | } |
| @@ -7275,6 +7356,8 @@ struct VgMarkConfig * cJSON_GetVgMarkConfigValue(const cJSON * j) { | ||
| 7275 | 7356 | } |
| 7276 | 7357 | if (cJSON_HasObjectItem(j, "opacity")) { |
| 7277 | 7358 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "opacity"))) { cJSON_DeleteVgMarkConfig(x); return NULL; } |
| 7359 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble < 0) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7360 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble > 1) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7278 | 7361 | if (NULL != (x->opacity = cJSON_malloc(sizeof(double)))) { |
| 7279 | 7362 | *x->opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "opacity")); |
| 7280 | 7363 | } |
| @@ -7288,6 +7371,7 @@ struct VgMarkConfig * cJSON_GetVgMarkConfigValue(const cJSON * j) { | ||
| 7288 | 7371 | } |
| 7289 | 7372 | if (cJSON_HasObjectItem(j, "radius")) { |
| 7290 | 7373 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "radius"))) { cJSON_DeleteVgMarkConfig(x); return NULL; } |
| 7374 | + if (cJSON_GetObjectItemCaseSensitive(j, "radius")->valuedouble < 0) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7291 | 7375 | if (NULL != (x->radius = cJSON_malloc(sizeof(double)))) { |
| 7292 | 7376 | *x->radius = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "radius")); |
| 7293 | 7377 | } |
| @@ -7298,6 +7382,7 @@ struct VgMarkConfig * cJSON_GetVgMarkConfigValue(const cJSON * j) { | ||
| 7298 | 7382 | } |
| 7299 | 7383 | if (cJSON_HasObjectItem(j, "size")) { |
| 7300 | 7384 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "size"))) { cJSON_DeleteVgMarkConfig(x); return NULL; } |
| 7385 | + if (cJSON_GetObjectItemCaseSensitive(j, "size")->valuedouble < 0) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7301 | 7386 | if (NULL != (x->size = cJSON_malloc(sizeof(double)))) { |
| 7302 | 7387 | *x->size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "size")); |
| 7303 | 7388 | } |
| @@ -7330,18 +7415,23 @@ struct VgMarkConfig * cJSON_GetVgMarkConfigValue(const cJSON * j) { | ||
| 7330 | 7415 | } |
| 7331 | 7416 | if (cJSON_HasObjectItem(j, "strokeOpacity")) { |
| 7332 | 7417 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity"))) { cJSON_DeleteVgMarkConfig(x); return NULL; } |
| 7418 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble < 0) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7419 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble > 1) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7333 | 7420 | if (NULL != (x->stroke_opacity = cJSON_malloc(sizeof(double)))) { |
| 7334 | 7421 | *x->stroke_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")); |
| 7335 | 7422 | } |
| 7336 | 7423 | } |
| 7337 | 7424 | if (cJSON_HasObjectItem(j, "strokeWidth")) { |
| 7338 | 7425 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth"))) { cJSON_DeleteVgMarkConfig(x); return NULL; } |
| 7426 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")->valuedouble < 0) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7339 | 7427 | if (NULL != (x->stroke_width = cJSON_malloc(sizeof(double)))) { |
| 7340 | 7428 | *x->stroke_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")); |
| 7341 | 7429 | } |
| 7342 | 7430 | } |
| 7343 | 7431 | if (cJSON_HasObjectItem(j, "tension")) { |
| 7344 | 7432 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "tension"))) { cJSON_DeleteVgMarkConfig(x); return NULL; } |
| 7433 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble < 0) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7434 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble > 1) { cJSON_DeleteVgMarkConfig(x); return NULL; } | |
| 7345 | 7435 | if (NULL != (x->tension = cJSON_malloc(sizeof(double)))) { |
| 7346 | 7436 | *x->tension = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "tension")); |
| 7347 | 7437 | } |
| @@ -7594,6 +7684,8 @@ struct TextConfig * cJSON_GetTextConfigValue(const cJSON * j) { | ||
| 7594 | 7684 | } |
| 7595 | 7685 | if (cJSON_HasObjectItem(j, "angle")) { |
| 7596 | 7686 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "angle"))) { cJSON_DeleteTextConfig(x); return NULL; } |
| 7687 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble < 0) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7688 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble > 360) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7597 | 7689 | if (NULL != (x->angle = cJSON_malloc(sizeof(double)))) { |
| 7598 | 7690 | *x->angle = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "angle")); |
| 7599 | 7691 | } |
| @@ -7640,6 +7732,8 @@ struct TextConfig * cJSON_GetTextConfigValue(const cJSON * j) { | ||
| 7640 | 7732 | } |
| 7641 | 7733 | if (cJSON_HasObjectItem(j, "fillOpacity")) { |
| 7642 | 7734 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity"))) { cJSON_DeleteTextConfig(x); return NULL; } |
| 7735 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble < 0) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7736 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble > 1) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7643 | 7737 | if (NULL != (x->fill_opacity = cJSON_malloc(sizeof(double)))) { |
| 7644 | 7738 | *x->fill_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")); |
| 7645 | 7739 | } |
| @@ -7650,6 +7744,7 @@ struct TextConfig * cJSON_GetTextConfigValue(const cJSON * j) { | ||
| 7650 | 7744 | } |
| 7651 | 7745 | if (cJSON_HasObjectItem(j, "fontSize")) { |
| 7652 | 7746 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fontSize"))) { cJSON_DeleteTextConfig(x); return NULL; } |
| 7747 | + if (cJSON_GetObjectItemCaseSensitive(j, "fontSize")->valuedouble < 0) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7653 | 7748 | if (NULL != (x->font_size = cJSON_malloc(sizeof(double)))) { |
| 7654 | 7749 | *x->font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fontSize")); |
| 7655 | 7750 | } |
| @@ -7685,6 +7780,8 @@ struct TextConfig * cJSON_GetTextConfigValue(const cJSON * j) { | ||
| 7685 | 7780 | } |
| 7686 | 7781 | if (cJSON_HasObjectItem(j, "opacity")) { |
| 7687 | 7782 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "opacity"))) { cJSON_DeleteTextConfig(x); return NULL; } |
| 7783 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble < 0) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7784 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble > 1) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7688 | 7785 | if (NULL != (x->opacity = cJSON_malloc(sizeof(double)))) { |
| 7689 | 7786 | *x->opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "opacity")); |
| 7690 | 7787 | } |
| @@ -7698,6 +7795,7 @@ struct TextConfig * cJSON_GetTextConfigValue(const cJSON * j) { | ||
| 7698 | 7795 | } |
| 7699 | 7796 | if (cJSON_HasObjectItem(j, "radius")) { |
| 7700 | 7797 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "radius"))) { cJSON_DeleteTextConfig(x); return NULL; } |
| 7798 | + if (cJSON_GetObjectItemCaseSensitive(j, "radius")->valuedouble < 0) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7701 | 7799 | if (NULL != (x->radius = cJSON_malloc(sizeof(double)))) { |
| 7702 | 7800 | *x->radius = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "radius")); |
| 7703 | 7801 | } |
| @@ -7714,6 +7812,7 @@ struct TextConfig * cJSON_GetTextConfigValue(const cJSON * j) { | ||
| 7714 | 7812 | } |
| 7715 | 7813 | if (cJSON_HasObjectItem(j, "size")) { |
| 7716 | 7814 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "size"))) { cJSON_DeleteTextConfig(x); return NULL; } |
| 7815 | + if (cJSON_GetObjectItemCaseSensitive(j, "size")->valuedouble < 0) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7717 | 7816 | if (NULL != (x->size = cJSON_malloc(sizeof(double)))) { |
| 7718 | 7817 | *x->size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "size")); |
| 7719 | 7818 | } |
| @@ -7746,18 +7845,23 @@ struct TextConfig * cJSON_GetTextConfigValue(const cJSON * j) { | ||
| 7746 | 7845 | } |
| 7747 | 7846 | if (cJSON_HasObjectItem(j, "strokeOpacity")) { |
| 7748 | 7847 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity"))) { cJSON_DeleteTextConfig(x); return NULL; } |
| 7848 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble < 0) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7849 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble > 1) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7749 | 7850 | if (NULL != (x->stroke_opacity = cJSON_malloc(sizeof(double)))) { |
| 7750 | 7851 | *x->stroke_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")); |
| 7751 | 7852 | } |
| 7752 | 7853 | } |
| 7753 | 7854 | if (cJSON_HasObjectItem(j, "strokeWidth")) { |
| 7754 | 7855 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth"))) { cJSON_DeleteTextConfig(x); return NULL; } |
| 7856 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")->valuedouble < 0) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7755 | 7857 | if (NULL != (x->stroke_width = cJSON_malloc(sizeof(double)))) { |
| 7756 | 7858 | *x->stroke_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")); |
| 7757 | 7859 | } |
| 7758 | 7860 | } |
| 7759 | 7861 | if (cJSON_HasObjectItem(j, "tension")) { |
| 7760 | 7862 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "tension"))) { cJSON_DeleteTextConfig(x); return NULL; } |
| 7863 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble < 0) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7864 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble > 1) { cJSON_DeleteTextConfig(x); return NULL; } | |
| 7761 | 7865 | if (NULL != (x->tension = cJSON_malloc(sizeof(double)))) { |
| 7762 | 7866 | *x->tension = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "tension")); |
| 7763 | 7867 | } |
| @@ -8028,12 +8132,15 @@ struct TickConfig * cJSON_GetTickConfigValue(const cJSON * j) { | ||
| 8028 | 8132 | } |
| 8029 | 8133 | if (cJSON_HasObjectItem(j, "angle")) { |
| 8030 | 8134 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "angle"))) { cJSON_DeleteTickConfig(x); return NULL; } |
| 8135 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble < 0) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8136 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble > 360) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8031 | 8137 | if (NULL != (x->angle = cJSON_malloc(sizeof(double)))) { |
| 8032 | 8138 | *x->angle = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "angle")); |
| 8033 | 8139 | } |
| 8034 | 8140 | } |
| 8035 | 8141 | if (cJSON_HasObjectItem(j, "bandSize")) { |
| 8036 | 8142 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "bandSize"))) { cJSON_DeleteTickConfig(x); return NULL; } |
| 8143 | + if (cJSON_GetObjectItemCaseSensitive(j, "bandSize")->valuedouble < 0) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8037 | 8144 | if (NULL != (x->band_size = cJSON_malloc(sizeof(double)))) { |
| 8038 | 8145 | *x->band_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "bandSize")); |
| 8039 | 8146 | } |
| @@ -8080,6 +8187,8 @@ struct TickConfig * cJSON_GetTickConfigValue(const cJSON * j) { | ||
| 8080 | 8187 | } |
| 8081 | 8188 | if (cJSON_HasObjectItem(j, "fillOpacity")) { |
| 8082 | 8189 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity"))) { cJSON_DeleteTickConfig(x); return NULL; } |
| 8190 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble < 0) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8191 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble > 1) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8083 | 8192 | if (NULL != (x->fill_opacity = cJSON_malloc(sizeof(double)))) { |
| 8084 | 8193 | *x->fill_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")); |
| 8085 | 8194 | } |
| @@ -8090,6 +8199,7 @@ struct TickConfig * cJSON_GetTickConfigValue(const cJSON * j) { | ||
| 8090 | 8199 | } |
| 8091 | 8200 | if (cJSON_HasObjectItem(j, "fontSize")) { |
| 8092 | 8201 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fontSize"))) { cJSON_DeleteTickConfig(x); return NULL; } |
| 8202 | + if (cJSON_GetObjectItemCaseSensitive(j, "fontSize")->valuedouble < 0) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8093 | 8203 | if (NULL != (x->font_size = cJSON_malloc(sizeof(double)))) { |
| 8094 | 8204 | *x->font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fontSize")); |
| 8095 | 8205 | } |
| @@ -8125,6 +8235,8 @@ struct TickConfig * cJSON_GetTickConfigValue(const cJSON * j) { | ||
| 8125 | 8235 | } |
| 8126 | 8236 | if (cJSON_HasObjectItem(j, "opacity")) { |
| 8127 | 8237 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "opacity"))) { cJSON_DeleteTickConfig(x); return NULL; } |
| 8238 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble < 0) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8239 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble > 1) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8128 | 8240 | if (NULL != (x->opacity = cJSON_malloc(sizeof(double)))) { |
| 8129 | 8241 | *x->opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "opacity")); |
| 8130 | 8242 | } |
| @@ -8138,6 +8250,7 @@ struct TickConfig * cJSON_GetTickConfigValue(const cJSON * j) { | ||
| 8138 | 8250 | } |
| 8139 | 8251 | if (cJSON_HasObjectItem(j, "radius")) { |
| 8140 | 8252 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "radius"))) { cJSON_DeleteTickConfig(x); return NULL; } |
| 8253 | + if (cJSON_GetObjectItemCaseSensitive(j, "radius")->valuedouble < 0) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8141 | 8254 | if (NULL != (x->radius = cJSON_malloc(sizeof(double)))) { |
| 8142 | 8255 | *x->radius = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "radius")); |
| 8143 | 8256 | } |
| @@ -8148,6 +8261,7 @@ struct TickConfig * cJSON_GetTickConfigValue(const cJSON * j) { | ||
| 8148 | 8261 | } |
| 8149 | 8262 | if (cJSON_HasObjectItem(j, "size")) { |
| 8150 | 8263 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "size"))) { cJSON_DeleteTickConfig(x); return NULL; } |
| 8264 | + if (cJSON_GetObjectItemCaseSensitive(j, "size")->valuedouble < 0) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8151 | 8265 | if (NULL != (x->size = cJSON_malloc(sizeof(double)))) { |
| 8152 | 8266 | *x->size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "size")); |
| 8153 | 8267 | } |
| @@ -8180,18 +8294,23 @@ struct TickConfig * cJSON_GetTickConfigValue(const cJSON * j) { | ||
| 8180 | 8294 | } |
| 8181 | 8295 | if (cJSON_HasObjectItem(j, "strokeOpacity")) { |
| 8182 | 8296 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity"))) { cJSON_DeleteTickConfig(x); return NULL; } |
| 8297 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble < 0) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8298 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble > 1) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8183 | 8299 | if (NULL != (x->stroke_opacity = cJSON_malloc(sizeof(double)))) { |
| 8184 | 8300 | *x->stroke_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")); |
| 8185 | 8301 | } |
| 8186 | 8302 | } |
| 8187 | 8303 | if (cJSON_HasObjectItem(j, "strokeWidth")) { |
| 8188 | 8304 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth"))) { cJSON_DeleteTickConfig(x); return NULL; } |
| 8305 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")->valuedouble < 0) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8189 | 8306 | if (NULL != (x->stroke_width = cJSON_malloc(sizeof(double)))) { |
| 8190 | 8307 | *x->stroke_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")); |
| 8191 | 8308 | } |
| 8192 | 8309 | } |
| 8193 | 8310 | if (cJSON_HasObjectItem(j, "tension")) { |
| 8194 | 8311 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "tension"))) { cJSON_DeleteTickConfig(x); return NULL; } |
| 8312 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble < 0) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8313 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble > 1) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8195 | 8314 | if (NULL != (x->tension = cJSON_malloc(sizeof(double)))) { |
| 8196 | 8315 | *x->tension = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "tension")); |
| 8197 | 8316 | } |
| @@ -8208,6 +8327,7 @@ struct TickConfig * cJSON_GetTickConfigValue(const cJSON * j) { | ||
| 8208 | 8327 | } |
| 8209 | 8328 | if (cJSON_HasObjectItem(j, "thickness")) { |
| 8210 | 8329 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "thickness"))) { cJSON_DeleteTickConfig(x); return NULL; } |
| 8330 | + if (cJSON_GetObjectItemCaseSensitive(j, "thickness")->valuedouble < 0) { cJSON_DeleteTickConfig(x); return NULL; } | |
| 8211 | 8331 | if (NULL != (x->thickness = cJSON_malloc(sizeof(double)))) { |
| 8212 | 8332 | *x->thickness = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "thickness")); |
| 8213 | 8333 | } |
| @@ -8495,6 +8615,7 @@ struct VgTitleConfig * cJSON_GetVgTitleConfigValue(const cJSON * j) { | ||
| 8495 | 8615 | } |
| 8496 | 8616 | if (cJSON_HasObjectItem(j, "fontSize")) { |
| 8497 | 8617 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fontSize"))) { cJSON_DeleteVgTitleConfig(x); return NULL; } |
| 8618 | + if (cJSON_GetObjectItemCaseSensitive(j, "fontSize")->valuedouble < 0) { cJSON_DeleteVgTitleConfig(x); return NULL; } | |
| 8498 | 8619 | if (NULL != (x->font_size = cJSON_malloc(sizeof(double)))) { |
| 8499 | 8620 | *x->font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fontSize")); |
| 8500 | 8621 | } |
| @@ -8506,6 +8627,7 @@ struct VgTitleConfig * cJSON_GetVgTitleConfigValue(const cJSON * j) { | ||
| 8506 | 8627 | } |
| 8507 | 8628 | if (cJSON_HasObjectItem(j, "limit")) { |
| 8508 | 8629 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "limit"))) { cJSON_DeleteVgTitleConfig(x); return NULL; } |
| 8630 | + if (cJSON_GetObjectItemCaseSensitive(j, "limit")->valuedouble < 0) { cJSON_DeleteVgTitleConfig(x); return NULL; } | |
| 8509 | 8631 | if (NULL != (x->limit = cJSON_malloc(sizeof(double)))) { |
| 8510 | 8632 | *x->limit = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "limit")); |
| 8511 | 8633 | } |
| @@ -9573,6 +9695,7 @@ struct BinParams * cJSON_GetBinParamsValue(const cJSON * j) { | ||
| 9573 | 9695 | } |
| 9574 | 9696 | if (cJSON_HasObjectItem(j, "maxbins")) { |
| 9575 | 9697 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "maxbins"))) { cJSON_DeleteBinParams(x); return NULL; } |
| 9698 | + if (cJSON_GetObjectItemCaseSensitive(j, "maxbins")->valuedouble < 2) { cJSON_DeleteBinParams(x); return NULL; } | |
| 9576 | 9699 | if (NULL != (x->maxbins = cJSON_malloc(sizeof(double)))) { |
| 9577 | 9700 | *x->maxbins = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "maxbins")); |
| 9578 | 9701 | } |
| @@ -9870,6 +9993,8 @@ struct DateTime * cJSON_GetDateTimeValue(const cJSON * j) { | ||
| 9870 | 9993 | memset(x, 0, sizeof(struct DateTime)); |
| 9871 | 9994 | if (cJSON_HasObjectItem(j, "date")) { |
| 9872 | 9995 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "date"))) { cJSON_DeleteDateTime(x); return NULL; } |
| 9996 | + if (cJSON_GetObjectItemCaseSensitive(j, "date")->valuedouble < 1) { cJSON_DeleteDateTime(x); return NULL; } | |
| 9997 | + if (cJSON_GetObjectItemCaseSensitive(j, "date")->valuedouble > 31) { cJSON_DeleteDateTime(x); return NULL; } | |
| 9873 | 9998 | if (NULL != (x->date = cJSON_malloc(sizeof(double)))) { |
| 9874 | 9999 | *x->date = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "date")); |
| 9875 | 10000 | } |
| @@ -9881,18 +10006,24 @@ struct DateTime * cJSON_GetDateTimeValue(const cJSON * j) { | ||
| 9881 | 10006 | } |
| 9882 | 10007 | if (cJSON_HasObjectItem(j, "hours")) { |
| 9883 | 10008 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "hours"))) { cJSON_DeleteDateTime(x); return NULL; } |
| 10009 | + if (cJSON_GetObjectItemCaseSensitive(j, "hours")->valuedouble < 0) { cJSON_DeleteDateTime(x); return NULL; } | |
| 10010 | + if (cJSON_GetObjectItemCaseSensitive(j, "hours")->valuedouble > 23) { cJSON_DeleteDateTime(x); return NULL; } | |
| 9884 | 10011 | if (NULL != (x->hours = cJSON_malloc(sizeof(double)))) { |
| 9885 | 10012 | *x->hours = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "hours")); |
| 9886 | 10013 | } |
| 9887 | 10014 | } |
| 9888 | 10015 | if (cJSON_HasObjectItem(j, "milliseconds")) { |
| 9889 | 10016 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "milliseconds"))) { cJSON_DeleteDateTime(x); return NULL; } |
| 10017 | + if (cJSON_GetObjectItemCaseSensitive(j, "milliseconds")->valuedouble < 0) { cJSON_DeleteDateTime(x); return NULL; } | |
| 10018 | + if (cJSON_GetObjectItemCaseSensitive(j, "milliseconds")->valuedouble > 999) { cJSON_DeleteDateTime(x); return NULL; } | |
| 9890 | 10019 | if (NULL != (x->milliseconds = cJSON_malloc(sizeof(double)))) { |
| 9891 | 10020 | *x->milliseconds = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "milliseconds")); |
| 9892 | 10021 | } |
| 9893 | 10022 | } |
| 9894 | 10023 | if (cJSON_HasObjectItem(j, "minutes")) { |
| 9895 | 10024 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "minutes"))) { cJSON_DeleteDateTime(x); return NULL; } |
| 10025 | + if (cJSON_GetObjectItemCaseSensitive(j, "minutes")->valuedouble < 0) { cJSON_DeleteDateTime(x); return NULL; } | |
| 10026 | + if (cJSON_GetObjectItemCaseSensitive(j, "minutes")->valuedouble > 59) { cJSON_DeleteDateTime(x); return NULL; } | |
| 9896 | 10027 | if (NULL != (x->minutes = cJSON_malloc(sizeof(double)))) { |
| 9897 | 10028 | *x->minutes = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "minutes")); |
| 9898 | 10029 | } |
| @@ -9904,12 +10035,16 @@ struct DateTime * cJSON_GetDateTimeValue(const cJSON * j) { | ||
| 9904 | 10035 | } |
| 9905 | 10036 | if (cJSON_HasObjectItem(j, "quarter")) { |
| 9906 | 10037 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "quarter"))) { cJSON_DeleteDateTime(x); return NULL; } |
| 10038 | + if (cJSON_GetObjectItemCaseSensitive(j, "quarter")->valuedouble < 1) { cJSON_DeleteDateTime(x); return NULL; } | |
| 10039 | + if (cJSON_GetObjectItemCaseSensitive(j, "quarter")->valuedouble > 4) { cJSON_DeleteDateTime(x); return NULL; } | |
| 9907 | 10040 | if (NULL != (x->quarter = cJSON_malloc(sizeof(double)))) { |
| 9908 | 10041 | *x->quarter = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "quarter")); |
| 9909 | 10042 | } |
| 9910 | 10043 | } |
| 9911 | 10044 | if (cJSON_HasObjectItem(j, "seconds")) { |
| 9912 | 10045 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "seconds"))) { cJSON_DeleteDateTime(x); return NULL; } |
| 10046 | + if (cJSON_GetObjectItemCaseSensitive(j, "seconds")->valuedouble < 0) { cJSON_DeleteDateTime(x); return NULL; } | |
| 10047 | + if (cJSON_GetObjectItemCaseSensitive(j, "seconds")->valuedouble > 59) { cJSON_DeleteDateTime(x); return NULL; } | |
| 9913 | 10048 | if (NULL != (x->seconds = cJSON_malloc(sizeof(double)))) { |
| 9914 | 10049 | *x->seconds = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "seconds")); |
| 9915 | 10050 | } |
| @@ -10467,6 +10602,7 @@ struct Legend * cJSON_GetLegendValue(const cJSON * j) { | ||
| 10467 | 10602 | } |
| 10468 | 10603 | if (cJSON_HasObjectItem(j, "zindex")) { |
| 10469 | 10604 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "zindex"))) { cJSON_DeleteLegend(x); return NULL; } |
| 10605 | + if (cJSON_GetObjectItemCaseSensitive(j, "zindex")->valuedouble < 0) { cJSON_DeleteLegend(x); return NULL; } | |
| 10470 | 10606 | if (NULL != (x->zindex = cJSON_malloc(sizeof(double)))) { |
| 10471 | 10607 | *x->zindex = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "zindex")); |
| 10472 | 10608 | } |
| @@ -10962,18 +11098,23 @@ struct Scale * cJSON_GetScaleValue(const cJSON * j) { | ||
| 10962 | 11098 | } |
| 10963 | 11099 | if (cJSON_HasObjectItem(j, "padding")) { |
| 10964 | 11100 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "padding"))) { cJSON_DeleteScale(x); return NULL; } |
| 11101 | + if (cJSON_GetObjectItemCaseSensitive(j, "padding")->valuedouble < 0) { cJSON_DeleteScale(x); return NULL; } | |
| 10965 | 11102 | if (NULL != (x->padding = cJSON_malloc(sizeof(double)))) { |
| 10966 | 11103 | *x->padding = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "padding")); |
| 10967 | 11104 | } |
| 10968 | 11105 | } |
| 10969 | 11106 | if (cJSON_HasObjectItem(j, "paddingInner")) { |
| 10970 | 11107 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "paddingInner"))) { cJSON_DeleteScale(x); return NULL; } |
| 11108 | + if (cJSON_GetObjectItemCaseSensitive(j, "paddingInner")->valuedouble < 0) { cJSON_DeleteScale(x); return NULL; } | |
| 11109 | + if (cJSON_GetObjectItemCaseSensitive(j, "paddingInner")->valuedouble > 1) { cJSON_DeleteScale(x); return NULL; } | |
| 10971 | 11110 | if (NULL != (x->padding_inner = cJSON_malloc(sizeof(double)))) { |
| 10972 | 11111 | *x->padding_inner = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "paddingInner")); |
| 10973 | 11112 | } |
| 10974 | 11113 | } |
| 10975 | 11114 | if (cJSON_HasObjectItem(j, "paddingOuter")) { |
| 10976 | 11115 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "paddingOuter"))) { cJSON_DeleteScale(x); return NULL; } |
| 11116 | + if (cJSON_GetObjectItemCaseSensitive(j, "paddingOuter")->valuedouble < 0) { cJSON_DeleteScale(x); return NULL; } | |
| 11117 | + if (cJSON_GetObjectItemCaseSensitive(j, "paddingOuter")->valuedouble > 1) { cJSON_DeleteScale(x); return NULL; } | |
| 10977 | 11118 | if (NULL != (x->padding_outer = cJSON_malloc(sizeof(double)))) { |
| 10978 | 11119 | *x->padding_outer = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "paddingOuter")); |
| 10979 | 11120 | } |
| @@ -11591,6 +11732,8 @@ struct Header * cJSON_GetHeaderValue(const cJSON * j) { | ||
| 11591 | 11732 | } |
| 11592 | 11733 | if (cJSON_HasObjectItem(j, "labelAngle")) { |
| 11593 | 11734 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "labelAngle"))) { cJSON_DeleteHeader(x); return NULL; } |
| 11735 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelAngle")->valuedouble < -360) { cJSON_DeleteHeader(x); return NULL; } | |
| 11736 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelAngle")->valuedouble > 360) { cJSON_DeleteHeader(x); return NULL; } | |
| 11594 | 11737 | if (NULL != (x->label_angle = cJSON_malloc(sizeof(double)))) { |
| 11595 | 11738 | *x->label_angle = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "labelAngle")); |
| 11596 | 11739 | } |
| @@ -12612,6 +12755,8 @@ struct Axis * cJSON_GetAxisValue(const cJSON * j) { | ||
| 12612 | 12755 | } |
| 12613 | 12756 | if (cJSON_HasObjectItem(j, "labelAngle")) { |
| 12614 | 12757 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "labelAngle"))) { cJSON_DeleteAxis(x); return NULL; } |
| 12758 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelAngle")->valuedouble < -360) { cJSON_DeleteAxis(x); return NULL; } | |
| 12759 | + if (cJSON_GetObjectItemCaseSensitive(j, "labelAngle")->valuedouble > 360) { cJSON_DeleteAxis(x); return NULL; } | |
| 12615 | 12760 | if (NULL != (x->label_angle = cJSON_malloc(sizeof(double)))) { |
| 12616 | 12761 | *x->label_angle = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "labelAngle")); |
| 12617 | 12762 | } |
| @@ -12688,6 +12833,7 @@ struct Axis * cJSON_GetAxisValue(const cJSON * j) { | ||
| 12688 | 12833 | } |
| 12689 | 12834 | if (cJSON_HasObjectItem(j, "tickSize")) { |
| 12690 | 12835 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "tickSize"))) { cJSON_DeleteAxis(x); return NULL; } |
| 12836 | + if (cJSON_GetObjectItemCaseSensitive(j, "tickSize")->valuedouble < 0) { cJSON_DeleteAxis(x); return NULL; } | |
| 12691 | 12837 | if (NULL != (x->tick_size = cJSON_malloc(sizeof(double)))) { |
| 12692 | 12838 | *x->tick_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "tickSize")); |
| 12693 | 12839 | } |
| @@ -12724,6 +12870,7 @@ struct Axis * cJSON_GetAxisValue(const cJSON * j) { | ||
| 12724 | 12870 | } |
| 12725 | 12871 | if (cJSON_HasObjectItem(j, "zindex")) { |
| 12726 | 12872 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "zindex"))) { cJSON_DeleteAxis(x); return NULL; } |
| 12873 | + if (cJSON_GetObjectItemCaseSensitive(j, "zindex")->valuedouble < 0) { cJSON_DeleteAxis(x); return NULL; } | |
| 12727 | 12874 | if (NULL != (x->zindex = cJSON_malloc(sizeof(double)))) { |
| 12728 | 12875 | *x->zindex = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "zindex")); |
| 12729 | 12876 | } |
| @@ -13704,6 +13851,8 @@ struct MarkDef * cJSON_GetMarkDefValue(const cJSON * j) { | ||
| 13704 | 13851 | } |
| 13705 | 13852 | if (cJSON_HasObjectItem(j, "angle")) { |
| 13706 | 13853 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "angle"))) { cJSON_DeleteMarkDef(x); return NULL; } |
| 13854 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble < 0) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13855 | + if (cJSON_GetObjectItemCaseSensitive(j, "angle")->valuedouble > 360) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13707 | 13856 | if (NULL != (x->angle = cJSON_malloc(sizeof(double)))) { |
| 13708 | 13857 | *x->angle = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "angle")); |
| 13709 | 13858 | } |
| @@ -13756,6 +13905,8 @@ struct MarkDef * cJSON_GetMarkDefValue(const cJSON * j) { | ||
| 13756 | 13905 | } |
| 13757 | 13906 | if (cJSON_HasObjectItem(j, "fillOpacity")) { |
| 13758 | 13907 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity"))) { cJSON_DeleteMarkDef(x); return NULL; } |
| 13908 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble < 0) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13909 | + if (cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")->valuedouble > 1) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13759 | 13910 | if (NULL != (x->fill_opacity = cJSON_malloc(sizeof(double)))) { |
| 13760 | 13911 | *x->fill_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fillOpacity")); |
| 13761 | 13912 | } |
| @@ -13766,6 +13917,7 @@ struct MarkDef * cJSON_GetMarkDefValue(const cJSON * j) { | ||
| 13766 | 13917 | } |
| 13767 | 13918 | if (cJSON_HasObjectItem(j, "fontSize")) { |
| 13768 | 13919 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "fontSize"))) { cJSON_DeleteMarkDef(x); return NULL; } |
| 13920 | + if (cJSON_GetObjectItemCaseSensitive(j, "fontSize")->valuedouble < 0) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13769 | 13921 | if (NULL != (x->font_size = cJSON_malloc(sizeof(double)))) { |
| 13770 | 13922 | *x->font_size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "fontSize")); |
| 13771 | 13923 | } |
| @@ -13801,6 +13953,8 @@ struct MarkDef * cJSON_GetMarkDefValue(const cJSON * j) { | ||
| 13801 | 13953 | } |
| 13802 | 13954 | if (cJSON_HasObjectItem(j, "opacity")) { |
| 13803 | 13955 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "opacity"))) { cJSON_DeleteMarkDef(x); return NULL; } |
| 13956 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble < 0) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13957 | + if (cJSON_GetObjectItemCaseSensitive(j, "opacity")->valuedouble > 1) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13804 | 13958 | if (NULL != (x->opacity = cJSON_malloc(sizeof(double)))) { |
| 13805 | 13959 | *x->opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "opacity")); |
| 13806 | 13960 | } |
| @@ -13814,6 +13968,7 @@ struct MarkDef * cJSON_GetMarkDefValue(const cJSON * j) { | ||
| 13814 | 13968 | } |
| 13815 | 13969 | if (cJSON_HasObjectItem(j, "radius")) { |
| 13816 | 13970 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "radius"))) { cJSON_DeleteMarkDef(x); return NULL; } |
| 13971 | + if (cJSON_GetObjectItemCaseSensitive(j, "radius")->valuedouble < 0) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13817 | 13972 | if (NULL != (x->radius = cJSON_malloc(sizeof(double)))) { |
| 13818 | 13973 | *x->radius = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "radius")); |
| 13819 | 13974 | } |
| @@ -13824,6 +13979,7 @@ struct MarkDef * cJSON_GetMarkDefValue(const cJSON * j) { | ||
| 13824 | 13979 | } |
| 13825 | 13980 | if (cJSON_HasObjectItem(j, "size")) { |
| 13826 | 13981 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "size"))) { cJSON_DeleteMarkDef(x); return NULL; } |
| 13982 | + if (cJSON_GetObjectItemCaseSensitive(j, "size")->valuedouble < 0) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13827 | 13983 | if (NULL != (x->size = cJSON_malloc(sizeof(double)))) { |
| 13828 | 13984 | *x->size = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "size")); |
| 13829 | 13985 | } |
| @@ -13856,12 +14012,15 @@ struct MarkDef * cJSON_GetMarkDefValue(const cJSON * j) { | ||
| 13856 | 14012 | } |
| 13857 | 14013 | if (cJSON_HasObjectItem(j, "strokeOpacity")) { |
| 13858 | 14014 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity"))) { cJSON_DeleteMarkDef(x); return NULL; } |
| 14015 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble < 0) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 14016 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")->valuedouble > 1) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13859 | 14017 | if (NULL != (x->stroke_opacity = cJSON_malloc(sizeof(double)))) { |
| 13860 | 14018 | *x->stroke_opacity = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeOpacity")); |
| 13861 | 14019 | } |
| 13862 | 14020 | } |
| 13863 | 14021 | if (cJSON_HasObjectItem(j, "strokeWidth")) { |
| 13864 | 14022 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth"))) { cJSON_DeleteMarkDef(x); return NULL; } |
| 14023 | + if (cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")->valuedouble < 0) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13865 | 14024 | if (NULL != (x->stroke_width = cJSON_malloc(sizeof(double)))) { |
| 13866 | 14025 | *x->stroke_width = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "strokeWidth")); |
| 13867 | 14026 | } |
| @@ -13873,6 +14032,8 @@ struct MarkDef * cJSON_GetMarkDefValue(const cJSON * j) { | ||
| 13873 | 14032 | } |
| 13874 | 14033 | if (cJSON_HasObjectItem(j, "tension")) { |
| 13875 | 14034 | if (!cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(j, "tension"))) { cJSON_DeleteMarkDef(x); return NULL; } |
| 14035 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble < 0) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 14036 | + if (cJSON_GetObjectItemCaseSensitive(j, "tension")->valuedouble > 1) { cJSON_DeleteMarkDef(x); return NULL; } | |
| 13876 | 14037 | if (NULL != (x->tension = cJSON_malloc(sizeof(double)))) { |
| 13877 | 14038 | *x->tension = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "tension")); |
| 13878 | 14039 | } |
No generated files match these filters.