Replace NULL by nullptr

This commit is contained in:
Bertrand Songis
2019-08-28 10:28:11 +02:00
parent c8482905a0
commit e7736f3fdc
28 changed files with 66 additions and 85 deletions
+5 -5
View File
@@ -137,7 +137,7 @@ LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) {
LUA_API const lua_Number *lua_version (lua_State *L) {
static const lua_Number version = LUA_VERSION_NUM;
if (L == NULL) return &version;
if (L == nullptr) return &version;
else return G(L)->version;
}
@@ -392,15 +392,15 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
if (!ttisstring(o)) {
lua_lock(L); /* `luaV_tostring' may create a new string */
if (!luaV_tostring(L, o)) { /* conversion failed? */
if (len != NULL) *len = 0;
if (len != nullptr) *len = 0;
lua_unlock(L);
return NULL;
return nullptr;
}
luaC_checkGC(L);
o = index2addr(L, idx); /* previous call may reallocate the stack */
lua_unlock(L);
}
if (len != NULL) *len = tsvalue(o)->len;
if (len != nullptr) *len = tsvalue(o)->len;
return svalue(o);
}
@@ -421,7 +421,7 @@ LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) {
if (ttislcf(o)) return lcfvalue(o);
else if (ttisCclosure(o))
return clCvalue(o)->f;
else return NULL; /* not a C function */
else return nullptr; /* not a C function */
}
+1 -1
View File
@@ -142,7 +142,7 @@ static const luaL_Reg co_funcs[] = {
{"status", luaB_costatus},
{"wrap", luaB_cowrap},
{"yield", luaB_yield},
{NULL, NULL}
{nullptr, nullptr}
};
+2 -2
View File
@@ -160,7 +160,7 @@ void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source,
ls->current = firstchar;
ls->lookahead.token = TK_EOS; /* no look-ahead token */
ls->z = z;
ls->fs = NULL;
ls->fs = nullptr;
ls->linenumber = 1;
ls->lastline = 1;
ls->source = source;
@@ -416,7 +416,7 @@ static int llex (LexState *ls, SemInfo *seminfo) {
int sep = skip_sep(ls);
luaZ_resetbuffer(ls->buff); /* `skip_sep' may dirty the buffer */
if (sep >= 0) {
read_long_string(ls, NULL, sep); /* skip long comment */
read_long_string(ls, nullptr, sep); /* skip long comment */
luaZ_resetbuffer(ls->buff); /* previous call may dirty the buff. */
break;
}