summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-12 23:02:01 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-12 23:02:01 +0000
commit7a57eeccd8ded740d88aba3ea9dcb09050983dd0 (patch)
tree945953d547076b67567bd99b945ec33c6ee1ea59
parentb50243af303373a0af9185dd12d86b21990dde14 (diff)
Remove stupid MAXPOSLONG define (otherwise standardized as LONG_MAX)
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@13 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
-rw-r--r--assignment.c14
-rw-r--r--bitfield.c1
-rw-r--r--fpemulation.c1
-rw-r--r--nbench0.h8
-rw-r--r--nmglobal.h19
-rw-r--r--numsort.c3
6 files changed, 18 insertions, 28 deletions
diff --git a/assignment.c b/assignment.c
index a4f3b5f..29f79c8 100644
--- a/assignment.c
+++ b/assignment.c
@@ -1,7 +1,13 @@
-#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <math.h>
+#include <limits.h>
+
#include "nmglobal.h"
#include "nbench1.h"
+
/*************************
** ASSIGNMENT ALGORITHM **
*************************/
@@ -304,7 +310,7 @@ long currentmin; /* Current minimum */
*/
for(i=0;i<ASSIGNROWS;i++)
{
- currentmin=MAXPOSLONG; /* Initialize minimum */
+ currentmin = LONG_MAX; /* Initialize minimum */
for(j=0;j<ASSIGNCOLS;j++)
if(tableau[i][j]<currentmin)
currentmin=tableau[i][j];
@@ -320,7 +326,7 @@ for(i=0;i<ASSIGNROWS;i++)
*/
for(j=0;j<ASSIGNCOLS;j++)
{
- currentmin=MAXPOSLONG; /* Initialize minimum */
+ currentmin = LONG_MAX; /* Initialize minimum */
for(i=0;i<ASSIGNROWS;i++)
if(tableau[i][j]<currentmin)
currentmin=tableau[i][j];
@@ -532,7 +538,7 @@ do {
** For all cells not covered by imaginary lines, determine smallest
** value.
*/
-smallest=MAXPOSLONG;
+smallest=LONG_MAX;
for(i=0;i<ASSIGNROWS;i++)
if(linesrow[i]!=0)
for(j=0;j<ASSIGNCOLS;j++)
diff --git a/bitfield.c b/bitfield.c
index 3d56794..5f85e34 100644
--- a/bitfield.c
+++ b/bitfield.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
+#include <limits.h>
#include "nmglobal.h"
#include "nbench1.h"
diff --git a/fpemulation.c b/fpemulation.c
index 26ce951..ac24bd9 100644
--- a/fpemulation.c
+++ b/fpemulation.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
+#include <limits.h>
#include "nmglobal.h"
#include "nbench1.h"
diff --git a/nbench0.h b/nbench0.h
index d5d76b1..947feba 100644
--- a/nbench0.h
+++ b/nbench0.h
@@ -206,8 +206,8 @@ char buffer[BUF_SIZ];
/*
** Global parameters.
*/
-ulong global_min_ticks; /* Minimum ticks */
-ulong global_min_seconds; /* Minimum seconds tests run */
+unsigned long global_min_ticks; /* Minimum ticks */
+unsigned long global_min_seconds; /* Minimum seconds tests run */
int global_allstats; /* Statistics dump flag */
char global_ofile_name[BUF_SIZ];/* Output file name */
FILE *global_ofile; /* Output file */
@@ -219,7 +219,7 @@ int global_align; /* Memory alignment */
** Following global is the memory array. This is used to store
** original and aligned (modified) memory addresses.
*/
-ulong mem_array[2][MEM_ARRAY_SIZE];
+unsigned long mem_array[2][MEM_ARRAY_SIZE];
int mem_array_ents; /* # of active entries */
/*
@@ -302,7 +302,7 @@ static int getflag(char *cptr);
static void strtoupper(char *s);
static void set_request_secs(void);
static int bench_with_confidence(int fid,
- double *mean, double *stdev, ulong *numtries);
+ double *mean, double *stdev, unsigned long *numtries);
/*
static int seek_confidence(double scores[5],
double *newscore, double *c_half_interval,
diff --git a/nmglobal.h b/nmglobal.h
index 6c2a145..cb7a6e3 100644
--- a/nmglobal.h
+++ b/nmglobal.h
@@ -131,25 +131,6 @@
#define MINIMUM_SECONDS 5
/*
-** MAXPOSLONG
-**
-** This is the maximum positive long.
-*/
-#ifdef _LP64
-#define MAXPOSLONG 0x7FFFFFFFFFFFFFFFL
-#else
-#define MAXPOSLONG 0x7FFFFFFFL
-#endif
-
-/*
-** OTHER DEFINES
-*/
-#ifndef MAC
-#define TRUE 1
-#define FALSE 0
-#endif
-
-/*
** Memory array size. Used in SYSSPEC for keeping track
** of re-aligned memory.
*/
diff --git a/numsort.c b/numsort.c
index f0ab459..34e685f 100644
--- a/numsort.c
+++ b/numsort.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
+#include <limits.h>
#include "nmglobal.h"
#include "nbench1.h"
@@ -60,7 +61,7 @@ DoNumSort (void)
** minimum, then allocate for more arrays and
** try again.
*/
- if (DoNumSortIteration(arraybase, numsortstruct->arraysize, numsortstruct->numarrays)>global_min_ticks) {
+ if (DoNumSortIteration(arraybase, numsortstruct->arraysize, numsortstruct->numarrays) > global_min_ticks) {
break;
}