fix id overflow

Signed-off-by: liduo <liduo29@huawei.com>
This commit is contained in:
liduo
2024-08-27 15:25:23 +08:00
parent 0ac90b8049
commit 3e97160a2b
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -91,8 +91,8 @@ private:
std::string moduleName_;
ModuleType moduleType_;
std::string mainAbility_;
int32_t abilityIconId_;
int32_t abilityLabelId_;
int64_t abilityIconId_;
int64_t abilityLabelId_;
std::map<std::string, std::set<uint32_t>> jsonCheckIds_;
static const std::map<std::string, ModuleType> MODULE_TYPES;
static const std::map<std::string, std::string> JSON_STRING_IDS;
+3 -3
View File
@@ -379,7 +379,7 @@ bool ConfigParser::ParseJsonArrayRef(cJSON *parent, const string &key, cJSON *no
return false;
}
if (update) {
cJSON_AddItemToArray(array, cJSON_CreateNumber(atoi(value.c_str())));
cJSON_AddItemToArray(array, cJSON_CreateNumber(atoll(value.c_str())));
}
}
cJSON_AddItemToObject(parent, (key + "Id").c_str(), array);
@@ -407,8 +407,8 @@ bool ConfigParser::ParseJsonStringRef(cJSON *parent, const string &key, cJSON *n
return false;
}
if (update) {
cJSON_AddItemToObject(parent, (key + "Id").c_str(), cJSON_CreateNumber(atoi(value.c_str())));
AddCheckNode(key, static_cast<uint32_t>(atoi(value.c_str())));
cJSON_AddItemToObject(parent, (key + "Id").c_str(), cJSON_CreateNumber(atoll(value.c_str())));
AddCheckNode(key, static_cast<uint32_t>(atoll(value.c_str())));
}
return true;
}