1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-05 04:30:38 +03:00

Fix compilation warnings shown when using strict GCC options for os_os2.c. (CVS 4154)

FossilOrigin-Name: 22277b7e1b3eb1678280de5d49a6613908ab4bff
This commit is contained in:
pweilbacher
2007-07-03 23:37:09 +00:00
parent 2ac2762f37
commit d8e9b6238e
3 changed files with 21 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
C Fix\sa\smemory\sleak\sin\sshell.c.\sReported\son\sthe\smailing\slist.\sThis\shas\sonly\sbeen\sinformally\stested.\s(CVS\s4153) C Fix\scompilation\swarnings\sshown\swhen\susing\sstrict\sGCC\soptions\sfor\sos_os2.c.\s(CVS\s4154)
D 2007-07-03T05:31:16 D 2007-07-03T23:37:10
F Makefile.in 0c0e53720f658c7a551046442dd7afba0b72bfbe F Makefile.in 0c0e53720f658c7a551046442dd7afba0b72bfbe
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -89,7 +89,7 @@ F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217
F src/os.c 1f10b47acc1177fb9225edb4f5f0d25ed716f9cb F src/os.c 1f10b47acc1177fb9225edb4f5f0d25ed716f9cb
F src/os.h cea2e179bb33f4fc09dbb9fcd51b2246544bd2db F src/os.h cea2e179bb33f4fc09dbb9fcd51b2246544bd2db
F src/os_common.h a38233cd3b1f260db6f01f1093295d5708130065 F src/os_common.h a38233cd3b1f260db6f01f1093295d5708130065
F src/os_os2.c a8220ba38b6f376d10f99d0d7a5ee833173fcc5c F src/os_os2.c cba4e96fadb949076c717108fe0599d1a3c2e446
F src/os_os2.h e5f17dd69333632bbc3112881ea407c37d245eb3 F src/os_os2.h e5f17dd69333632bbc3112881ea407c37d245eb3
F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c
F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3
@@ -517,7 +517,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 25e6df9cdd7d0cbb2bdee9ce76806cfd08314212 P a008905b39e7d4cd5b39db4906eb3b678e3ee8b7
R 1119faa3ec9fa2274abccccd3467ef67 R fcaa96aff11568197bd54bb05e1792e5
U danielk1977 U pweilbacher
Z aeb398c67bd2b4b8c263b0b6ba675a9a Z 28ac054b7b1d0b8bc9940855c6db01ec

View File

@@ -1 +1 @@
a008905b39e7d4cd5b39db4906eb3b678e3ee8b7 22277b7e1b3eb1678280de5d49a6613908ab4bff

View File

