Feature #2286 ยป 0071-scripting-Replace-NULL-with-nullptr.patch
| server/scripting/api_fcdb_auth.c | ||
|---|---|---|
|
**************************************************************************/
|
||
|
const char *api_auth_get_username(lua_State *L, Connection *pconn)
|
||
|
{
|
||
|
LUASCRIPT_CHECK_STATE(L, NULL);
|
||
|
LUASCRIPT_CHECK_SELF(L, pconn, NULL);
|
||
|
fc_assert_ret_val(conn_is_valid(pconn), NULL);
|
||
|
LUASCRIPT_CHECK_STATE(L, nullptr);
|
||
|
LUASCRIPT_CHECK_SELF(L, pconn, nullptr);
|
||
|
fc_assert_ret_val(conn_is_valid(pconn), nullptr);
|
||
|
return auth_get_username(pconn);
|
||
|
}
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
const char *api_auth_get_ipaddr(lua_State *L, Connection *pconn)
|
||
|
{
|
||
|
LUASCRIPT_CHECK_STATE(L, NULL);
|
||
|
LUASCRIPT_CHECK_SELF(L, pconn, NULL);
|
||
|
fc_assert_ret_val(conn_is_valid(pconn), NULL);
|
||
|
LUASCRIPT_CHECK_STATE(L, nullptr);
|
||
|
LUASCRIPT_CHECK_SELF(L, pconn, nullptr);
|
||
|
fc_assert_ret_val(conn_is_valid(pconn), nullptr);
|
||
|
return auth_get_ipaddr(pconn);
|
||
|
}
|
||
| server/scripting/api_fcdb_base.c | ||
|---|---|---|
|
**************************************************************************/
|
||
|
const char *api_fcdb_option(lua_State *L, const char *type)
|
||
|
{
|
||
|
LUASCRIPT_CHECK_STATE(L, NULL);
|
||
|
LUASCRIPT_CHECK_ARG_NIL(L, type, 2, string, NULL);
|
||
|
LUASCRIPT_CHECK_STATE(L, nullptr);
|
||
|
LUASCRIPT_CHECK_ARG_NIL(L, type, 2, string, nullptr);
|
||
|
if (!fc_strncasecmp(OPTION_DEPR_PREFIX, type,
|
||
|
strlen(OPTION_DEPR_PREFIX))) {
|
||
| server/scripting/api_server_base.c | ||
|---|---|---|
|
LUASCRIPT_CHECK_STATE(L, FALSE);
|
||
|
/* Limit the allowed characters in the filename. */
|
||
|
if (filename != NULL && !is_safe_filename(filename)) {
|
||
|
if (filename != nullptr && !is_safe_filename(filename)) {
|
||
|
return FALSE;
|
||
|
}
|
||
| ... | ... | |
|
}
|
||
|
/**********************************************************************//**
|
||
|
Return the formatted value of the setting or NULL if no such setting
|
||
|
exists.
|
||
|
Return the formatted value of the setting or nullptr if no such
|
||
|
setting exists.
|
||
|
**************************************************************************/
|
||
|
const char *api_server_setting_get(lua_State *L, const char *sett_name)
|
||
|
{
|
||
|
struct setting *pset;
|
||
|
static char buf[512];
|
||
|
LUASCRIPT_CHECK_STATE(L, NULL);
|
||
|
LUASCRIPT_CHECK_ARG_NIL(L, sett_name, 2, API_TYPE_STRING, NULL);
|
||
|
LUASCRIPT_CHECK_STATE(L, nullptr);
|
||
|
LUASCRIPT_CHECK_ARG_NIL(L, sett_name, 2, API_TYPE_STRING, nullptr);
|
||
|
pset = setting_by_name(sett_name);
|
||
|
if (!pset) {
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
return setting_value_name(pset, FALSE, buf, sizeof(buf));
|
||
| server/scripting/api_server_luadata.c | ||
|---|---|---|
|
**************************************************************************/
|
||
|
const char *api_luadata_get_str(lua_State *L, const char *field)
|
||
|
{
|
||
|
LUASCRIPT_CHECK_STATE(L, NULL);
|
||
|
LUASCRIPT_CHECK_STATE(L, nullptr);
|
||
|
if (game.server.luadata == NULL) {
|
||
|
return NULL;
|
||
|
if (game.server.luadata == nullptr) {
|
||
|
return nullptr;
|
||
|
}
|
||
|
return secfile_lookup_str_default(game.server.luadata, NULL, "%s", field);
|
||
|
return secfile_lookup_str_default(game.server.luadata, nullptr,
|
||
|
"%s", field);
|
||
|
}
|
||
| server/scripting/api_server_notify.c | ||
|---|---|---|
|
pres = research_get(pplayer);
|
||
|
notify_research(pres, include_plr ? NULL : pplayer, event,
|
||
|
notify_research(pres, include_plr ? nullptr : pplayer, event,
|
||
|
ftc_any, "%s", message);
|
||
|
}
|
||
| ... | ... | |
|
pres = research_get(pplayer);
|
||
|
notify_research_embassies(pres, NULL, event, ftc_any, "%s", message);
|
||
|
notify_research_embassies(pres, nullptr, event, ftc_any, "%s", message);
|
||
|
}
|
||
| server/scripting/tolua_server.pkg | ||
|---|---|---|
|
*****************************************************************************/
|
||
|
/*****************************************************************************
|
||
|
ADVERTISEMENT: do not attempt to change the name of the API functions.
|
||
|
ADVERTISEMENT: Do not attempt to change the name of the API functions.
|
||
|
They may be in use in Lua scripts in savefiles, so once released, the
|
||
|
name and signature cannot change shape even in new major versions of
|
||
|
Freeciv, until the relevant save format version can no longer be loaded.
|
||
| ... | ... | |
|
void api_edit_player_give_bulbs
|
||
|
@ give_bulbs(lua_State *L, Player *self, int amount,
|
||
|
Tech_Type *tech = NULL);
|
||
|
Tech_Type *tech = nullptr);
|
||
|
bool api_edit_create_trade_route
|
||
|
@ create_trade_route(lua_State *L, City *from, City *to);
|
||
| ... | ... | |
|
int api_methods_player_trait_current_mod
|
||
|
@ trait_current_mod (lua_State *L, Player *pplayer, const char *tname);
|
||
|
void api_methods_player_lose
|
||
|
@ lose (lua_State *L, Player *pplayer, Player *looter = NULL);
|
||
|
@ lose (lua_State *L, Player *pplayer, Player *looter = nullptr);
|
||
|
int api_methods_player_tech_bulbs
|
||
|
@ bulbs_saved (lua_State *L, Player *pplayer, Tech_Type *tech);
|
||