diff options
-rw-r--r-- | assignment.c | 14 | ||||
-rw-r--r-- | bitfield.c | 1 | ||||
-rw-r--r-- | fpemulation.c | 1 | ||||
-rw-r--r-- | nbench0.h | 8 | ||||
-rw-r--r-- | nmglobal.h | 19 | ||||
-rw-r--r-- | numsort.c | 3 |
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++) @@ -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" @@ -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, @@ -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. */ @@ -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; } |