summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-13 23:00:00 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-13 23:00:00 +0000
commit8c05353f47d25c1a097d3938333ba212f12b3ea2 (patch)
tree29ae7e122cbda9aaf1322a8fd89f1c52c86810af
parentb59b0af0b26bcca27af0216309c15da663bcd9b7 (diff)
-- Remove Win31, DOS, and Mac cruft
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@20 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
-rw-r--r--nbench0.h43
-rw-r--r--sysspec.c154
-rw-r--r--sysspec.h38
3 files changed, 0 insertions, 235 deletions
diff --git a/nbench0.h b/nbench0.h
index 947feba..b2bad7c 100644
--- a/nbench0.h
+++ b/nbench0.h
@@ -256,43 +256,6 @@ void *global_fstruct[] =
(void *)&global_lustruct };
/*
-** Following globals added to support command line emulation on
-** the Macintosh....which doesn't have command lines.
-*/
-#ifdef MAC
-int argc; /* Argument count */
-char *argv[20]; /* Argument vectors */
-
-unsigned char Uargbuff[129]; /* Buffer holding arguments string */
-unsigned char Udummy[2]; /* Dummy buffer for first arg */
-
-#endif
-
-#ifdef MACTIMEMGR
-#include <Types.h>
-#include <Timer.h>
-/*
-** Timer globals for Mac
-*/
-struct TMTask myTMTask;
-long MacHSTdelay,MacHSTohead;
-
-#endif
-
-/*
-** Following globals used by Win 31 timing routines.
-** NOTE: This requires the includes of the w31timer.asm
-** file in your project!!
-*/
-#ifdef WIN31TIMER
-#include <windows.h>
-#include <toolhelp.h>
-extern TIMERINFO win31tinfo;
-extern HANDLE hThlp;
-extern FARPROC lpfn;
-#endif
-
-/*
** PROTOTYPES
*/
static int parse_arg(char *argptr);
@@ -315,12 +278,6 @@ static int calc_confidence(double scores[],
static double getscore(int fid);
static void show_stats(int bid);
-#ifdef MAC
-void UCommandLine(void);
-void UParse(void);
-unsigned char *UField(unsigned char *ptr);
-#endif
-
/*
** EXTERNAL PROTOTYPES
*/
diff --git a/sysspec.c b/sysspec.c
index 121eac4..73b74fb 100644
--- a/sysspec.c
+++ b/sysspec.c
@@ -117,30 +117,6 @@ return(-1);
void CreateFile(char *filename,
int *errorcode)
{
-
-#ifdef DOS16
-/*
-** DOS VERSION!!
-*/
-int fhandle; /* File handle used internally */
-
-fhandle=open(filename,O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
-
-if(fhandle==-1)
- *errorcode=ERROR_FILECREATE;
-else
- *errorcode=0;
-
-/*
-** Since all we're doing here is creating the file,
-** go ahead and close it.
-*/
-close(fhandle);
-
-return;
-#endif
-
-#ifdef __linux__
FILE *fhandle; /* File handle used internally */
fhandle=fopen(filename,"w");
@@ -155,9 +131,6 @@ else
** go ahead and close it.
*/
fclose(fhandle);
-
-return;
-#endif
}
/****************************
@@ -166,31 +139,6 @@ return;
** If an error occurs, returns its code in errorcode.
** The file is opened in read-write exclusive mode.
*/
-#ifdef DOS16
-/*
-** DOS VERSION!!
-*/
-
-int bmOpenFile(char *fname, /* File name */
- int *errorcode) /* Error code returned */
-{
-
-int fhandle; /* Returned file handle */
-
-fhandle=open(fname,O_BINARY | O_RDWR, S_IREAD | S_IWRITE);
-
-if(fhandle==-1)
- *errorcode=ERROR_FILEOPEN;
-else
- *errorcode=0;
-
-return(fhandle);
-}
-#endif
-
-
-#ifdef __linux__
-
FILE *bmOpenFile(char *fname, /* File name */
int *errorcode) /* Error code returned */
{
@@ -206,7 +154,6 @@ else
return(fhandle);
}
-#endif
/****************************
@@ -214,20 +161,6 @@ return(fhandle);
** Closes the file identified by fhandle.
** A more inocuous routine there never was.
*/
-#ifdef DOS16
-/*
-** DOS VERSION!!!
-*/
-void CloseFile(int fhandle, /* File handle */
- int *errorcode) /* Returned error code */
-{
-
-close(fhandle);
-*errorcode=0;
-return;
-}
-#endif
-#ifdef __linux__
void CloseFile(FILE *fhandle, /* File handle */
int *errorcode) /* Returned error code */
{
@@ -235,7 +168,6 @@ fclose(fhandle);
*errorcode=0;
return;
}
-#endif
/****************************
** readfile
@@ -244,46 +176,6 @@ return;
** Note that this routine expects the offset to be from
** the beginning of the file.
*/
-#ifdef DOS16
-/*
-** DOS VERSION!!
-*/
-
-void readfile(int fhandle, /* File handle */
- unsigned long offset, /* Offset into file */
- unsigned long nbytes, /* # of bytes to read */
- void *buffer, /* Buffer to read into */
- int *errorcode) /* Returned error code */
-{
-
-long newoffset; /* New offset by lseek */
-int readcode; /* Return code from read */
-
-/*
-** Presume success.
-*/
-*errorcode=0;
-
-/*
-** Seek to the proper offset.
-*/
-newoffset=lseek(fhandle,(long)offset,SEEK_SET);
-if(newoffset==-1L)
-{ *errorcode=ERROR_FILESEEK;
- return;
-}
-
-/*
-** Do the read.
-*/
-readcode=read(fhandle,buffer,(unsigned)(nbytes & 0xFFFF));
-if(readcode==-1)
- *errorcode=ERROR_FILEREAD;
-
-return;
-}
-#endif
-#ifdef __linux__
void readfile(FILE *fhandle, /* File handle */
unsigned long offset, /* Offset into file */
unsigned long nbytes, /* # of bytes to read */
@@ -317,9 +209,7 @@ readcode=fread(buffer,(size_t)1,nelems,fhandle);
if(readcode!=nelems)
*errorcode=ERROR_FILEREAD;
-return;
}
-#endif
/****************************
** writefile
@@ -328,48 +218,6 @@ return;
** Note that this routine expects the offset to be from
** the beinning of the file.
*/
-#ifdef DOS16
-/*
-** DOS VERSION!!
-*/
-
-void writefile(int fhandle, /* File handle */
- unsigned long offset, /* Offset into file */
- unsigned long nbytes, /* # of bytes to read */
- void *buffer, /* Buffer to read into */
- int *errorcode) /* Returned error code */
-{
-
-long newoffset; /* New offset by lseek */
-int writecode; /* Return code from write */
-
-/*
-** Presume success.
-*/
-*errorcode=0;
-
-/*
-** Seek to the proper offset.
-*/
-newoffset=lseek(fhandle,(long)offset,SEEK_SET);
-if(newoffset==-1L)
-{ *errorcode=ERROR_FILESEEK;
- return;
-}
-
-/*
-** Do the write.
-*/
-writecode=write(fhandle,buffer,(unsigned)(nbytes & 0xFFFF));
-if(writecode==-1)
- *errorcode=ERROR_FILEWRITE;
-
-return;
-}
-#endif
-
-#ifdef __linux__
-
void writefile(FILE *fhandle, /* File handle */
unsigned long offset, /* Offset into file */
unsigned long nbytes, /* # of bytes to read */
@@ -403,9 +251,7 @@ writecode=fwrite(buffer,(size_t)1,nelems,fhandle);
if(writecode==nelems)
*errorcode=ERROR_FILEWRITE;
-return;
}
-#endif
/*****************************
** STOPWATCH ROUTINES **
diff --git a/sysspec.h b/sysspec.h
index 8647495..8d49640 100644
--- a/sysspec.h
+++ b/sysspec.h
@@ -42,41 +42,6 @@
** System-specific includes
*/
-#ifdef DOS16MEM
-#include "dos.h"
-#endif
-
-/* #include "time.h"
-#include "io.h"
-#include "fcntl.h"
-#include "sys\stat.h" */
-/* Removed for MSVC++
-#include "alloc.h"
-*/
-
-/*
-** MAC Time Manager routines (from Code Warrior)
-*/
-#ifdef MACTIMEMGR
-#include <memory.h>
-#include <lowmem.h>
-#include <Types.h>
-#include <Timer.h>
-extern struct TMTask myTMTask;
-extern long MacHSTdelay,MacHSTohead;
-#endif
-
-/*
-** Windows 3.1 timer defines
-*/
-#ifdef WIN31TIMER
-#include <windows.h>
-#include <toolhelp.h>
-TIMERINFO win31tinfo;
-HANDLE hThlp;
-FARPROC lpfn;
-#endif
-
/**************
** EXTERNALS **
**************/
@@ -97,7 +62,6 @@ int RemoveMemArray(unsigned long adj_addr,unsigned long *true_addr);
void CreateFile(char *filename,
int *errorcode);
-#ifdef __linux__
FILE *bmOpenFile(char *fname,
int *errorcode);
@@ -116,8 +80,6 @@ void writefile(FILE *fhandle,
void *buffer,
int *errorcode);
-#endif
-
unsigned long StartStopwatch();
unsigned long StopStopwatch(unsigned long startticks);