From 6ed4aa1b6344055c9961bea27b92e1a1761c11f6 Mon Sep 17 00:00:00 2001 From: Joseph Poirier Date: Mon, 22 Jun 2015 14:16:49 -0500 Subject: [PATCH] formatting --- debug.c | 4 ++-- heap.c | 6 +++--- platform.c | 8 ++++---- table.c | 2 +- type.c | 2 +- variable.c | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/debug.c b/debug.c index b2c1149..32a00e9 100644 --- a/debug.c +++ b/debug.c @@ -21,7 +21,7 @@ void DebugCleanup(Picoc *pc) for (Count = 0; Count < pc->BreakpointTable.Size; Count++) { for (Entry = pc->BreakpointHashTable[Count]; Entry != NULL; - Entry = NextEntry) { + Entry = NextEntry) { NextEntry = Entry->Next; HeapFreeMem(pc, Entry); } @@ -37,7 +37,7 @@ static struct TableEntry *DebugTableSearchBreakpoint(struct ParseState *Parser, int HashValue = BREAKPOINT_HASH(Parser) % pc->BreakpointTable.Size; for (Entry = pc->BreakpointHashTable[HashValue]; - Entry != NULL; Entry = Entry->Next) { + Entry != NULL; Entry = Entry->Next) { if (Entry->p.b.FileName == Parser->FileName && Entry->p.b.Line == Parser->Line && Entry->p.b.CharacterPos == Parser->CharacterPos) diff --git a/heap.c b/heap.c index 5cbd628..4a908f2 100644 --- a/heap.c +++ b/heap.c @@ -34,7 +34,7 @@ void HeapInit(Picoc *pc, int StackOrHeapSize) pc->StackFrame = &(pc->HeapMemory)[AlignOffset]; pc->HeapStackTop = &(pc->HeapMemory)[AlignOffset]; - *(void **)(pc->StackFrame) = NULL; + *(void**)(pc->StackFrame) = NULL; pc->HeapBottom = &(pc->HeapMemory)[StackOrHeapSize-sizeof(ALIGN_TYPE)+AlignOffset]; pc->FreeListBig = NULL; @@ -98,7 +98,7 @@ void HeapPushStackFrame(Picoc *pc) #ifdef DEBUG_HEAP printf("Adding stack frame at 0x%lx\n", (unsigned long)pc->HeapStackTop); #endif - *(void **)pc->HeapStackTop = pc->StackFrame; + *(void**)pc->HeapStackTop = pc->StackFrame; pc->StackFrame = pc->HeapStackTop; pc->HeapStackTop = (void*)((char*)pc->HeapStackTop + MEM_ALIGN(sizeof(ALIGN_TYPE))); @@ -108,7 +108,7 @@ void HeapPushStackFrame(Picoc *pc) frame. can return NULL */ int HeapPopStackFrame(Picoc *pc) { - if (*(void **)pc->StackFrame != NULL) { + if (*(void**)pc->StackFrame != NULL) { pc->HeapStackTop = pc->StackFrame; pc->StackFrame = *(void**)pc->StackFrame; #ifdef DEBUG_HEAP diff --git a/platform.c b/platform.c index 38df12c..b3feb48 100644 --- a/platform.c +++ b/platform.c @@ -73,9 +73,9 @@ void PicocCallMain(Picoc *pc, int argc, char **argv) if (FuncValue->Val->FuncDef.NumParams != 0) { /* define the arguments */ VariableDefinePlatformVar(pc, NULL, "__argc", &pc->IntType, - (union AnyValue *)&argc, false); + (union AnyValue*)&argc, false); VariableDefinePlatformVar(pc, NULL, "__argv", pc->CharPtrPtrType, - (union AnyValue *)&argv, false); + (union AnyValue*)&argv, false); } if (FuncValue->Val->FuncDef.ReturnType == &pc->VoidType) { @@ -226,7 +226,7 @@ void PlatformVPrintf(IOFILE *Stream, const char *Format, va_list Args) FPos++; switch (*FPos) { case 's': - PrintStr(va_arg(Args, char *), Stream); + PrintStr(va_arg(Args, char*), Stream); break; case 'd': PrintSimpleInt(va_arg(Args, int), Stream); @@ -235,7 +235,7 @@ void PlatformVPrintf(IOFILE *Stream, const char *Format, va_list Args) PrintCh(va_arg(Args, int), Stream); break; case 't': - PrintType(va_arg(Args, struct ValueType *), Stream); + PrintType(va_arg(Args, struct ValueType*), Stream); break; case 'f': PrintFP(va_arg(Args, double), Stream); diff --git a/table.c b/table.c index 68910f1..479065b 100644 --- a/table.c +++ b/table.c @@ -137,7 +137,7 @@ struct TableEntry *TableSearchIdentifier(struct Table *Tbl, struct TableEntry *Entry; for (Entry = Tbl->HashTable[HashValue]; Entry != NULL; Entry = Entry->Next) { - if (strncmp(&Entry->p.Key[0], (char *)Key, Len) == 0 && + if (strncmp(&Entry->p.Key[0], (char*)Key, Len) == 0 && Entry->p.Key[Len] == '\0') return Entry; /* found */ } diff --git a/type.c b/type.c index e7b7e77..f998861 100644 --- a/type.c +++ b/type.c @@ -368,7 +368,7 @@ void TypeParseEnum(struct ParseState *Parser, struct ValueType **Typ) LexGetToken(Parser, NULL, true); (*Typ)->Members = &pc->GlobalTable; - memset((void *)&InitValue, '\0', sizeof(struct Value)); + memset((void*)&InitValue, '\0', sizeof(struct Value)); InitValue.Typ = &pc->IntType; InitValue.Val = (union AnyValue*)&EnumValue; do { diff --git a/variable.c b/variable.c index a054bdc..a28f166 100644 --- a/variable.c +++ b/variable.c @@ -25,11 +25,11 @@ void VariableFree(Picoc *pc, struct Value *Val) if (Val->Typ == &pc->FunctionType && Val->Val->FuncDef.Intrinsic == NULL && Val->Val->FuncDef.Body.Pos != NULL) - HeapFreeMem(pc, (void *)Val->Val->FuncDef.Body.Pos); + HeapFreeMem(pc, (void*)Val->Val->FuncDef.Body.Pos); /* free macro bodies */ if (Val->Typ == &pc->MacroType) - HeapFreeMem(pc, (void *)Val->Val->MacroDef.Body.Pos); + HeapFreeMem(pc, (void*)Val->Val->MacroDef.Body.Pos); /* free the AnyValue */ if (Val->AnyValOnHeap) @@ -338,7 +338,7 @@ struct Value *VariableDefineButIgnoreIdentical(struct ParseState *Parser, /* make the mangled static name (avoiding using sprintf() to minimise library impact) */ - memset((void *)&MangledName, '\0', sizeof(MangledName)); + memset((void*)&MangledName, '\0', sizeof(MangledName)); *MNPos++ = '/'; strncpy(MNPos, (char*)Parser->FileName, MNEnd - MNPos); MNPos += strlen(MNPos);