• R/O
  • SSH
  • HTTPS

eirlua: コミット


コミットメタ情報

リビジョン11 (tree)
日時2018-02-09 03:35:02
作者quiret

ログメッセージ

- removed some GCC warnings

変更サマリ

差分

--- src/lbaselib.cpp (revision 10)
+++ src/lbaselib.cpp (revision 11)
@@ -266,19 +266,19 @@
266266 case LUA_GCCOUNT: {
267267 int b = lua_gc(L, LUA_GCCOUNTB, 0);
268268 lua_pushnumber(L, res + ((lua_Number)b/1024));
269-
269+
270270 returnNum = 1;
271271 break;
272272 }
273273 case LUA_GCSTEP: {
274274 lua_pushboolean(L, res);
275-
275+
276276 returnNum = 1;
277277 break;
278278 }
279279 default: {
280280 lua_pushnumber(L, res);
281-
281+
282282 returnNum = 1;
283283 break;
284284 }
@@ -649,6 +649,8 @@
649649 return CO_SUS;
650650 case THREAD_RUNNING:
651651 return CO_NOR;
652+ case THREAD_TERMINATED:
653+ return CO_DEAD;
652654 }
653655
654656 return CO_DEAD;
--- src/lclass.cpp (revision 10)
+++ src/lclass.cpp (revision 11)
@@ -549,11 +549,15 @@
549549
550550 bool Class::GetTransmit( int type, void*& entity )
551551 {
552- if ( destroyed )
553- return false;
552+ if ( destroyed )
553+ {
554+ return false;
555+ }
554556
555- if ( !trans )
556- return false;
557+ if ( !trans )
558+ {
559+ return false;
560+ }
557561
558562 for ( unsigned int n = 0; n < transCount; n++ )
559563 {
--- src/ldebug.cpp (revision 10)
+++ src/ldebug.cpp (revision 11)
@@ -440,7 +440,7 @@
440440
441441 if (getBMode(op) == OpArgR)
442442 {
443- check(b >= 0 || pc + 1 >= -b);
443+ check(b >= 0 || pc + 1 >= (size_t)-b);
444444
445445 size_t dest = pc+1+b;
446446 check(dest < pt->sizecode);
@@ -548,7 +548,7 @@
548548 /* fallthrough */
549549 case OP_JMP:
550550 {
551- check(b >= 0 || pc + 1 >= -b);
551+ check(b >= 0 || pc + 1 >= (size_t)-b);
552552
553553 size_t dest = pc + 1 + b;
554554
@@ -800,6 +800,7 @@
800800 return 0;
801801 }
802802
803+#if 0
803804 static void addinfo (lua_State *L, const char *msg)
804805 {
805806 CallInfo *ci = L->ciStack.Top();
@@ -812,8 +813,8 @@
812813 luaO_pushfstring(L, "%s:%d: %s", buff, line, msg);
813814 }
814815 }
816+#endif //0
815817
816-
817818 void luaG_errormsg (lua_State *L)
818819 {
819820 #if 0
--- src/ldo.cpp (revision 10)
+++ src/ldo.cpp (revision 11)
@@ -97,7 +97,7 @@
9797 }
9898 }
9999
100-
100+#if 0
101101 static void resetstack (lua_State *L, int status)
102102 {
103103 L->ciStack.SetTopOffset( L, 0 );
@@ -113,6 +113,7 @@
113113 }
114114 L->errfunc = 0;
115115 }
116+#endif //0
116117
117118 int luaD_rawrunprotected( lua_State *L, Pfunc f, void *ud, std::string& err, lua_Debug *debug )
118119 {
@@ -187,7 +188,9 @@
187188
188189 bool hasTopOffset = this->GetTopOffset( L, topOffset );
189190
191+#if 0
190192 lua_State *runtimeThread = this->runtimeThread;
193+#endif
191194
192195 if ( hasTopOffset )
193196 {
@@ -224,6 +227,8 @@
224227 void luaD_reallocstack (lua_State *L, stackOffset_t newsize)
225228 {
226229 StkId oldstack = L->rtStack.Base();
230+ UNUSED(oldstack);
231+
227232 stackOffset_t realsize = newsize + 1 + EXTRA_STACK;
228233
229234 L->rtStack.VerifyIntegrity( L );
@@ -343,7 +348,7 @@
343348
344349 Closure *basic_closure = clvalue(func.Pointer());
345350
346- LClosure *lcl = NULL;
351+ LClosure *lcl = basic_closure->GetLClosure();
347352 CClosure *ccl = NULL;
348353
349354 // First prepare the call stack entry.
@@ -350,7 +355,7 @@
350355 stackOffset_t newBaseOffsetAbsolute;
351356 stackOffset_t newStackTopCount = 0;
352357
353- if ( lcl = basic_closure->GetLClosure() )
358+ if ( lcl )
354359 { /* Lua function? prepare its call */
355360 Proto *p = lcl->p;
356361
@@ -367,7 +372,7 @@
367372
368373 newStackTopCount = p->maxstacksize;
369374 }
370- else if ( ccl = basic_closure->GetCClosure() )
375+ else if ( ( ccl = basic_closure->GetCClosure() ) != nullptr )
371376 {
372377 /* if it's a C function, call it */
373378 luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */
@@ -441,7 +446,7 @@
441446 }
442447 }
443448
444- StkId stackTop = ciCtx.Pointer()->stack.TopMutable( L, rtStack );
449+ //StkId stackTop = ciCtx.Pointer()->stack.TopMutable( L, rtStack );
445450
446451 stackOffset_t realArgOffset = ( funcOffsetAbsolute + 1 );
447452
--- src/lfunc.cpp (revision 10)
+++ src/lfunc.cpp (revision 11)
@@ -106,7 +106,7 @@
106106 params.nelems = 0;
107107 params.runtimeThread = L;
108108
109- CClosureMethodRedirectSuper *c = lua_new <CClosureMethodRedirectSuper> ( L, typeInfo->cclosureMethodRedirectSuperTypeInfo );
109+ CClosureMethodRedirectSuper *c = lua_new <CClosureMethodRedirectSuper> ( L, typeInfo->cclosureMethodRedirectSuperTypeInfo, &params );
110110
111111 if ( c )
112112 {
@@ -215,7 +215,7 @@
215215 params.runtimeThread = L;
216216
217217 CClosureMethod *c = lua_new <CClosureMethod> ( L, typeInfo->cclosureMethodTypeInfo, &params );
218-
218+
219219 if ( c )
220220 {
221221 c->env = e;
@@ -460,7 +460,7 @@
460460 if ( typeInfo )
461461 {
462462 uv = lua_new <UpVal> ( L, typeInfo->upvalueTypeInfo ); /* not found: create a new one */
463-
463+
464464 if ( uv )
465465 {
466466 uv->v = level; /* current value lives in the stack */
@@ -713,7 +713,7 @@
713713 global_State *g = this->gstate;
714714
715715 lua_State *L = g->mainthread;
716-
716+
717717 // Free all used resources.
718718 luaM_freearray(L, this->code, this->sizecode);
719719 luaM_freearray(L, this->p, this->sizep);
@@ -810,4 +810,4 @@
810810 {
811811 closureEnv->ClearMemory( g );
812812 }
813-}
\ No newline at end of file
813+}
--- src/lgc.cpp (revision 10)
+++ src/lgc.cpp (revision 11)
@@ -753,7 +753,8 @@
753753 {
754754 for ( gcObjList_t::iterator iter = gcEnv->rootgc.GetIterator(); !iter.IsEnd(); iter.Increment() )
755755 {
756- GCObject *theObj = (GCObject*)iter.Resolve();
756+ GCObject *theObj = (GCObject*)iter.Resolve();
757+ (void)theObj;
757758
758759 // Investigate the object.
759760 assert( 0 );
旧リポジトリブラウザで表示