Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoirier committed Jun 22, 2015
1 parent f551e28 commit 6ed4aa1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)));
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
Expand Down
2 changes: 1 addition & 1 deletion type.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6ed4aa1

Please sign in to comment.