Skip to content

Commit

Permalink
Merge pull request #3769 from yebblies/DDMDMOD
Browse files Browse the repository at this point in the history
[DDMD] Use explicit MOD type to avoid narrowing conversions from unsigned int
  • Loading branch information
9rnsr committed Jul 16, 2014
1 parent d616920 commit aa82feb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/cast.c
Expand Up @@ -221,7 +221,7 @@ MATCH implicitConvTo(Expression *e, Type *t)
* Returns:
* match level
*/
static MATCH implicitMod(Expression *e, Type *t, unsigned mod)
static MATCH implicitMod(Expression *e, Type *t, MOD mod)
{
Type *tprime;
if (t->ty == Tpointer)
Expand Down Expand Up @@ -774,7 +774,7 @@ MATCH implicitConvTo(Expression *e, Type *t)
/* Get mod bits of what we're converting to
*/
Type *tb = t->toBasetype();
unsigned mod = tb->mod;
MOD mod = tb->mod;
if (tf->isref)
;
else
Expand Down Expand Up @@ -1055,7 +1055,7 @@ MATCH implicitConvTo(Expression *e, Type *t)
/* Get mod bits of what we're converting to
*/
Type *tb = t->toBasetype();
unsigned mod = tb->mod;
MOD mod = tb->mod;
if (Type *ti = getIndirection(t))
mod = ti->mod;
#if LOG
Expand Down Expand Up @@ -1177,7 +1177,7 @@ MATCH implicitConvTo(Expression *e, Type *t)

struct ClassCheck
{
static bool convertible(Loc loc, ClassDeclaration *cd, unsigned mod)
static bool convertible(Loc loc, ClassDeclaration *cd, MOD mod)
{
for (size_t i = 0; i < cd->fields.dim; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/mtype.c
Expand Up @@ -1216,7 +1216,7 @@ Type *Type::addStorageClass(StorageClass stc)
{
/* Just translate to MOD bits and let addMod() do the work
*/
unsigned mod = 0;
MOD mod = 0;

if (stc & STCimmutable)
mod = MODimmutable;
Expand Down

0 comments on commit aa82feb

Please sign in to comment.