#include <string.h>
/** For printf */
#include <stdio.h>
-
-/** Returns the current device time in ticks. Check HZ in the Makefile
- as well - HZ ticks = 1 second.
-*/
-unsigned _clock(void);
+/** For clock() */
+#include <time.h>
/** Print the number of t-states this program has been executing for.
Optional :)
int Arr_1_Glob [50];
int Arr_2_Glob [50] [50];
-
/* Used instead of malloc() */
static Rec_Type _r[2];
Boolean Func_2 (char *Str_1_Par_Ref, char *Str_2_Par_Ref);
Boolean Func_3 (Enumeration Enum_Par_Val);
-#if SDCC
-int _main(void)
-#else
int main(void)
-#endif
{
One_Fifty Int_1_Loc;
REG One_Fifty Int_2_Loc;
Next_Ptr_Glob = &_r[0];
Ptr_Glob = &_r[1];
+
Ptr_Glob->Ptr_Comp = Next_Ptr_Glob;
Ptr_Glob->Discr = Ident_1;
Ptr_Glob->variant.var_1.Enum_Comp = Ident_3;
/* 32766 is the highest value for a 16 bitter */
Number_Of_Runs = 32766;
- runTime = _clock();
+ runTime = clock();
/* Main test loop */
for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index) {
Int_1_Loc, Int_2_Loc, Int_3_Loc));
DPRINTF(("Proc_8\n"));
- Proc_8 (Arr_1_Glob, Arr_2_Glob, Int_1_Loc, Int_3_Loc);
+ Proc_8 (Arr_1_Glob, (int *)Arr_2_Glob, Int_1_Loc, Int_3_Loc);
/* Int_Glob == 5 */
DPRINTF(("Int_Glob %d == 5\n", Int_Glob));
DPRINTF(("Proc_1\n"));
printf("Run_Index = %d\n", Run_Index);
- runTime = _clock() - runTime;
+ runTime = clock() - runTime;
printf ("Execution ends\n");
printf ("\n");
printf ("\n");
printf("Time: %u ticks\n", runTime);
- printf("Dhrystones/s = %u\n", Number_Of_Runs / (runTime/HZ));
+ printf("Dhrystones/s = %u\n", Number_Of_Runs / (runTime/CLOCKS_PER_SEC));
printf("MIPS = d/s/1757 = (sigh, need floats...)\n");
_printTStates();
}
Int_Loc = *Int_Par_Ref + 10;
do {
- DPRINTF(("1\n"));
+ DPRINTF(("1"));
/* executed once */
if (Ch_1_Glob == 'A')
/* then, executed */
{
- DPRINTF(("2\n"));
+ DPRINTF(("2"));
Int_Loc -= 1;
*Int_Par_Ref = Int_Loc - Int_Glob;
Enum_Loc = Ident_1;
} /* if */
- DPRINTF(("3\n"));
+ DPRINTF(("3"));
} while (Enum_Loc != Ident_1); /* true */
DPRINTF(("Proc_2 done.\n"));
} /* Proc_2 */