summaryrefslogtreecommitdiff
path: root/assignment.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-11 23:00:38 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-11 23:00:38 +0000
commit5a7f0d2e7b4265153ccc70051bdae8b851617ede (patch)
treeb29e974f32a1ddba669359100bb6748c72cbfd1e /assignment.c
parentbef5cb4c61e44ee8784f233eb2ec230c776dbda6 (diff)
Remove stupid datatypes. Begin code cleanup
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@5 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
Diffstat (limited to 'assignment.c')
-rw-r--r--assignment.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/assignment.c b/assignment.c
index 7313d78..a4f3b5f 100644
--- a/assignment.c
+++ b/assignment.c
@@ -27,10 +27,10 @@
void DoAssign(void)
{
AssignStruct *locassignstruct; /* Local structure ptr */
-farlong *arraybase;
+long *arraybase;
char *errorcontext;
int systemerror;
-ulong accumtime;
+unsigned long accumtime;
double iterations;
/*
@@ -60,12 +60,12 @@ if(locassignstruct->adjust==0)
/*
** Allocate space for arrays
*/
- arraybase=(farlong *) AllocateMemory(sizeof(long)*
+ arraybase=(long *) AllocateMemory(sizeof(long)*
ASSIGNROWS*ASSIGNCOLS*locassignstruct->numarrays,
&systemerror);
if(systemerror)
{ ReportError(errorcontext,systemerror);
- FreeMemory((farvoid *)arraybase,
+ FreeMemory((void *)arraybase,
&systemerror);
ErrorExit();
}
@@ -80,7 +80,7 @@ if(locassignstruct->adjust==0)
locassignstruct->numarrays)>global_min_ticks)
break; /* We're ok...exit */
- FreeMemory((farvoid *)arraybase, &systemerror);
+ FreeMemory((void *)arraybase, &systemerror);
locassignstruct->numarrays++;
}
}
@@ -88,12 +88,12 @@ else
{ /*
** Allocate space for arrays
*/
- arraybase=(farlong *)AllocateMemory(sizeof(long)*
+ arraybase=(long *)AllocateMemory(sizeof(long)*
ASSIGNROWS*ASSIGNCOLS*locassignstruct->numarrays,
&systemerror);
if(systemerror)
{ ReportError(errorcontext,systemerror);
- FreeMemory((farvoid *)arraybase,
+ FreeMemory((void *)arraybase,
&systemerror);
ErrorExit();
}
@@ -115,7 +115,7 @@ do {
** Clean up, calculate results, and go home. Be sure to
** show that we don't have to rerun adjustment code.
*/
-FreeMemory((farvoid *)arraybase,&systemerror);
+FreeMemory((void *)arraybase,&systemerror);
locassignstruct->iterspersec=iterations *
(double)locassignstruct->numarrays / TicksToFracSecs(accumtime);
@@ -133,12 +133,12 @@ return;
** This routine executes one iteration of the assignment test.
** It returns the number of ticks elapsed in the iteration.
*/
-static ulong DoAssignIteration(farlong *arraybase,
- ulong numarrays)
+static unsigned long DoAssignIteration(long *arraybase,
+ unsigned long numarrays)
{
longptr abase; /* local pointer */
-ulong elapsed; /* Elapsed ticks */
-ulong i;
+unsigned long elapsed; /* Elapsed ticks */
+unsigned long i;
/*
** Set up local pointer
@@ -177,11 +177,11 @@ return(StopStopwatch(elapsed));
** Load the assignment arrays with random numbers. All positive.
** These numbers represent costs.
*/
-static void LoadAssignArrayWithRand(farlong *arraybase,
- ulong numarrays)
+static void LoadAssignArrayWithRand(long *arraybase,
+ unsigned long numarrays)
{
longptr abase,abase1; /* Local for array pointer */
-ulong i;
+unsigned long i;
/*
** Set local array pointer
@@ -211,20 +211,20 @@ return;
** The array given by arraybase is loaded with positive random
** numbers. Elements in the array are capped at 5,000,000.
*/
-static void LoadAssign(farlong arraybase[][ASSIGNCOLS])
+static void LoadAssign(long arraybase[][ASSIGNCOLS])
{
-ushort i,j;
+unsigned short i,j;
/*
** Reset random number generator so things repeat.
*/
/* randnum(13L); */
-randnum((int32)13);
+randnum(13);
for(i=0;i<ASSIGNROWS;i++)
for(j=0;j<ASSIGNROWS;j++){
/* arraybase[i][j]=abs_randwc(5000000L);*/
- arraybase[i][j]=abs_randwc((int32)5000000);
+ arraybase[i][j]=abs_randwc((int32_t)5000000);
}
return;
@@ -237,10 +237,10 @@ return;
** the routine that builds the initial array, and is used to copy
** the contents of the intial array into all following arrays.
*/
-static void CopyToAssign(farlong arrayfrom[ASSIGNROWS][ASSIGNCOLS],
- farlong arrayto[ASSIGNROWS][ASSIGNCOLS])
+static void CopyToAssign(long arrayfrom[ASSIGNROWS][ASSIGNCOLS],
+ long arrayto[ASSIGNROWS][ASSIGNCOLS])
{
-ushort i,j;
+unsigned short i,j;
for(i=0;i<ASSIGNROWS;i++)
for(j=0;j<ASSIGNCOLS;j++)
@@ -252,7 +252,7 @@ return;
/***************
** Assignment **
***************/
-static void Assignment(farlong arraybase[][ASSIGNCOLS])
+static void Assignment(long arraybase[][ASSIGNCOLS])
{
short assignedtableau[ASSIGNROWS][ASSIGNCOLS];
@@ -295,7 +295,7 @@ return;
*/
static void calc_minimum_costs(long tableau[][ASSIGNCOLS])
{
-ushort i,j; /* Index variables */
+unsigned short i,j; /* Index variables */
long currentmin; /* Current minimum */
/*
** Determine minimum costs on row basis. This is done by
@@ -355,10 +355,10 @@ return;
static int first_assignments(long tableau[][ASSIGNCOLS],
short assignedtableau[][ASSIGNCOLS])
{
-ushort i,j,k; /* Index variables */
-ushort numassigns; /* # of assignments */
-ushort totnumassigns; /* Total # of assignments */
-ushort numzeros; /* # of zeros in row */
+unsigned short i,j,k; /* Index variables */
+unsigned short numassigns; /* # of assignments */
+unsigned short totnumassigns; /* Total # of assignments */
+unsigned short numzeros; /* # of zeros in row */
int selected=0; /* Flag used to indicate selection */
/*
@@ -474,8 +474,8 @@ int i,j; /* Indexes */
short linesrow[ASSIGNROWS];
short linescol[ASSIGNCOLS];
long smallest; /* Holds smallest value */
-ushort numassigns; /* Number of assignments */
-ushort newrows; /* New rows to be considered */
+unsigned short numassigns; /* Number of assignments */
+unsigned short newrows; /* New rows to be considered */
/*
** Clear the linesrow and linescol arrays.
*/