summaryrefslogtreecommitdiff
path: root/linear.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 /linear.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 'linear.c')
-rw-r--r--linear.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/linear.c b/linear.c
index ff1b1d7..714eef1 100644
--- a/linear.c
+++ b/linear.c
@@ -28,14 +28,14 @@ void DoLU(void)
LUStruct *loclustruct; /* Local pointer to global data */
char *errorcontext;
int systemerror;
-fardouble *a;
-fardouble *b;
-fardouble *abase;
-fardouble *bbase;
+double *a;
+double *b;
+double *abase;
+double *bbase;
LUdblptr ptra;
int n;
int i;
-ulong accumtime;
+unsigned long accumtime;
double iterations;
/*
@@ -54,9 +54,9 @@ errorcontext="FPU:LU";
** derived from. (I.E., we'll simply copy these arrays
** into the others.
*/
-a=(fardouble *)AllocateMemory(sizeof(double) * LUARRAYCOLS * LUARRAYROWS,
+a=(double *)AllocateMemory(sizeof(double) * LUARRAYCOLS * LUARRAYROWS,
&systemerror);
-b=(fardouble *)AllocateMemory(sizeof(double) * LUARRAYROWS,
+b=(double *)AllocateMemory(sizeof(double) * LUARRAYROWS,
&systemerror);
n=LUARRAYROWS;
@@ -65,7 +65,7 @@ n=LUARRAYROWS;
** algorithm. This removes the allocation routine from the
** timing.
*/
-LUtempvv=(fardouble *)AllocateMemory(sizeof(double)*LUARRAYROWS,
+LUtempvv=(double *)AllocateMemory(sizeof(double)*LUARRAYROWS,
&systemerror);
/*
@@ -84,18 +84,18 @@ if(loclustruct->adjust==0)
loclustruct->numarrays=0;
for(i=1;i<=MAXLUARRAYS;i++)
{
- abase=(fardouble *)AllocateMemory(sizeof(double) *
+ abase=(double *)AllocateMemory(sizeof(double) *
LUARRAYCOLS*LUARRAYROWS*(i+1),&systemerror);
if(systemerror)
{ ReportError(errorcontext,systemerror);
- LUFreeMem(a,b,(fardouble *)NULL,(fardouble *)NULL);
+ LUFreeMem(a,b,(double *)NULL,(double *)NULL);
ErrorExit();
}
- bbase=(fardouble *)AllocateMemory(sizeof(double) *
+ bbase=(double *)AllocateMemory(sizeof(double) *
LUARRAYROWS*(i+1),&systemerror);
if(systemerror)
{ ReportError(errorcontext,systemerror);
- LUFreeMem(a,b,abase,(fardouble *)NULL);
+ LUFreeMem(a,b,abase,(double *)NULL);
ErrorExit();
}
if(DoLUIteration(a,b,abase,bbase,i)>global_min_ticks)
@@ -105,8 +105,8 @@ if(loclustruct->adjust==0)
/*
** Not enough arrays...free them all and try again
*/
- FreeMemory((farvoid *)abase,&systemerror);
- FreeMemory((farvoid *)bbase,&systemerror);
+ FreeMemory((void *)abase,&systemerror);
+ FreeMemory((void *)bbase,&systemerror);
}
/*
** Were we able to do it?
@@ -122,20 +122,20 @@ else
** Don't need to adjust -- just allocate the proper
** number of arrays and proceed.
*/
- abase=(fardouble *)AllocateMemory(sizeof(double) *
+ abase=(double *)AllocateMemory(sizeof(double) *
LUARRAYCOLS*LUARRAYROWS*loclustruct->numarrays,
&systemerror);
if(systemerror)
{ ReportError(errorcontext,systemerror);
- LUFreeMem(a,b,(fardouble *)NULL,(fardouble *)NULL);
+ LUFreeMem(a,b,(double *)NULL,(double *)NULL);
ErrorExit();
}
- bbase=(fardouble *)AllocateMemory(sizeof(double) *
+ bbase=(double *)AllocateMemory(sizeof(double) *
LUARRAYROWS*loclustruct->numarrays,&systemerror);
if(systemerror)
{
ReportError(errorcontext,systemerror);
- LUFreeMem(a,b,abase,(fardouble *)NULL);
+ LUFreeMem(a,b,abase,(double *)NULL);
ErrorExit();
}
}
@@ -169,17 +169,17 @@ return;
***************
** Release memory associated with LU benchmark.
*/
-static void LUFreeMem(fardouble *a, fardouble *b,
- fardouble *abase,fardouble *bbase)
+static void LUFreeMem(double *a, double *b,
+ double *abase,double *bbase)
{
int systemerror;
-FreeMemory((farvoid *)a,&systemerror);
-FreeMemory((farvoid *)b,&systemerror);
-FreeMemory((farvoid *)LUtempvv,&systemerror);
+FreeMemory((void *)a,&systemerror);
+FreeMemory((void *)b,&systemerror);
+FreeMemory((void *)LUtempvv,&systemerror);
-if(abase!=(fardouble *)NULL) FreeMemory((farvoid *)abase,&systemerror);
-if(bbase!=(fardouble *)NULL) FreeMemory((farvoid *)bbase,&systemerror);
+if(abase!=(double *)NULL) FreeMemory((void *)abase,&systemerror);
+if(bbase!=(double *)NULL) FreeMemory((void *)bbase,&systemerror);
return;
}
@@ -190,15 +190,15 @@ return;
** An iteration refers to the repeated solution of several
** identical matrices.
*/
-static ulong DoLUIteration(fardouble *a,fardouble *b,
- fardouble *abase, fardouble *bbase,
- ulong numarrays)
+static unsigned long DoLUIteration(double *a,double *b,
+ double *abase, double *bbase,
+ unsigned long numarrays)
{
-fardouble *locabase;
-fardouble *locbbase;
+double *locabase;
+double *locbbase;
LUdblptr ptra; /* For converting ptr to 2D array */
-ulong elapsed;
-ulong j,i; /* Indexes */
+unsigned long elapsed;
+unsigned long j,i; /* Indexes */
/*
@@ -250,7 +250,7 @@ double rcon; /* Random constant */
** Reset random number generator
*/
/* randnum(13L); */
-randnum((int32)13);
+randnum((int32_t)13);
/*
** Build an identity matrix.
@@ -259,11 +259,11 @@ randnum((int32)13);
*/
for(i=0;i<n;i++)
{ /* b[i]=(double)(abs_randwc(100L)+1L); */
- b[i]=(double)(abs_randwc((int32)100)+(int32)1);
+ b[i]=(double)(abs_randwc((int32_t)100)+(int32_t)1);
for(j=0;j<n;j++)
if(i==j)
/* a[i][j]=(double)(abs_randwc(1000L)+1L); */
- a[i][j]=(double)(abs_randwc((int32)1000)+(int32)1);
+ a[i][j]=(double)(abs_randwc((int32_t)1000)+(int32_t)1);
else
a[i][j]=(double)0.0;
}
@@ -307,8 +307,8 @@ for(i=0;i<8*n;i++)
*/
/* k=abs_randwc((long)n); */
/* k1=abs_randwc((long)n); */
- k=abs_randwc((int32)n);
- k1=abs_randwc((int32)n);
+ k=abs_randwc((int32_t)n);
+ k1=abs_randwc((int32_t)n);
if(k!=k1)
{
if(k<k1) rcon=(double)1.0;