Skip to content

Commit 3c08471

Browse files
JohnCoconutminggo
authored andcommitted
don't convert const char* to char* (#20039)
* C++ forbids conversion from const char* string to char*, so we change function signature from char* to const char* in lua basic conversion functions.
1 parent a8d0702 commit 3c08471

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3286,7 +3286,7 @@ void node_to_luaval(lua_State* L, const char* type, cocos2d::Node* node)
32863286
}
32873287

32883288

3289-
bool luaval_to_vertexLayout(lua_State* L, int pos, cocos2d::backend::VertexLayout& outLayout, char *message)
3289+
bool luaval_to_vertexLayout(lua_State* L, int pos, cocos2d::backend::VertexLayout& outLayout, const char *message)
32903290
{
32913291
if (L == nullptr)
32923292
return false;
@@ -3302,7 +3302,7 @@ bool luaval_to_vertexLayout(lua_State* L, int pos, cocos2d::backend::VertexLayou
33023302
}
33033303

33043304

3305-
bool luaval_to_samplerDescriptor(lua_State* L, int pos, cocos2d::backend::SamplerDescriptor& output, char *message)
3305+
bool luaval_to_samplerDescriptor(lua_State* L, int pos, cocos2d::backend::SamplerDescriptor& output, const char *message)
33063306
{
33073307
if (L == nullptr)
33083308
return false;
@@ -3342,7 +3342,7 @@ bool luaval_to_samplerDescriptor(lua_State* L, int pos, cocos2d::backend::Sample
33423342
return true;
33433343
}
33443344

3345-
bool luaval_to_uniformLocation(lua_State* L, int pos, cocos2d::backend::UniformLocation& loc, char *message)
3345+
bool luaval_to_uniformLocation(lua_State* L, int pos, cocos2d::backend::UniformLocation& loc, const char *message)
33463346
{
33473347
if (L == nullptr)
33483348
return false;

cocos/scripting/lua-bindings/manual/LuaBasicConversions.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,17 +1286,17 @@ CC_LUA_DLL extern void node_to_luaval(lua_State* L, const char* type, cocos2d::N
12861286
/**
12871287
* convert lua object VertexLayout to native object
12881288
*/
1289-
CC_LUA_DLL bool luaval_to_vertexLayout(lua_State* L, int pos, cocos2d::backend::VertexLayout& outLayout, char *message);
1289+
CC_LUA_DLL bool luaval_to_vertexLayout(lua_State* L, int pos, cocos2d::backend::VertexLayout& outLayout, const char *message);
12901290

12911291
/**
12921292
* convert lua object SamplerDescriptor to native object
12931293
*/
1294-
CC_LUA_DLL bool luaval_to_samplerDescriptor(lua_State* L, int pos, cocos2d::backend::SamplerDescriptor& desc, char *message);
1294+
CC_LUA_DLL bool luaval_to_samplerDescriptor(lua_State* L, int pos, cocos2d::backend::SamplerDescriptor& desc, const char *message);
12951295

12961296
/**
12971297
* convert lua object to cocos2d::backend::UniformLocation
12981298
*/
1299-
CC_LUA_DLL bool luaval_to_uniformLocation(lua_State* L, int pos, cocos2d::backend::UniformLocation& desc, char *message);
1299+
CC_LUA_DLL bool luaval_to_uniformLocation(lua_State* L, int pos, cocos2d::backend::UniformLocation& desc, const char *message);
13001300

13011301
/**
13021302
* convert cocos2d::backend::UniformLocation to lua object

0 commit comments

Comments
 (0)