@@ -161,7 +161,7 @@ int sqlite3Os2OpenExclusive( const char *zFilename, OsFile **pld, int delFlag ){
f.delOnClose = delFlag ? 1 : 0; f.delOnClose = delFlag ? 1 : 0;
f.pathToDel = delFlag ? sqlite3OsFullPathname( zFilename ) : NULL; f.pathToDel = delFlag ? sqlite3OsFullPathname( zFilename ) : NULL;
OpenCounter( +1 ); OpenCounter( +1 );
if( delFlag ) DosForceDelete( sqlite3OsFullPathname( zFilename ) ); if( delFlag ) DosForceDelete( (PSZ)sqlite3OsFullPathname( zFilename ) );
OSTRACE3( "OPEN EX %d \"%s\"\n", hf, sqlite3OsFullPathname ( zFilename ) ); OSTRACE3( "OPEN EX %d \"%s\"\n", hf, sqlite3OsFullPathname ( zFilename ) );
return allocateOs2File( &f, pld ); return allocateOs2File( &f, pld );
} }
@@ -230,12 +230,12 @@ int sqlite3Os2TempFileName( char *zBuf ){
"0123456789"; "0123456789";
int i, j; int i, j;
PSZ zTempPath = 0; PSZ zTempPath = 0;
if( DosScanEnv( "TEMP", &zTempPath ) ){ if( DosScanEnv( (PSZ)"TEMP", &zTempPath ) ){
if( DosScanEnv( "TMP", &zTempPath ) ){ if( DosScanEnv( (PSZ)"TMP", &zTempPath ) ){
if( DosScanEnv( "TMPDIR", &zTempPath ) ){ if( DosScanEnv( (PSZ)"TMPDIR", &zTempPath ) ){
ULONG ulDriveNum = 0, ulDriveMap = 0; ULONG ulDriveNum = 0, ulDriveMap = 0;
DosQueryCurrentDisk( &ulDriveNum, &ulDriveMap ); DosQueryCurrentDisk( &ulDriveNum, &ulDriveMap );
sprintf( zTempPath, "%c:", (char)( 'A' + ulDriveNum - 1 ) ); sprintf( (char*)zTempPath, "%c:", (char)( 'A' + ulDriveNum - 1 ) );
} }
} }
} }
@@ -264,7 +264,7 @@ int os2Close( OsFile **pld ){
rc = DosClose( pFile->h ); rc = DosClose( pFile->h );
pFile->locktype = NO_LOCK; pFile->locktype = NO_LOCK;
if( pFile->delOnClose != 0 ){ if( pFile->delOnClose != 0 ){
rc = DosForceDelete( pFile->pathToDel ); rc = DosForceDelete( (PSZ)pFile->pathToDel );
} }
*pld = 0; *pld = 0;
OpenCounter( -1 ); OpenCounter( -1 );
@@ -286,7 +286,7 @@ int os2Read( OsFile *id, void *pBuf, int amt ){
DosRead( ((os2File*)id)->h, pBuf, amt, &got ); DosRead( ((os2File*)id)->h, pBuf, amt, &got );
if (got == (ULONG)amt) if (got == (ULONG)amt)
return SQLITE_OK; return SQLITE_OK;
else if (got < 0) else if (got == 0)
return SQLITE_IOERR_READ; return SQLITE_IOERR_READ;
else { else {
memset(&((char*)pBuf)[got], 0, amt-got); memset(&((char*)pBuf)[got], 0, amt-got);
@@ -691,7 +691,7 @@ char *sqlite3Os2FullPathname( const char *zRelative ){
zBuff = sqliteMalloc( cbzBufLen ); zBuff = sqliteMalloc( cbzBufLen );
if( zBuff != 0 ){ if( zBuff != 0 ){
DosQueryCurrentDisk( &ulDriveNum, &ulDriveMap ); DosQueryCurrentDisk( &ulDriveNum, &ulDriveMap );
if( DosQueryCurrentDir( ulDriveNum, zBuff, &cbzBufLen ) == NO_ERROR ){ if( DosQueryCurrentDir( ulDriveNum, (PBYTE)zBuff, &cbzBufLen ) == NO_ERROR ){
sprintf( zDrive, "%c", (char)('A' + ulDriveNum - 1) ); sprintf( zDrive, "%c", (char)('A' + ulDriveNum - 1) );
sqlite3SetString( &zFull, zDrive, ":\\", zBuff, sqlite3SetString( &zFull, zDrive, ":\\", zBuff,
"\\", zRelative, (char*)0 ); "\\", zRelative, (char*)0 );
@@ -799,7 +799,7 @@ void *sqlite3Os2Dlopen(const char *zFilename){
UCHAR loadErr[256]; UCHAR loadErr[256];
HMODULE hmod; HMODULE hmod;
APIRET rc; APIRET rc;
rc = DosLoadModule(loadErr, sizeof(loadErr), zFilename, &hmod); rc = DosLoadModule((PSZ)loadErr, sizeof(loadErr), zFilename, &hmod);
if (rc != NO_ERROR) return 0; if (rc != NO_ERROR) return 0;
return (void*)hmod; return (void*)hmod;
} }
@@ -816,7 +816,7 @@ void *sqlite3Os2Dlsym(void *pHandle, const char *zSymbol){
rc = DosQueryProcAddr((HMODULE)pHandle, 0L, _zSymbol, &pfn); rc = DosQueryProcAddr((HMODULE)pHandle, 0L, _zSymbol, &pfn);
} }
if (rc != NO_ERROR) return 0; if (rc != NO_ERROR) return 0;
return pfn; return (void *)pfn;
} }
int sqlite3Os2Dlclose(void *pHandle){ int sqlite3Os2Dlclose(void *pHandle){
return DosFreeModule((HMODULE)pHandle); return DosFreeModule((HMODULE)pHandle);
@@ -872,8 +872,8 @@ static ULONG mutexOwner;
** code and what little there is executes quickly and without blocking. ** code and what little there is executes quickly and without blocking.
*/ */
void sqlite3Os2EnterMutex(){ void sqlite3Os2EnterMutex(){
PTIB ptib;
#ifdef SQLITE_OS2_THREADS #ifdef SQLITE_OS2_THREADS
PTIB ptib;
DosEnterCritSec(); DosEnterCritSec();
DosGetInfoBlocks( &ptib, NULL ); DosGetInfoBlocks( &ptib, NULL );
mutexOwner = ptib->tib_ptib2->tib2_ultid; mutexOwner = ptib->tib_ptib2->tib2_ultid;
@@ -882,7 +882,9 @@ void sqlite3Os2EnterMutex(){
inMutex = 1; inMutex = 1;
} }
void sqlite3Os2LeaveMutex(){ void sqlite3Os2LeaveMutex(){
#ifdef SQLITE_OS2_THREADS
PTIB ptib; PTIB ptib;
#endif
assert( inMutex ); assert( inMutex );
inMutex = 0; inMutex = 0;
#ifdef SQLITE_OS2_THREADS #ifdef SQLITE_OS2_THREADS