formatting

This commit is contained in:
Joseph Poirier 2015-06-22 14:16:49 -05:00
parent f551e28a49
commit 6ed4aa1b63
6 changed files with 14 additions and 14 deletions

View file

@ -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)

6
heap.c
View file

@ -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

View file

@ -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);

View file

@ -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 */
}

2
type.c
View file

@ -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 {

View file

@ -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);