summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-13 22:07:24 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-13 22:07:24 +0000
commit8a9fd3f93bb3db2d969126913eedab023dba013f (patch)
tree5cd76353b5ec3e8be5c1062c0294e9b402a71487
parent9631ec05f6ddc60b231e5fad280e5a5242c5bab3 (diff)
Remove AllocateMemory, FreeMemory, MoveMemory, ErrorExit, and ReportError functions
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@17 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
-rw-r--r--assignment.c53
-rw-r--r--fourier.c16
-rw-r--r--huffman.c6
-rw-r--r--linear.c129
-rw-r--r--nbench0.c2
-rw-r--r--nbench1.h7
-rw-r--r--neural.c5
-rw-r--r--stringsort.c36
-rw-r--r--sysspec.c363
-rw-r--r--sysspec.h40
10 files changed, 89 insertions, 568 deletions
diff --git a/assignment.c b/assignment.c
index 7d83507..d3598c5 100644
--- a/assignment.c
+++ b/assignment.c
@@ -67,24 +67,13 @@ static void second_assignments(long tableau[][ASSIGNCOLS],
*/
void DoAssign(void)
{
-AssignStruct *locassignstruct; /* Local structure ptr */
-long *arraybase;
-char *errorcontext;
-int systemerror;
+AssignStruct *locassignstruct = &global_assignstruct; /* Local structure ptr */
+long *arraybase = NULL;
+char *context = "CPU:Assignment";
unsigned long accumtime;
double iterations;
/*
-** Link to global structure
-*/
-locassignstruct=&global_assignstruct;
-
-/*
-** Set the error context string.
-*/
-errorcontext="CPU:Assignment";
-
-/*
** See if we need to do self adjustment code.
*/
if(locassignstruct->adjust==0)
@@ -98,17 +87,10 @@ if(locassignstruct->adjust==0)
locassignstruct->numarrays=1;
while(1)
{
- /*
- ** Allocate space for arrays
- */
- arraybase=(long *) AllocateMemory(sizeof(long)*
- ASSIGNROWS*ASSIGNCOLS*locassignstruct->numarrays,
- &systemerror);
- if(systemerror)
- { ReportError(errorcontext,systemerror);
- FreeMemory((void *)arraybase,
- &systemerror);
- ErrorExit();
+ arraybase = realloc(arraybase, sizeof(long) * ASSIGNROWS * ASSIGNCOLS * locassignstruct->numarrays);
+ if (!arraybase) {
+ fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
+ exit(1);
}
/*
@@ -121,22 +103,13 @@ if(locassignstruct->adjust==0)
locassignstruct->numarrays)>global_min_ticks)
break; /* We're ok...exit */
- FreeMemory((void *)arraybase, &systemerror);
locassignstruct->numarrays++;
}
-}
-else
-{ /*
- ** Allocate space for arrays
- */
- arraybase=(long *)AllocateMemory(sizeof(long)*
- ASSIGNROWS*ASSIGNCOLS*locassignstruct->numarrays,
- &systemerror);
- if(systemerror)
- { ReportError(errorcontext,systemerror);
- FreeMemory((void *)arraybase,
- &systemerror);
- ErrorExit();
+} else {
+ arraybase = malloc(sizeof(long) * ASSIGNROWS * ASSIGNCOLS * locassignstruct->numarrays);
+ if (!arraybase) {
+ fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
+ exit(1);
}
}
@@ -156,7 +129,7 @@ do {
** Clean up, calculate results, and go home. Be sure to
** show that we don't have to rerun adjustment code.
*/
-FreeMemory((void *)arraybase,&systemerror);
+free(arraybase);
locassignstruct->iterspersec=iterations *
(double)locassignstruct->numarrays / TicksToFracSecs(accumtime);
diff --git a/fourier.c b/fourier.c
index 5596e7a..c3bd58b 100644
--- a/fourier.c
+++ b/fourier.c
@@ -34,25 +34,15 @@ static double thefunction(double x,
*/
void DoFourier(void)
{
-FourierStruct *locfourierstruct; /* Local fourier struct */
+FourierStruct *locfourierstruct=&global_fourierstruct; /* Local fourier struct */
double *abase = NULL; /* Base of A[] coefficients array */
double *bbase = NULL; /* Base of B[] coefficients array */
unsigned long accumtime; /* Accumulated time in ticks */
double iterations; /* # of iterations */
-char *context; /* Error context string pointer */
+char *context = "FPU:Transcendental"; /* Error context string pointer */
int systemerror; /* For error code */
/*
-** Link to global structure
-*/
-locfourierstruct=&global_fourierstruct;
-
-/*
-** Set error context string
-*/
-context="FPU:Transcendental";
-
-/*
** See if we need to do self-adjustment code.
*/
if(locfourierstruct->adjust==0)
@@ -84,8 +74,6 @@ if(locfourierstruct->adjust==0)
/*
** Make bigger arrays and try again.
*/
- FreeMemory((void *)abase,&systemerror);
- FreeMemory((void *)bbase,&systemerror);
locfourierstruct->arraysize+=50L;
}
}
diff --git a/huffman.c b/huffman.c
index 9d6aa7e..b16ceab 100644
--- a/huffman.c
+++ b/huffman.c
@@ -263,9 +263,7 @@ do {
*/
/* wordptr=wordcatarray[abs_randwc((long)WORDCATSIZE)];*/
wordptr=wordcatarray[abs_randwc((int32_t)WORDCATSIZE)];
-MoveMemory((void *)myword,
- (void *)wordptr,
- (unsigned long)strlen(wordptr)+1);
+memmove(myword, wordptr, strlen(wordptr) + 1);
/*
** Append a blank.
@@ -282,7 +280,7 @@ if((tomove+charssofar)>nchars)
/*
** Attach the word to the current line. Increment counter.
*/
-MoveMemory((void *)dt,(void *)myword,(unsigned long)tomove);
+memmove(dt, myword, tomove);
charssofar+=tomove;
dt+=tomove;
diff --git a/linear.c b/linear.c
index 8b65510..5645060 100644
--- a/linear.c
+++ b/linear.c
@@ -67,39 +67,25 @@ static int lusolve(double a[][LUARRAYCOLS],
*/
void DoLU(void)
{
-LUStruct *loclustruct; /* Local pointer to global data */
-char *errorcontext;
-int systemerror;
-double *a;
-double *b;
-double *abase;
-double *bbase;
+LUStruct *loclustruct = &global_lustruct; /* Local pointer to global data */
+char *context = "FPU:LU";
+double *a = NULL;
+double *b = NULL;
+double *abase = NULL;
+double *bbase = NULL;
LUdblptr ptra;
int n;
int i;
unsigned long accumtime;
double iterations;
-
-/*
-** Link to global data
-*/
-loclustruct=&global_lustruct;
-
-/*
-** Set error context.
-*/
-errorcontext="FPU:LU";
-
/*
** Our first step is to build a "solvable" problem. This
** will become the "seed" set that all others will be
** derived from. (I.E., we'll simply copy these arrays
** into the others.
*/
-a=(double *)AllocateMemory(sizeof(double) * LUARRAYCOLS * LUARRAYROWS,
- &systemerror);
-b=(double *)AllocateMemory(sizeof(double) * LUARRAYROWS,
- &systemerror);
+a = malloc(sizeof(double) * LUARRAYCOLS * LUARRAYROWS);
+b = malloc(sizeof(double) * LUARRAYROWS);
n=LUARRAYROWS;
/*
@@ -107,8 +93,7 @@ n=LUARRAYROWS;
** algorithm. This removes the allocation routine from the
** timing.
*/
-LUtempvv=(double *)AllocateMemory(sizeof(double)*LUARRAYROWS,
- &systemerror);
+LUtempvv = malloc(sizeof(double)*LUARRAYROWS);
/*
** Build a problem to be solved.
@@ -126,59 +111,58 @@ if(loclustruct->adjust==0)
loclustruct->numarrays=0;
for(i=1;i<=MAXLUARRAYS;i++)
{
- abase=(double *)AllocateMemory(sizeof(double) *
- LUARRAYCOLS*LUARRAYROWS*(i+1),&systemerror);
- if(systemerror)
- { ReportError(errorcontext,systemerror);
- LUFreeMem(a,b,(double *)NULL,(double *)NULL);
- ErrorExit();
+ abase = realloc(abase, sizeof(double) * LUARRAYCOLS*LUARRAYROWS*(i+1));
+ if (!abase) {
+ fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
+ free(a);
+ free(b);
+ exit(1);
}
- bbase=(double *)AllocateMemory(sizeof(double) *
- LUARRAYROWS*(i+1),&systemerror);
- if(systemerror)
- { ReportError(errorcontext,systemerror);
- LUFreeMem(a,b,abase,(double *)NULL);
- ErrorExit();
+
+ bbase = realloc(bbase, sizeof(double) * LUARRAYROWS*(i+1));
+ if (!bbase) {
+ fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
+ free(a);
+ free(b);
+ free(abase);
+ exit(1);
}
if(DoLUIteration(a,b,abase,bbase,i)>global_min_ticks)
{ loclustruct->numarrays=i;
break;
}
- /*
- ** Not enough arrays...free them all and try again
- */
- FreeMemory((void *)abase,&systemerror);
- FreeMemory((void *)bbase,&systemerror);
}
/*
** Were we able to do it?
*/
- if(loclustruct->numarrays==0)
- { printf("FPU:LU -- Array limit reached\n");
- LUFreeMem(a,b,abase,bbase);
- ErrorExit();
+ if (loclustruct->numarrays==0) {
+ fprintf(stderr, "FPU:LU -- Array limit reached\n");
+ free(a);
+ free(b);
+ free(abase);
+ free(bbase);
+ exit(1);
}
-}
-else
-{ /*
+} else {
+ /*
** Don't need to adjust -- just allocate the proper
** number of arrays and proceed.
*/
- abase=(double *)AllocateMemory(sizeof(double) *
- LUARRAYCOLS*LUARRAYROWS*loclustruct->numarrays,
- &systemerror);
- if(systemerror)
- { ReportError(errorcontext,systemerror);
- LUFreeMem(a,b,(double *)NULL,(double *)NULL);
- ErrorExit();
+ abase = malloc(sizeof(double) * LUARRAYCOLS*LUARRAYROWS*loclustruct->numarrays);
+ if (!abase) {
+ fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
+ free(a);
+ free(b);
+ exit(1);
}
- bbase=(double *)AllocateMemory(sizeof(double) *
- LUARRAYROWS*loclustruct->numarrays,&systemerror);
- if(systemerror)
- {
- ReportError(errorcontext,systemerror);
- LUFreeMem(a,b,abase,(double *)NULL);
- ErrorExit();
+
+ bbase = malloc(sizeof(double) * LUARRAYROWS*loclustruct->numarrays);
+ if (!bbase) {
+ fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
+ free(a);
+ free(b);
+ free(abase);
+ exit(1);
}
}
/*
@@ -202,8 +186,10 @@ loclustruct->iterspersec=iterations / TicksToFracSecs(accumtime);
if(loclustruct->adjust==0)
loclustruct->adjust=1;
-LUFreeMem(a,b,abase,bbase);
-return;
+free(a);
+free(b);
+free(abase);
+free(bbase);
}
/**************
@@ -216,13 +202,16 @@ static void LUFreeMem(double *a, double *b,
{
int systemerror;
-FreeMemory((void *)a,&systemerror);
-FreeMemory((void *)b,&systemerror);
-FreeMemory((void *)LUtempvv,&systemerror);
+free(a);
+free(b);
+free(LUtempvv);
-if(abase!=(double *)NULL) FreeMemory((void *)abase,&systemerror);
-if(bbase!=(double *)NULL) FreeMemory((void *)bbase,&systemerror);
-return;
+if (abase != NULL) {
+ free(abase);
+}
+if (bbase != NULL) {
+ free(bbase);
+}
}
/******************
diff --git a/nbench0.c b/nbench0.c
index 8d0bf15..0990baf 100644
--- a/nbench0.c
+++ b/nbench0.c
@@ -400,7 +400,7 @@ while(fgets(inbuf,39,cfile)!=(char *)NULL)
if(global_ofile==(FILE *)NULL)
{ printf("**Error opening output file: %s\n",
global_ofile_name);
- ErrorExit();
+ exit(1);
}
write_to_file=-1;
break;
diff --git a/nbench1.h b/nbench1.h
index a892043..2537698 100644
--- a/nbench1.h
+++ b/nbench1.h
@@ -50,13 +50,6 @@ extern int32_t randwc(int32_t num);
extern uint32_t abs_randwc(uint32_t num);
extern int32_t randnum(int32_t lngval);
-extern void *AllocateMemory(unsigned long nbytes, /* From SYSSPEC */
- int *errorcode);
-extern void FreeMemory(void *mempointer,
- int *errorcode);
-extern void MoveMemory(void *destination,
- void *source, unsigned long nbytes);
-extern void ReportError(char *context, int errorcode);
extern unsigned long StartStopwatch();
extern unsigned long StopStopwatch(unsigned long startticks);
extern unsigned long TicksToSecs(unsigned long tickamount);
diff --git a/neural.c b/neural.c
index 7ce58c5..e8c75f8 100644
--- a/neural.c
+++ b/neural.c
@@ -146,8 +146,9 @@ randnum((int32_t)3);
** only once here at the beginning. These values don't
** change once loaded.
*/
-if(read_data_file()!=0)
- ErrorExit();
+if(read_data_file()!=0) {
+ exit(1);
+}
/*
diff --git a/stringsort.c b/stringsort.c
index bf38981..d3417a2 100644
--- a/stringsort.c
+++ b/stringsort.c
@@ -135,7 +135,7 @@ do {
** Clean up, calculate results, and go home.
** Set flag to show we don't need to rerun adjustment code.
*/
-FreeMemory((void *)arraybase,&systemerror);
+free(arraybase);
strsortstruct->sortspersec=iterations / (double)TicksToFracSecs(accumtime);
if(strsortstruct->adjust==0)
strsortstruct->adjust=1;
@@ -217,7 +217,7 @@ elapsed=StopStopwatch(elapsed);
** Release the offset pointer array built by
** LoadStringArray()
*/
-FreeMemory((void *)optrarray,&syserror);
+free(optrarray);
/*
** Return elapsed ticks.
@@ -412,9 +412,7 @@ nbytes=*(optrarray+nstrings-1L) +
** Hand this straight to memmove and let it handle the
** "overlap" problem.
*/
-MoveMemory((void *)(strarray+*(optrarray+i)+l+1),
- (void *)(strarray+*(optrarray+i+1)),
- (unsigned long)nbytes);
+memmove(strarray + *(optrarray + i) + l + 1, strarray + *(optrarray + i + 1), nbytes);
/*
** We have to adjust the offset pointer array.
@@ -472,27 +470,18 @@ for(i=top; i>0; --i)
/* temp = string[0] */
tlen=*strarray;
- MoveMemory((void *)&temp[0], /* Perform exchange */
- (void *)strarray,
- (unsigned long)(tlen+1));
-
+ memmove(&temp[0], strarray, tlen + 1);
/* string[0]=string[i] */
tlen=*(strarray+*(optrarray+i));
stradjust(optrarray,strarray,numstrings,0,tlen);
- MoveMemory((void *)strarray,
- (void *)(strarray+*(optrarray+i)),
- (unsigned long)(tlen+1));
+ memmove(strarray, (strarray + *(optrarray + i)), tlen + 1);
/* string[i]=temp */
tlen=temp[0];
stradjust(optrarray,strarray,numstrings,i,tlen);
- MoveMemory((void *)(strarray+*(optrarray+i)),
- (void *)&temp[0],
- (unsigned long)(tlen+1));
-
+ memmove(strarray + *(optrarray + i), &temp[0], tlen + 1);
}
-return;
}
/****************
@@ -572,27 +561,20 @@ while((i+i)<=j)
{
/* temp=string[k] */
tlen=*(strarray+*(optrarray+k));
- MoveMemory((void *)&temp[0],
- (void *)(strarray+*(optrarray+k)),
- (unsigned long)(tlen+1));
+ memmove(&temp[0], strarray + *(optrarray + k), tlen+1);
/* string[k]=string[i] */
tlen=*(strarray+*(optrarray+i));
stradjust(optrarray,strarray,numstrings,k,tlen);
- MoveMemory((void *)(strarray+*(optrarray+k)),
- (void *)(strarray+*(optrarray+i)),
- (unsigned long)(tlen+1));
+ memmove(strarray + *(optrarray + k), strarray + *(optrarray + i), tlen + 1);
/* string[i]=temp */
tlen=temp[0];
stradjust(optrarray,strarray,numstrings,i,tlen);
- MoveMemory((void *)(strarray+*(optrarray+i)),
- (void *)&temp[0],
- (unsigned long)(tlen+1));
+ memmove(strarray + *(optrarray + i), &temp[0], tlen + 1);
i=k;
}
else
i=j+1;
}
-return;
}
diff --git a/sysspec.c b/sysspec.c
index 0f4e580..402294d 100644
--- a/sysspec.c
+++ b/sysspec.c
@@ -36,320 +36,6 @@
*/
#include "sysspec.h"
-#ifdef DOS16
-#include <io.h>
-#include <fcntl.h>
-#include <sys\stat.h>
-#endif
-/*********************************
-** MEMORY MANAGEMENT ROUTINES **
-*********************************/
-
-
-/****************************
-** AllocateMemory
-** This routine returns a void pointer to a memory
-** block. The size of the memory block is given in bytes
-** as the first argument. This routine also returns an
-** error code in the second argument.
-** 10/95 Update:
-** Added an associative array for memory alignment reasons.
-** mem_array[2][MEM_ARRAY_SIZE]
-** mem_array[0][n] = Actual address (from malloc)
-** mem_array[1][n] = Aligned address
-** Currently, mem_array[][] is only used if you use malloc;
-** it is not used for the 16-bit DOS and MAC versions.
-*/
-void *AllocateMemory(unsigned long nbytes, /* # of bytes to alloc */
- int *errorcode) /* Returned error code */
-{
-#ifdef DOS16MEM
-union REGS registers;
-unsigned short nparas; /* # of paragraphs */
-
-/*
-** Set # of paragraphs to nbytes/16 +1. The +1 is a
-** slop factor.
-*/
-nparas=(unsigned short)(nbytes/16L) + 1;
-
-/*
-** Set incoming registers.
-*/
-registers.h.ah=0x48; /* Allocate memory */
-registers.x.bx=nparas; /* # of paragraphs */
-
-
-intdos(&registers,&registers); /* Call DOS */
-
-/*
-** See if things succeeded.
-*/
-if(registers.x.cflag)
-{ printf("error: %d Lgst: %d\n",registers.x.ax,registers.x.bx);
- *errorcode=ERROR_MEMORY;
- return((void *)NULL);
-}
-
-/*
-** Create a void pointer to return.
-*/
-*errorcode=0;
-return((void *)MK_FP(registers.x.ax,0));
-
-#endif
-
-#ifdef MACMEM
-/*
-** For MAC CodeWarrior, we'll use the MacOS NewPtr call
-*/
-void *returnval;
-returnval=(void *)NewPtr((Size)nbytes);
-if(returnval==(void *)NULL)
- *errorcode=ERROR_MEMORY;
-else
- *errorcode=0;
-return(returnval);
-#endif
-
-#ifdef MALLOCMEM
-/*
-** Everyone else, its pretty straightforward, given
-** that you use a 32-bit compiler which treats size_t as
-** a 4-byte entity.
-*/
-void *returnval; /* Return value */
-ulong true_addr; /* True address */
-ulong adj_addr; /* Adjusted address */
-
-returnval=(void *)malloc((size_t)(nbytes+2L*(long)global_align));
-if(returnval==(void *)NULL)
- *errorcode=ERROR_MEMORY;
-else
- *errorcode=0;
-
-/*
-** Check for alignment
-*/
-adj_addr=true_addr=(ulong)returnval;
-if(global_align==0)
-{
- if(AddMemArray(true_addr, adj_addr))
- *errorcode=ERROR_MEMARRAY_FULL;
- return(returnval);
-}
-
-if(global_align==1)
-{
- if(true_addr%2==0) adj_addr++;
-}
-else
-{
- while(adj_addr%global_align!=0) ++adj_addr;
- if(adj_addr%(global_align*2)==0) adj_addr+=global_align;
-}
-returnval=(void *)adj_addr;
-if(AddMemArray(true_addr,adj_addr))
- *errorcode=ERROR_MEMARRAY_FULL;
-return(returnval);
-#endif
-
-}
-
-
-/****************************
-** FreeMemory
-** This is the reverse of AllocateMemory. The memory
-** block passed in is freed. Should an error occur,
-** that error is returned in errorcode.
-*/
-void FreeMemory(void *mempointer, /* Pointer to memory block */
- int *errorcode)
-{
-#ifdef DOS16MEM
-/*
-** 16-bit DOS VERSION!!
-*/
-unsigned int segment;
-unsigned int offset;
-union REGS registers;
-struct SREGS sregisters;
-
-/*
-** First get the segment/offset of the void pointer.
-*/
-segment=FP_SEG(mempointer);
-offset=FP_OFF(mempointer);
-
-/*
-** Align the segment properly. For as long as offset > 16,
-** subtract 16 from offset and add 1 to segment.
-*/
-while(offset>=16)
-{ offset-=16;
- segment++;
-}
-
-/*
-** Build the call to DOS
-*/
-registers.h.ah=0x49; /* Free memory */
-sregisters.es=segment;
-
-intdosx(&registers,&registers,&sregisters);
-
-/*
-** Check for error
-*/
-if(registers.x.cflag)
-{ *errorcode=ERROR_MEMORY;
- return;
-}
-
-*errorcode=0;
-return;
-#endif
-
-#ifdef MACMEM
-DisposPtr((Ptr)mempointer);
-*errorcode=0;
-return;
-#endif
-
-#ifdef MALLOCMEM
-ulong adj_addr, true_addr;
-
-/* Locate item in memory array */
-adj_addr=(ulong)mempointer;
-if(RemoveMemArray(adj_addr, &true_addr))
-{ *errorcode=ERROR_MEMARRAY_NFOUND;
- return;
-}
-mempointer=(void *)true_addr;
-free(mempointer);
-*errorcode=0;
-return;
-#endif
-}
-
-/****************************
-** MoveMemory
-** Moves n bytes from a to b. Handles overlap.
-** In most cases, this is just a memmove operation.
-** But, not in DOS....noooo....
-*/
-void MoveMemory( void *destination, /* Destination address */
- void *source, /* Source address */
- unsigned long nbytes)
-{
-
-/* +++16-bit DOS VERSION+++ */
-#ifdef DOS16MEM
-
- FarDOSmemmove( destination, source, nbytes);
-
-#else
-
-memmove(destination, source, nbytes);
-
-#endif
-}
-
-#ifdef DOS16MEM
-
-/****************************
-** FarDOSmemmove
-** Performs the same function as memmove for DOS when
-** the arrays are defined with far pointers.
-*/
-void FarDOSmemmove(void *destination, /* Destination pointer */
- void *source, /* Source pointer */
- unsigned long nbytes) /* # of bytes to move */
-{
-unsigned char huge *uchsource; /* Temp source */
-unsigned char huge *uchdest; /* Temp destination */
-unsigned long saddr; /* Source "true" address */
-unsigned long daddr; /* Destination "true" address */
-
-
-/*
-** Get unsigned char pointer equivalents
-*/
-uchsource=(unsigned char huge *)source;
-uchdest=(unsigned char huge *)destination;
-
-/*
-** Calculate true address of source and destination and
-** compare.
-*/
-saddr=(unsigned long)(FP_SEG(source)*16 + FP_OFF(source));
-daddr=(unsigned long)(FP_SEG(destination)*16 + FP_OFF(destination));
-
-if(saddr > daddr)
-{
- /*
- ** Source is greater than destination.
- ** Use a series of standard move operations.
- ** We'll move 65535 bytes at a time.
- */
- while(nbytes>=65535L)
- { _fmemmove((void *)uchdest,
- (void *)uchsource,
- (size_t) 65535);
- uchsource+=65535; /* Advance pointers */
- uchdest+=65535;
- nbytes-=65535;
- }
-
- /*
- ** Move remaining bytes
- */
- if(nbytes!=0L)
- _fmemmove((void *)uchdest,
- (void *)uchsource,
- (size_t)(nbytes & 0xFFFF));
-
-}
-else
-{
- /*
- ** Destination is greater than source.
- ** Advance pointers to the end of their
- ** respective blocks.
- */
- uchsource+=nbytes;
- uchdest+=nbytes;
-
- /*
- ** Again, move 65535 bytes at a time. However,
- ** "back" the pointers up before doing the
- ** move.
- */
- while(nbytes>=65535L)
- {
- uchsource-=65535;
- uchdest-=65535;
- _fmemmove((void *)uchdest,
- (void *)uchsource,
- (size_t) 65535);
- nbytes-=65535;
- }
-
- /*
- ** Move remaining bytes.
- */
- if(nbytes!=0L)
- { uchsource-=nbytes;
- uchdest-=nbytes;
- _fmemmove((void *)uchdest,
- (void *)uchsource,
- (size_t)(nbytes & 0xFFFF));
- }
-}
-return;
-}
-#endif
-
/***********************************
** MEMORY ARRAY HANDLING ROUTINES **
***********************************/
@@ -721,55 +407,6 @@ return;
}
#endif
-
-/********************************
-** ERROR HANDLING ROUTINES **
-********************************/
-
-/****************************
-** ReportError
-** Report error message condition.
-*/
-void ReportError(const char *errorcontext, /* Error context string */
- int errorcode) /* Error code number */
-{
-
-/*
-** Display error context
-*/
-printf("ERROR CONDITION\nContext: %s\n",errorcontext);
-
-/*
-** Display code
-*/
-printf("Code: %d",errorcode);
-
-return;
-}
-
-/****************************
-** ErrorExit
-** Peforms an exit from an error condition.
-*/
-void ErrorExit()
-{
-
-/*
-** For profiling on the Mac with MetroWerks -- 11/17/94 RG
-** Have to do this to turn off profiler.
-*/
-#ifdef MACCWPROF
-#if __profile__
-ProfilerTerm();
-#endif
-#endif
-
-/*
-** FOR NOW...SIMPLE EXIT
-*/
-exit(1);
-}
-
/*****************************
** STOPWATCH ROUTINES **
*****************************/
diff --git a/sysspec.h b/sysspec.h
index af2bd27..2b70321 100644
--- a/sysspec.h
+++ b/sysspec.h
@@ -88,55 +88,15 @@ extern int global_align;
** FUNCTION PROTOTYPES **
****************************/
-void *AllocateMemory(unsigned long nbytes,
- int *errorcode);
-
-void FreeMemory(void *mempointer,
- int *errorcode);
-
-void MoveMemory( void *destination,
- void *source,
- unsigned long nbytes);
-
-#ifdef DOS16MEM
-void FarDOSmemmove(void *destination,
- void *source,
- unsigned long nbytes);
-#endif
-
void InitMemArray(void);
int AddMemArray(unsigned long true_addr, unsigned long adj_addr);
int RemoveMemArray(unsigned long adj_addr,unsigned long *true_addr);
-void ReportError(const char *context, int errorcode);
-
-void ErrorExit();
-
void CreateFile(char *filename,
int *errorcode);
-#ifdef DOS16
-int bmOpenFile(char *fname,
- int *errorcode);
-
-void CloseFile(int fhandle,
- int *errorcode);
-
-void readfile(int fhandle,
- unsigned long offset,
- unsigned long nbytes,
- void *buffer,
- int *errorcode);
-
-void writefile(int fhandle,
- unsigned long offset,
- unsigned long nbytes,
- void *buffer,
- int *errorcode);
-#endif
-
#ifdef LINUX
FILE *bmOpenFile(char *fname,
int *errorcode);