forked from mirror/OpenTTD
Codechange: remove manual param count; in all cases strlen(params) == nparams
This commit is contained in:
@@ -464,8 +464,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
|
||||
foreach(STATIC_METHOD IN LISTS STATIC_METHODS)
|
||||
string(REPLACE ":" ";" STATIC_METHOD "${STATIC_METHOD}")
|
||||
list(GET STATIC_METHOD 0 FUNCNAME)
|
||||
list(GET STATIC_METHOD 1 ARGC)
|
||||
list(GET STATIC_METHOD 2 TYPES)
|
||||
list(GET STATIC_METHOD 1 TYPES)
|
||||
string(LENGTH "${FUNCNAME}" LEN)
|
||||
math(EXPR LEN "${MLEN} - ${LEN}")
|
||||
if("${TYPES}" STREQUAL "v")
|
||||
@@ -482,7 +481,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
|
||||
if("${TYPES}" STREQUAL "v")
|
||||
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQAdvancedStaticMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\");")
|
||||
else()
|
||||
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQStaticMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}${ARGC}, \"${TYPES}\");")
|
||||
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQStaticMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}\"${TYPES}\");")
|
||||
endif()
|
||||
endforeach()
|
||||
if(MLEN)
|
||||
@@ -502,8 +501,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
|
||||
foreach(METHOD IN LISTS METHODS)
|
||||
string(REPLACE ":" ";" METHOD "${METHOD}")
|
||||
list(GET METHOD 0 FUNCNAME)
|
||||
list(GET METHOD 1 ARGC)
|
||||
list(GET METHOD 2 TYPES)
|
||||
list(GET METHOD 1 TYPES)
|
||||
string(LENGTH "${FUNCNAME}" LEN)
|
||||
math(EXPR LEN "${MLEN} - ${LEN}")
|
||||
if("${TYPES}" STREQUAL "v")
|
||||
@@ -520,7 +518,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
|
||||
if("${TYPES}" STREQUAL "v")
|
||||
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQAdvancedMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\");")
|
||||
else()
|
||||
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}${ARGC}, \"${TYPES}\");")
|
||||
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}\"${TYPES}\");")
|
||||
endif()
|
||||
endforeach()
|
||||
if(MLEN)
|
||||
@@ -687,9 +685,9 @@ foreach(LINE IN LISTS SOURCE_LINES)
|
||||
set(CLS_PARAM_2 "${TYPES}")
|
||||
elseif("${FUNCNAME}" MATCHES "^_" AND NOT "${TYPES}" STREQUAL "v")
|
||||
elseif(IS_STATIC)
|
||||
list(APPEND STATIC_METHODS "${FUNCNAME}:${LEN}:${TYPES}")
|
||||
list(APPEND STATIC_METHODS "${FUNCNAME}:${TYPES}")
|
||||
else()
|
||||
list(APPEND METHODS "${FUNCNAME}:${LEN}:${TYPES}")
|
||||
list(APPEND METHODS "${FUNCNAME}:${TYPES}")
|
||||
endif()
|
||||
continue()
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user