diff options
Diffstat (limited to 'storage/connect/filamap.cpp')
-rw-r--r-- | storage/connect/filamap.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/storage/connect/filamap.cpp b/storage/connect/filamap.cpp index 08f87e2b836..5cf9a4d945c 100644 --- a/storage/connect/filamap.cpp +++ b/storage/connect/filamap.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -17,12 +17,12 @@ /* Include relevant sections of the System header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #if defined(__BORLANDC__) #define __MFC_COMPAT__ // To define min/max as macro #endif // __BORLANDC__ //#include <windows.h> -#else // !WIN32 +#else // !__WIN__ #if defined(UNIX) #include <errno.h> #include <unistd.h> @@ -30,7 +30,7 @@ #include <io.h> #endif // !UNIX #include <fcntl.h> -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include application header files: */ @@ -191,11 +191,11 @@ bool MAPFAM::OpenTableFile(PGLOBAL g) return true; } // endif Memory -#if defined(WIN32) +#if defined(__WIN__) if (mode != MODE_DELETE) { -#else // !WIN32 +#else // !__WIN__ if (mode == MODE_READ) { -#endif // !WIN32 +#endif // !__WIN__ CloseFileHandle(hFile); // Not used anymore hFile = INVALID_HANDLE_VALUE; // For Fblock } // endif Mode @@ -207,8 +207,7 @@ bool MAPFAM::OpenTableFile(PGLOBAL g) /*******************************************************************/ fp = (PFBLOCK)PlugSubAlloc(g, NULL, sizeof(FBLOCK)); fp->Type = TYPE_FB_MAP; - fp->Fname = (char*)PlugSubAlloc(g, NULL, strlen(filename) + 1); - strcpy((char*)fp->Fname, filename); + fp->Fname = PlugDup(g, filename); fp->Next = dbuserp->Openlist; dbuserp->Openlist = fp; fp->Count = 1; @@ -277,7 +276,7 @@ bool MAPFAM::SetPos(PGLOBAL g, int pos) /***********************************************************************/ /* Record file position in case of UPDATE or DELETE. */ /***********************************************************************/ -bool MAPFAM::RecordPos(PGLOBAL g) +bool MAPFAM::RecordPos(PGLOBAL) { Fpos = Mempos; return false; @@ -286,7 +285,7 @@ bool MAPFAM::RecordPos(PGLOBAL g) /***********************************************************************/ /* Initialize Fpos and Mempos for indexed DELETE. */ /***********************************************************************/ -int MAPFAM::InitDelete(PGLOBAL g, int fpos, int spos) +int MAPFAM::InitDelete(PGLOBAL, int fpos, int spos) { Fpos = Memory + (ptrdiff_t)fpos; Mempos = Memory + (ptrdiff_t)spos; @@ -372,7 +371,7 @@ int MAPFAM::ReadBuffer(PGLOBAL g) /***********************************************************************/ /* WriteBuffer: File write routine for MAP access method. */ /***********************************************************************/ -int MAPFAM::WriteBuffer(PGLOBAL g) +int MAPFAM::WriteBuffer(PGLOBAL g __attribute__((unused))) { #if defined(_DEBUG) // Insert mode is no more handled using file mapping @@ -453,7 +452,7 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc) /*****************************************************************/ n = Tpos - Memory; -#if defined(WIN32) +#if defined(__WIN__) DWORD drc = SetFilePointer(fp->Handle, n, NULL, FILE_BEGIN); if (drc == 0xFFFFFFFF) { @@ -483,7 +482,7 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc) #endif // UNIX } // endif Abort -#if defined(WIN32) +#if defined(__WIN__) CloseHandle(fp->Handle); #else // UNIX close(fp->Handle); @@ -496,7 +495,7 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc) /***********************************************************************/ /* Table file close routine for MAP access method. */ /***********************************************************************/ -void MAPFAM::CloseTableFile(PGLOBAL g, bool abort) +void MAPFAM::CloseTableFile(PGLOBAL g, bool) { PlugCloseFile(g, To_Fb); To_Fb = NULL; // To get correct file size in Cardinality @@ -552,7 +551,7 @@ int MBKFAM::Cardinality(PGLOBAL g) /***********************************************************************/ /* Skip one record in file. */ /***********************************************************************/ -int MBKFAM::SkipRecord(PGLOBAL g, bool header) +int MBKFAM::SkipRecord(PGLOBAL, bool) { return RC_OK; } // end of SkipRecord @@ -686,7 +685,7 @@ bool MPXFAM::SetPos(PGLOBAL g, int pos) /***********************************************************************/ /* Initialize CurBlk, CurNum, Mempos and Fpos for indexed DELETE. */ /***********************************************************************/ -int MPXFAM::InitDelete(PGLOBAL g, int fpos, int spos) +int MPXFAM::InitDelete(PGLOBAL, int fpos, int) { Fpos = Memory + Headlen + (ptrdiff_t)fpos * Lrecl; Mempos = Fpos + Lrecl; @@ -741,7 +740,7 @@ int MPXFAM::ReadBuffer(PGLOBAL g) /***********************************************************************/ /* WriteBuffer: File write routine for MAP access method. */ /***********************************************************************/ -int MPXFAM::WriteBuffer(PGLOBAL g) +int MPXFAM::WriteBuffer(PGLOBAL g __attribute__((unused))) { #if defined(_DEBUG) // Insert mode is no more handled using file mapping |