From b59b0e0253182d450bdd9293d9210ec2cfb216d7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 27 Feb 2015 09:05:04 +0000 Subject: [PATCH] Fixed Windows warnings git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14737 16af8721-9629-0410-8352-f15c8da7e697 --- src/osgPlugins/lua/lua-5.2.3/src/ldo.c | 8 ++++---- src/osgPlugins/lua/lua-5.2.3/src/lgc.c | 6 +++--- src/osgPlugins/lua/lua-5.2.3/src/lparser.c | 14 +++++++------- src/osgPlugins/lua/lua-5.2.3/src/lstrlib.c | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/osgPlugins/lua/lua-5.2.3/src/ldo.c b/src/osgPlugins/lua/lua-5.2.3/src/ldo.c index e9dd5fa95..3524b76a9 100644 --- a/src/osgPlugins/lua/lua-5.2.3/src/ldo.c +++ b/src/osgPlugins/lua/lua-5.2.3/src/ldo.c @@ -307,7 +307,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { Cfunc: luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ ci = next_ci(L); /* now 'enter' new function */ - ci->nresults = nresults; + ci->nresults = (short)nresults; ci->func = restorestack(L, funcr); ci->top = L->top + LUA_MINSTACK; lua_assert(ci->top <= L->stack_last); @@ -338,7 +338,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { func = restorestack(L, funcr); /* previous call can change stack */ } ci = next_ci(L); /* now 'enter' new function */ - ci->nresults = nresults; + ci->nresults = (short)nresults; ci->func = func; ci->u.l.base = base; ci->top = base + p->maxstacksize; @@ -472,7 +472,7 @@ static int recover (lua_State *L, int status) { luaD_shrinkstack(L); L->errfunc = ci->u.c.old_errfunc; ci->callstatus |= CIST_STAT; /* call has error status */ - ci->u.c.status = status; /* (here it is) */ + ci->u.c.status = (lu_byte)status; /* (here it is) */ return 1; /* continue running the coroutine */ } @@ -556,7 +556,7 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs) { } lua_assert(status == L->status); } - L->nny = oldnny; /* restore 'nny' */ + L->nny = (unsigned short)oldnny; /* restore 'nny' */ L->nCcalls--; lua_assert(L->nCcalls == ((from) ? from->nCcalls : 0)); lua_unlock(L); diff --git a/src/osgPlugins/lua/lua-5.2.3/src/lgc.c b/src/osgPlugins/lua/lua-5.2.3/src/lgc.c index 52460dcdd..7c33e2462 100644 --- a/src/osgPlugins/lua/lua-5.2.3/src/lgc.c +++ b/src/osgPlugins/lua/lua-5.2.3/src/lgc.c @@ -217,7 +217,7 @@ GCObject *luaC_newobj (lua_State *L, int tt, size_t sz, GCObject **list, if (list == NULL) list = &g->allgc; /* standard list for collectable objects */ gch(o)->marked = luaC_white(g); - gch(o)->tt = tt; + gch(o)->tt = (lu_byte)tt; gch(o)->next = *list; *list = o; return o; @@ -823,7 +823,7 @@ static void GCTM (lua_State *L, int propagateerrors) { L->top += 2; /* and (next line) call the finalizer */ status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top - 2), 0); L->allowhook = oldah; /* restore hooks */ - g->gcrunning = running; /* restore state */ + g->gcrunning = (lu_byte)running; /* restore state */ if (status != LUA_OK && propagateerrors) { /* error while running __gc? */ if (status == LUA_ERRRUN) { /* is there an error object? */ const char *msg = (ttisstring(L->top - 1)) @@ -1209,7 +1209,7 @@ void luaC_fullgc (lua_State *L, int isemergency) { /* generational mode must be kept in propagate phase */ luaC_runtilstate(L, bitmask(GCSpropagate)); } - g->gckind = origkind; + g->gckind = (lu_byte)origkind; setpause(g, gettotalbytes(g)); if (!isemergency) /* do not run finalizers during emergency GC */ callallpendingfinalizers(L, 1); diff --git a/src/osgPlugins/lua/lua-5.2.3/src/lparser.c b/src/osgPlugins/lua/lua-5.2.3/src/lparser.c index 9e1a9ca2c..0f062bcb5 100644 --- a/src/osgPlugins/lua/lua-5.2.3/src/lparser.c +++ b/src/osgPlugins/lua/lua-5.2.3/src/lparser.c @@ -438,8 +438,8 @@ static void movegotosout (FuncState *fs, BlockCnt *bl) { static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isloop) { bl->isloop = isloop; bl->nactvar = fs->nactvar; - bl->firstlabel = fs->ls->dyd->label.n; - bl->firstgoto = fs->ls->dyd->gt.n; + bl->firstlabel = (short)fs->ls->dyd->label.n; + bl->firstgoto = (short)fs->ls->dyd->gt.n; bl->upval = 0; bl->previous = fs->bl; fs->bl = bl; @@ -666,7 +666,7 @@ static void recfield (LexState *ls, struct ConsControl *cc) { rkkey = luaK_exp2RK(fs, &key); expr(ls, &val); luaK_codeABC(fs, OP_SETTABLE, cc->t->u.info, rkkey, luaK_exp2RK(fs, &val)); - fs->freereg = reg; /* free registers */ + fs->freereg = (lu_byte)reg; /* free registers */ } @@ -860,7 +860,7 @@ static void funcargs (LexState *ls, expdesc *f, int line) { } init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); luaK_fixline(fs, line); - fs->freereg = base+1; /* call remove function and arguments and leaves + fs->freereg = (lu_byte)(base + 1); /* call remove function and arguments and leaves (unless changed) one result */ } @@ -1115,12 +1115,12 @@ static void check_conflict (LexState *ls, struct LHS_assign *lh, expdesc *v) { if (lh->v.u.ind.vt == v->k && lh->v.u.ind.t == v->u.info) { conflict = 1; lh->v.u.ind.vt = VLOCAL; - lh->v.u.ind.t = extra; /* previous assignment will use safe copy */ + lh->v.u.ind.t = (lu_byte)extra; /* previous assignment will use safe copy */ } /* index is the local being assigned? (index cannot be upvalue) */ if (v->k == VLOCAL && lh->v.u.ind.idx == v->u.info) { conflict = 1; - lh->v.u.ind.idx = extra; /* previous assignment will use safe copy */ + lh->v.u.ind.idx = (short)extra; /* previous assignment will use safe copy */ } } } @@ -1153,7 +1153,7 @@ static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) { if (nexps != nvars) { adjust_assign(ls, nvars, nexps, &e); if (nexps > nvars) - ls->fs->freereg -= nexps - nvars; /* remove extra values */ + ls->fs->freereg -= (lu_byte)(nexps - nvars); /* remove extra values */ } else { luaK_setoneret(ls->fs, &e); /* close last expression */ diff --git a/src/osgPlugins/lua/lua-5.2.3/src/lstrlib.c b/src/osgPlugins/lua/lua-5.2.3/src/lstrlib.c index 9261fd220..55299e08c 100644 --- a/src/osgPlugins/lua/lua-5.2.3/src/lstrlib.c +++ b/src/osgPlugins/lua/lua-5.2.3/src/lstrlib.c @@ -83,7 +83,7 @@ static int str_lower (lua_State *L) { const char *s = luaL_checklstring(L, 1, &l); char *p = luaL_buffinitsize(L, &b, l); for (i=0; i