Skip to content

Commit

Permalink
Add missing default cases to some switches
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed May 2, 2013
1 parent 2c5df8d commit f25c7e4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/cast.c
Expand Up @@ -2744,6 +2744,8 @@ Expression *Expression::integralPromotions(Scope *sc)
case Tdchar:
e = e->castTo(sc, Type::tuns32);
break;
default:
break;
}
return e;
}
Expand Down
2 changes: 2 additions & 0 deletions src/lexer.c
Expand Up @@ -903,6 +903,8 @@ void Lexer::scan(Token *t)
}
continue;
}
default:
break;
}
t->value = TOKdiv;
return;
Expand Down
9 changes: 8 additions & 1 deletion src/mtype.c
Expand Up @@ -3116,8 +3116,9 @@ int TypeBasic::isZeroInit(Loc loc)
case Tcomplex64:
case Tcomplex80:
return 0; // no
default:
return 1; // yes
}
return 1; // yes
}

int TypeBasic::isintegral()
Expand Down Expand Up @@ -3816,6 +3817,8 @@ Type *TypeSArray::semantic(Loc loc, Scope *sc)
case Tnone:
error(loc, "can't have array of %s", tbn->toChars());
goto Lerror;
default:
break;
}
if (tbn->isscope())
{ error(loc, "cannot have array of scope %s", tbn->toChars());
Expand Down Expand Up @@ -4101,6 +4104,8 @@ Type *TypeDArray::semantic(Loc loc, Scope *sc)
error(loc, "can't have array of %s", tbn->toChars());
case Terror:
return Type::terror;
default:
break;
}
if (tn->isscope())
{ error(loc, "cannot have array of scope %s", tn->toChars());
Expand Down Expand Up @@ -4727,6 +4732,8 @@ Type *TypePointer::semantic(Loc loc, Scope *sc)
error(loc, "can't have pointer to %s", n->toChars());
case Terror:
return Type::terror;
default:
break;
}
if (n != next)
{
Expand Down
2 changes: 2 additions & 0 deletions src/parse.c
Expand Up @@ -6424,6 +6424,8 @@ Expression *Parser::parseUnaryExp()
}
return e;
}
default:
break;
}
}
#endif
Expand Down

0 comments on commit f25c7e4

Please sign in to comment.