From e7fea4f102cb7b60d55040786e18503a4725e7b8 Mon Sep 17 00:00:00 2001 From: "Christopher J. Morrone" Date: Fri, 11 Nov 2011 15:18:17 -0800 Subject: [PATCH] Fix prototype locations --- src/aiori-HDF5.c | 2 -- src/aiori-MPIIO.c | 2 -- src/aiori-NCMPI.c | 2 -- src/aiori.h | 2 ++ src/ior.h | 3 --- src/utilities.c | 69 +++++++++++++++++++++++------------------------ 6 files changed, 36 insertions(+), 44 deletions(-) diff --git a/src/aiori-HDF5.c b/src/aiori-HDF5.c index 677ed7b..6ed6a96 100644 --- a/src/aiori-HDF5.c +++ b/src/aiori-HDF5.c @@ -70,9 +70,7 @@ /**************************** P R O T O T Y P E S *****************************/ static IOR_offset_t SeekOffset_HDF5(void *, IOR_offset_t, IOR_param_t *); -void SetHints(MPI_Info *, char *); void SetupDataSet_HDF5(void *, IOR_param_t *); -void ShowHints(MPI_Info *); void *IOR_Create_HDF5(char *, IOR_param_t *); void *IOR_Open_HDF5(char *, IOR_param_t *); diff --git a/src/aiori-MPIIO.c b/src/aiori-MPIIO.c index ad4762d..628ee08 100644 --- a/src/aiori-MPIIO.c +++ b/src/aiori-MPIIO.c @@ -23,8 +23,6 @@ /**************************** P R O T O T Y P E S *****************************/ static IOR_offset_t SeekOffset_MPIIO(MPI_File, IOR_offset_t, IOR_param_t *); -void SetHints(MPI_Info *, char *); -void ShowHints(MPI_Info *); void *IOR_Create_MPIIO(char *, IOR_param_t *); void *IOR_Open_MPIIO(char *, IOR_param_t *); diff --git a/src/aiori-NCMPI.c b/src/aiori-NCMPI.c index 84800c3..ea6cd52 100644 --- a/src/aiori-NCMPI.c +++ b/src/aiori-NCMPI.c @@ -37,8 +37,6 @@ /**************************** P R O T O T Y P E S *****************************/ static int GetFileMode(IOR_param_t *); -void SetHints(MPI_Info *, char *); -void ShowHints(MPI_Info *); void *IOR_Create_NCMPI(char *, IOR_param_t *); void *IOR_Open_NCMPI(char *, IOR_param_t *); diff --git a/src/aiori.h b/src/aiori.h index 47056a7..d1b49ce 100644 --- a/src/aiori.h +++ b/src/aiori.h @@ -183,5 +183,7 @@ typedef struct ior_aiori { } ior_aiori_t; void init_IOR_Param_t(IOR_param_t *p); +void SetHints (MPI_Info *, char *); +void ShowHints (MPI_Info *); #endif /* not _AIORI_H */ diff --git a/src/ior.h b/src/ior.h index 79553fa..9d52c81 100644 --- a/src/ior.h +++ b/src/ior.h @@ -81,13 +81,10 @@ void WriteTimes (IOR_param_t *, double **, int, int); char * CurrentTimeString(void); void DumpBuffer (void *, size_t); void ExtractHint (char *, char *, char *); -void SetHints (MPI_Info *, char *); -void ShowHints (MPI_Info *); IOR_offset_t StringToBytes (char *); #if USE_UNDOC_OPT void CorruptFile (char *, IOR_param_t *, int, int); -void ModifyByteInFile (char *, IOR_offset_t, int); #endif /* USE_UNDOC_OPTS */ void SeedRandGen (MPI_Comm); diff --git a/src/utilities.c b/src/utilities.c index 4b0fb19..0aa4ca9 100644 --- a/src/utilities.c +++ b/src/utilities.c @@ -381,6 +381,40 @@ int Regex(char *string, char *pattern) } #if USE_UNDOC_OPT /* corruptFile */ +/* + * Modify byte in file - used to testing write/read data checking. + */ +static void ModifyByteInFile(char *fileName, IOR_offset_t offset, int byteValue) +{ + int fd; + int rc; + char old; + char new; + + new = (char)byteValue; + + /* open file, show old value, update to new value */ + fd = open(fileName, O_RDWR); + rc = lseek(fd, offset, SEEK_SET); + if (rc == -1) + goto out; + rc = read(fd, &old, 1); + if (rc == -1) + goto out; + rc = lseek(fd, offset, SEEK_SET); + if (rc == -1) + goto out; + rc = write(fd, &new, 1); + if (rc == -1) + goto out; + fprintf(stdout, + "** DEBUG: offset %lld in %s changed from %d to %d **\n", + offset, fileName, (unsigned char)old, (unsigned char)new); + + out: + close(fd); + return; +} /* * Corrupt file to testing data checking options. */ @@ -417,41 +451,6 @@ void CorruptFile(char *testFileName, IOR_param_t * test, int rep, int access) return; } - -/* - * Modify byte in file - used to testing write/read data checking. - */ -void ModifyByteInFile(char *fileName, IOR_offset_t offset, int byteValue) -{ - int fd; - int rc; - char old; - char new; - - new = (char)byteValue; - - /* open file, show old value, update to new value */ - fd = open(fileName, O_RDWR); - rc = lseek(fd, offset, SEEK_SET); - if (rc == -1) - goto out; - rc = read(fd, &old, 1); - if (rc == -1) - goto out; - rc = lseek(fd, offset, SEEK_SET); - if (rc == -1) - goto out; - rc = write(fd, &new, 1); - if (rc == -1) - goto out; - fprintf(stdout, - "** DEBUG: offset %lld in %s changed from %d to %d **\n", - offset, fileName, (unsigned char)old, (unsigned char)new); - - out: - close(fd); - return; -} #endif /* USE_UNDOC_OPT - corruptFile */ /*