diff --git a/extensions/cocostudio/CCSSceneReader.cpp b/extensions/cocostudio/CCSSceneReader.cpp index bc9ef36809..834008a434 100644 --- a/extensions/cocostudio/CCSSceneReader.cpp +++ b/extensions/cocostudio/CCSSceneReader.cpp @@ -355,13 +355,9 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par cocos2d::Node* SceneReader::createObject(CocoLoader *cocoLoader, stExpCocoNode *cocoNode, cocos2d::Node* parent, AttachComponentType attachComponent) { - const char *className = nullptr; stExpCocoNode *pNodeArray = cocoNode->GetChildArray(cocoLoader); std::string Key = pNodeArray[1].GetName(cocoLoader); - if (Key == "classname") - { - className = pNodeArray[1].GetValue(cocoLoader); - } + const char *className = Key == "classname" ? pNodeArray[1].GetValue(cocoLoader) : ""; if(strcmp(className, "CCNode") == 0) { Node* gb = nullptr; diff --git a/extensions/cocostudio/TriggerBase.cpp b/extensions/cocostudio/TriggerBase.cpp index ec031f2378..4338a47f77 100644 --- a/extensions/cocostudio/TriggerBase.cpp +++ b/extensions/cocostudio/TriggerBase.cpp @@ -1,7 +1,8 @@ /**************************************************************************** Copyright (c) 2013-2017 Chukong Technologies Inc. +Copyright (c) 2021 Bytedance Inc. -http://www.cocos2d-x.org + https://adxe.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -31,7 +32,7 @@ using namespace cocostudio; void sendEvent(unsigned int event) { char buf[10]; - sprintf(buf, "%d", event); + sprintf(buf, "%u", event); std::string custom_event_name(buf); EventCustom eventCustom(custom_event_name); diff --git a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp index 48d32815de..a064a1b4c8 100644 --- a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp +++ b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp @@ -867,8 +867,6 @@ bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue , c if (NULL == L || NULL == outValue) return false; - bool ok = true; - tolua_Error tolua_err; bool ok = !!tolua_istable(L, lo, 0, &tolua_err); if (ok)