Fixed Windows warnings

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14737 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2015-02-27 09:05:04 +00:00
parent d03b38dea8
commit b59b0e0253
4 changed files with 16 additions and 16 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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 */

View File

@@ -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<l; i++)
p[i] = tolower(uchar(s[i]));
p[i] = (char)(tolower(uchar(s[i])));
luaL_pushresultsize(&b, l);
return 1;
}
@@ -96,7 +96,7 @@ static int str_upper (lua_State *L) {
const char *s = luaL_checklstring(L, 1, &l);
char *p = luaL_buffinitsize(L, &b, l);
for (i=0; i<l; i++)
p[i] = toupper(uchar(s[i]));
p[i] = (char)(toupper(uchar(s[i])));
luaL_pushresultsize(&b, l);
return 1;
}