!171 修复id溢出为负数的问题

Merge pull request !171 from liduo/id_bugfix
This commit is contained in:
openharmony_ci
2024-08-27 13:51:49 +00:00
committed by Gitee
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;
}