Skip to content

Commit

Permalink
Clean up semicolons and braces
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Mar 9, 2015
1 parent 50b7697 commit 615db32
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/constfold.c
Expand Up @@ -1441,7 +1441,7 @@ UnionExp Index(Type *type, Expression *e1, Expression *e2)
new(&ue) CTFEExp(TOKcantexp);
else
new(&ue) UnionExp(e);
return ue;;
return ue;
}
}
new(&ue) CTFEExp(TOKcantexp);
Expand Down
5 changes: 4 additions & 1 deletion src/doc.c
Expand Up @@ -1997,9 +1997,11 @@ size_t skiptoident(OutBuffer *buf, size_t i)

size_t oi = i;
if (utf_decodeChar((utf8_t *)buf->data, buf->offset, &i, &c))
{
/* Ignore UTF errors, but still consume input
*/
break;
}
if (c >= 0x80)
{
if (!isUniAlpha(c))
Expand All @@ -2024,9 +2026,11 @@ size_t skippastident(OutBuffer *buf, size_t i)

size_t oi = i;
if (utf_decodeChar((utf8_t *)buf->data, buf->offset, &i, &c))
{
/* Ignore UTF errors, but still consume input
*/
break;
}
if (c >= 0x80)
{
if (isUniAlpha(c))
Expand Down Expand Up @@ -2540,7 +2544,6 @@ void highlightText(Scope *sc, Dsymbol *s, OutBuffer *buf, size_t offset)
}
if (inCode)
s->error("unmatched --- in DDoc comment");
;
}

/**************************************************
Expand Down
2 changes: 2 additions & 0 deletions src/enum.c
Expand Up @@ -455,8 +455,10 @@ Dsymbol *EnumDeclaration::search(Loc loc, Identifier *ident, int flags)
{
//printf("%s.EnumDeclaration::search('%s')\n", toChars(), ident->toChars());
if (scope)
{
// Try one last time to resolve this enum
semantic(scope);
}

if (!members || !symtab || scope)
{
Expand Down
2 changes: 1 addition & 1 deletion src/hdrgen.c
Expand Up @@ -2476,7 +2476,7 @@ class PrettyPrintVisitor : public Visitor
{
for (size_t i = 0; i < e->args->dim; i++)
{
buf->writestring(", ");;
buf->writestring(", ");
objectToBuffer((*e->args)[i]);
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/inline.c
Expand Up @@ -967,7 +967,7 @@ Expression *doInline(Expression *e, InlineDoState *ids)
{
ExpInitializer *ie = vd->init->isExpInitializer();
assert(ie);
vto->init = new ExpInitializer(ie->loc, doInline(ie->exp, ids));;
vto->init = new ExpInitializer(ie->loc, doInline(ie->exp, ids));
}

are->lengthVar = vto;
Expand Down Expand Up @@ -1000,7 +1000,7 @@ Expression *doInline(Expression *e, InlineDoState *ids)
{
ExpInitializer *ie = vd->init->isExpInitializer();
assert(ie);
vto->init = new ExpInitializer(ie->loc, doInline(ie->exp, ids));;
vto->init = new ExpInitializer(ie->loc, doInline(ie->exp, ids));
}

are->lengthVar = vto;
Expand Down Expand Up @@ -1438,7 +1438,6 @@ class InlineScanVisitor : public Visitor
* of dve->e1, but this won't work if dve->e1 is
* a function call.
*/
;
}
else
{
Expand Down
2 changes: 2 additions & 0 deletions src/json.c
Expand Up @@ -114,8 +114,10 @@ class ToJsonVisitor : public Visitor
if (c < 0x20)
buf->printf("\\u%04x", c);
else
{
// Note that UTF-8 chars pass through here just fine
buf->writeByte(c);
}
break;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/link.c
Expand Up @@ -584,10 +584,12 @@ int runLINK()
for (size_t i = 0; i < global.params.linkswitches->dim; i++)
{ const char *p = (*global.params.linkswitches)[i];
if (!p || !p[0] || !(p[0] == '-' && (p[1] == 'l' || p[1] == 'L')))
{
// Don't need -Xlinker if switch starts with -l or -L.
// Eliding -Xlinker is significant for -L since it allows our paths
// to take precedence over gcc defaults.
argv.push("-Xlinker");
}
argv.push(p);
}

Expand Down Expand Up @@ -784,8 +786,10 @@ int executecmd(const char *cmd, const char *args)

status = executearg0(cmd,args);
if (status == -1)
{
// spawnlp returns intptr_t in some systems, not int
status = spawnlp(0,cmd,cmd,args,NULL);
}

// if (global.params.verbose)
// fprintf(global.stdmsg, "\n");
Expand Down
4 changes: 4 additions & 0 deletions src/mtype.c
Expand Up @@ -5305,8 +5305,10 @@ int Type::covariant(Type *t, StorageClass *pstc)
/* Can convert safe/trusted to system
*/
if (t1->trust <= TRUSTsystem && t2->trust >= TRUSTtrusted)
{
// Should we infer trusted or safe? Go with safe.
stc |= STCsafe;
}

if (stc)
{ if (pstc)
Expand Down Expand Up @@ -5466,8 +5468,10 @@ Type *TypeFunction::semantic(Loc loc, Scope *sc)
}

if ((fparam->storageClass & (STCref | STCwild)) == (STCref | STCwild))
{
// 'ref inout' implies 'return'
fparam->storageClass |= STCreturn;
}

if (fparam->storageClass & STCreturn &&
!(fparam->storageClass & (STCref | STCout)))
Expand Down
2 changes: 2 additions & 0 deletions src/optimize.c
Expand Up @@ -101,9 +101,11 @@ Expression *expandVar(int result, VarDeclaration *v)
goto L1;
}
else
{
// Should remove the copy() operation by
// making all mods to expressions copy-on-write
e = ei->copy();
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/root/stringtable.c
Expand Up @@ -62,7 +62,7 @@ static uint32_t calcHash(const char *key, size_t len)
case 2: h ^= data[1] << 8;
case 1: h ^= data[0];
h *= m;
};
}

