diff options
author | Mike Pall <mike> | 2011-03-10 02:13:43 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2011-03-10 02:13:43 +0100 |
commit | 889368e921a11e2abb3769e2c1f395174e83112d (patch) | |
tree | a0280bec2142380ce13b1afc2d8e17fcd65e29e9 /src/lj_gc.c | |
parent | bfce3c1127fd57fe0c935c92bcf45b4737041edd (diff) | |
download | luajit2-889368e921a11e2abb3769e2c1f395174e83112d.tar.gz |
Get rid of the remaining silly cast macros from Lua.
Diffstat (limited to 'src/lj_gc.c')
-rw-r--r-- | src/lj_gc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lj_gc.c b/src/lj_gc.c index f231b1ce..bc6d843a 100644 --- a/src/lj_gc.c +++ b/src/lj_gc.c @@ -32,11 +32,11 @@ #define GCFINALIZECOST 100 /* Macros to set GCobj colors and flags. */ -#define white2gray(x) ((x)->gch.marked &= cast_byte(~LJ_GC_WHITES)) -#define black2gray(x) ((x)->gch.marked &= cast_byte(~LJ_GC_BLACK)) +#define white2gray(x) ((x)->gch.marked &= (uint8_t)~LJ_GC_WHITES) +#define black2gray(x) ((x)->gch.marked &= (uint8_t)~LJ_GC_BLACK) #define gray2black(x) ((x)->gch.marked |= LJ_GC_BLACK) #define makewhite(g, x) \ - ((x)->gch.marked = ((x)->gch.marked & cast_byte(~LJ_GC_COLORS)) | curwhite(g)) + ((x)->gch.marked = ((x)->gch.marked & (uint8_t)~LJ_GC_COLORS) | curwhite(g)) #define isfinalized(u) ((u)->marked & LJ_GC_FINALIZED) #define markfinalized(u) ((u)->marked |= LJ_GC_FINALIZED) @@ -52,7 +52,7 @@ { if (iswhite(obj2gco(o))) gc_mark(g, obj2gco(o)); } /* Mark a string object. */ -#define gc_mark_str(s) ((s)->marked &= cast_byte(~LJ_GC_WHITES)) +#define gc_mark_str(s) ((s)->marked &= (uint8_t)~LJ_GC_WHITES) /* Mark a white GCobj. */ static void gc_mark(global_State *g, GCobj *o) @@ -174,7 +174,7 @@ static int gc_traverse_tab(global_State *g, GCtab *t) else if (c == 'K') weak = (int)(~0u & ~LJ_GC_WEAKVAL); } if (weak > 0) { /* Weak tables are cleared in the atomic phase. */ - t->marked = cast_byte((t->marked & ~LJ_GC_WEAK) | weak); + t->marked = (uint8_t)((t->marked & ~LJ_GC_WEAK) | weak); setgcrefr(t->gclist, g->gc.weak); setgcref(g->gc.weak, obj2gco(t)); } @@ -594,7 +594,7 @@ static void atomic(global_State *g, lua_State *L) gc_clearweak(gcref(g->gc.weak)); /* Prepare for sweep phase. */ - g->gc.currentwhite = cast_byte(otherwhite(g)); /* Flip current white. */ + g->gc.currentwhite = (uint8_t)otherwhite(g); /* Flip current white. */ g->strempty.marked = g->gc.currentwhite; setmref(g->gc.sweep, &g->gc.root); g->gc.estimate = g->gc.total - (MSize)udsize; /* Initial estimate. */ @@ -772,7 +772,7 @@ void LJ_FASTCALL lj_gc_barrieruv(global_State *g, TValue *tv) if (g->gc.state == GCSpropagate || g->gc.state == GCSatomic) gc_mark(g, gcV(tv)); else - TV2MARKED(tv) = (TV2MARKED(tv) & cast_byte(~LJ_GC_COLORS)) | curwhite(g); + TV2MARKED(tv) = (TV2MARKED(tv) & (uint8_t)~LJ_GC_COLORS) | curwhite(g); #undef TV2MARKED } |