@@ -226,7 +226,7 @@ TStatus lua_State::rawRunProtected(Pfunc f, void *ud) {
226226 lj.status = ex.status ();
227227 }
228228 catch (...) { /* non-Lua exception */
229- lj.status = cast ( TStatus, -1 ); /* create some error code */
229+ lj.status = static_cast < TStatus>( -1 ); /* create some error code */
230230 }
231231
232232 setErrorJmp (lj.previous ); /* restore old error handler */
@@ -717,12 +717,12 @@ void lua_State::callNoYield(StkId func, int nResults) {
717717*/
718718// Convert to private lua_State method
719719TStatus lua_State::finishPCallK (CallInfo *ci_arg) {
720- TStatus status_val = cast ( TStatus, ci_arg->getRecoverStatus ()); /* get original status */
720+ TStatus status_val = static_cast < TStatus>( ci_arg->getRecoverStatus ()); /* get original status */
721721 if (l_likely (status_val == LUA_OK)) /* no error? */
722722 status_val = LUA_YIELD; /* was interrupted by an yield */
723723 else { /* error */
724724 StkId func = this ->restoreStack (ci_arg->getFuncIdx ());
725- setAllowHook (cast ( lu_byte, ci_arg->getOAH ())); /* restore 'allowhook' */
725+ setAllowHook (static_cast < lu_byte>( ci_arg->getOAH ())); /* restore 'allowhook' */
726726 func = luaF_close (this , func, status_val, 1 ); /* can yield or raise an error */
727727 setErrorObj (status_val, func);
728728 shrinkStack (); /* restore stack size in case of overflow */
@@ -840,7 +840,7 @@ static int resume_error (lua_State *L, const char *msg, int narg) {
840840** coroutine.
841841*/
842842static void resume (lua_State *L, void *ud) {
843- int n = *( cast ( int *, ud) ); /* number of arguments */
843+ int n = *static_cast < int *>(ud ); /* number of arguments */
844844 StkId firstArg = L->getTop ().p - n; /* first argument */
845845 CallInfo *ci = L->getCI ();
846846 if (L->getStatus () == LUA_OK) /* starting a coroutine? */
@@ -973,7 +973,7 @@ struct CloseP {
973973** Auxiliary function to call 'luaF_close' in protected mode.
974974*/
975975static void closepaux (lua_State *L, void *ud) {
976- struct CloseP *pcl = cast ( struct CloseP *, ud);
976+ CloseP *pcl = static_cast < CloseP*>( ud);
977977 luaF_close (L, pcl->level , pcl->status , 0 );
978978}
979979
@@ -1054,7 +1054,7 @@ static void checkmode (lua_State *L, const char *mode, const char *x) {
10541054
10551055static void f_parser (lua_State *L, void *ud) {
10561056 LClosure *cl;
1057- struct SParser *p = cast ( struct SParser *, ud);
1057+ SParser *p = static_cast < SParser*>( ud);
10581058 const char *mode = p->mode ? p->mode : " bt" ;
10591059 int c = zgetc (p->z ); /* read first character */
10601060 if (c == LUA_SIGNATURE[0 ]) {
0 commit comments