// Do a few final mixes of the hash to ensure the last few
// bytes are well-incorporated.
Expand Down
4 changes: 3 additions & 1 deletion src/statement.c
Expand Up @@ -2740,9 +2740,11 @@ Statement *ForeachRangeStatement::semantic(Scope *sc)

Expression *increment = NULL;
if (op == TOKforeach)
{
// key += 1
//increment = new AddAssignExp(loc, new VarExp(loc, key), new IntegerExp(1));
increment = new PreExp(TOKpreplusplus, loc, new VarExp(loc, key));
}

if ((prm->storageClass & STCref) && prm->type->equals(key->type))
{
Expand Down Expand Up @@ -3159,7 +3161,7 @@ Statement *SwitchStatement::semantic(Scope *sc)
if (condition->op != TOKerror && !condition->type->isintegral())
{
error("'%s' must be of integral or string type, it is a %s", condition->toChars(), condition->type->toChars());
conditionError = true;;
conditionError = true;
}
}
condition = condition->optimize(WANTvalue);
Expand Down
2 changes: 2 additions & 0 deletions src/template.c
Expand Up @@ -6865,8 +6865,10 @@ bool TemplateInstance::findBestMatch(Scope *sc, Expressions *fargs)
else if (tovers)
error("does not match template overload set %s", tovers->toChars());
else if (tdecl && !tdecl->overnext)
{
// Only one template, so we can give better error message
error("does not match template declaration %s", tdecl->toChars());
}
else
::error(loc, "%s %s.%s does not match any template declaration",
tempdecl->kind(), tempdecl->parent->toPrettyChars(), tempdecl->ident->toChars());
Expand Down

0 comments on commit 615db32

Please sign in to comment.