diff --git a/cb/source/a4functs.c b/cb/source/a4functs.c index 819dab635..04fbf37be 100755 --- a/cb/source/a4functs.c +++ b/cb/source/a4functs.c @@ -13,24 +13,24 @@ S4EXPORT long S4FUNCTION a4indexVersion(DATA4 * data) } S4EXPORT int S4FUNCTION a4tagKeyLen(DATA4 * data) -{ +{ const TAG4 * t4 = d4tagDefault(data); return t4->tagFile->expr->len; } S4EXPORT const char * S4FUNCTION a4tagKey(DATA4 * data) -{ +{ const TAG4 * t4 = d4tagDefault(data); return tfile4key(t4->tagFile); -} +} S4EXPORT int S4FUNCTION a4lockTest(DATA4 * data) -{ +{ return d4lockTestFile(data); } S4EXPORT void S4FUNCTION error4hook( CODE4 S4PTR * codebase, int errCode1, long errCode2, const char S4PTR * desc1, const char S4PTR * desc2, const char S4PTR * desc3) { -} \ No newline at end of file +} diff --git a/cb/source/c4.c b/cb/source/c4.c index 5ad5987ed..9efa89362 100755 --- a/cb/source/c4.c +++ b/cb/source/c4.c @@ -649,7 +649,7 @@ void S4FUNCTION c4upper( char *str ) if ( *ptr >= 'a' && *ptr <= 'z' ) *ptr &= 0xDF ; - /* Les accents sont laiss‚ afin d'ˆtre compatible avec toute p‚riph‚rie */ + /* Les accents sont laiss afin d'tre compatible avec toute priphrie */ if ( *ptr >= E4C_CED ) { switch( *ptr ) @@ -712,7 +712,7 @@ void S4FUNCTION c4upper( char *str ) if ( *ptr >= 'A' && *ptr <= 'Z' ) *ptr |= 0x20 ; - /* Les accents sont laiss‚ afin d'ˆtre compatible avec toute p‚riph‚rie */ + /* Les accents sont laiss afin d'tre compatible avec toute priphrie */ if ( *ptr >= E4C_CED ) { switch( *ptr ) @@ -1009,6 +1009,7 @@ void S4FUNCTION c4upper( char *str ) void *c4memmove(void *dest, const void *src, size_t count ) { if ( dest < src ) + { if ( (char *)dest + count <= (char *) src ) { memcpy( dest, src, count ) ; @@ -1022,8 +1023,10 @@ void *c4memmove(void *dest, const void *src, size_t count ) ((char *) dest)[i] = ((char *)src)[i] ; return( dest ) ; } + } if ( src < dest ) + { if ( (char *) src + count <= (char *) dest ) { memcpy( dest, src, count ) ; @@ -1039,6 +1042,7 @@ void *c4memmove(void *dest, const void *src, size_t count ) } return( dest ) ; } + } return( dest ) ; } #endif /* S4NO_MEMMOVE */ diff --git a/cb/source/c4code.c b/cb/source/c4code.c index 4fbdbb6cd..d79fbfde6 100755 --- a/cb/source/c4code.c +++ b/cb/source/c4code.c @@ -407,7 +407,7 @@ int S4FUNCTION code4passwordSet( CODE4 *c4, const char *userId, const char *oldP int S4FUNCTION code4initLow( CODE4 *c4, const char *defaultProtocol, long versionId ) { char v1[10], v2[10] ; - int n; + #ifdef S4TESTING int exclusiveFlag ; int openFlag ; @@ -454,7 +454,7 @@ int S4FUNCTION code4initLow( CODE4 *c4, const char *defaultProtocol, long versio no file open/create incorrectly auto-starts the optimization process ***********************************************************************/ - + #ifdef S4WINDOWS n = SetHandleCount(40); #endif diff --git a/cb/source/d4all.h b/cb/source/d4all.h index 6ff3c2fdb..d37199ac5 100755 --- a/cb/source/d4all.h +++ b/cb/source/d4all.h @@ -3,6 +3,13 @@ #ifndef D4ALL_INC #define D4ALL_INC +#ifdef LINUX +#define S4UNIX +#endif +#ifdef WIN32 +#define S4DLL +#define S4WIN32 +#endif /**********************************************************************/ /********** USER SWITCH SETTINGS AREA ***********/ @@ -62,7 +69,7 @@ /* Error Configuration Options */ /* #define E4ANALYZE */ /* #define E4DEBUG */ -#define E4HOOK +#define E4HOOK /* #define E4LINK */ /* #define E4MISC */ /* #define E4OFF */ @@ -78,14 +85,14 @@ /* #define S4OFF_MEMO */ /* #define S4OFF_MULTI */ /* #define S4OFF_OPTIMIZE */ - #define S4OFF_REPORT + #define S4OFF_REPORT /* #define S4OFF_TRAN */ /* #define S4OFF_WRITE */ /* #define S4OFF_THREAD */ #endif /* Spoken Language Switches */ - #define S4ANSI + #define S4ANSI /* #define S4DICTIONARY */ /* #define S4FINNISH */ /* #define S4FRENCH */ @@ -100,6 +107,7 @@ #include #include + #ifdef S4UNIX #include "p4port.h" #else diff --git a/cb/source/d4data.c b/cb/source/d4data.c index 4ac51a459..aaf144a97 100755 --- a/cb/source/d4data.c +++ b/cb/source/d4data.c @@ -305,6 +305,7 @@ int S4FUNCTION d4log( DATA4 *data, const int logging ) oldVal = ( data->logVal == 0 ) ? 0 : 1 ; if ( logging != -1 ) + { if ( logging ) { if ( data->logVal == LOG4TRANS ) @@ -313,6 +314,7 @@ int S4FUNCTION d4log( DATA4 *data, const int logging ) else if ( data->logVal == LOG4ON ) data->logVal = LOG4TRANS ; + } return oldVal ; } diff --git a/cb/source/d4declar.h b/cb/source/d4declar.h index 73d6f2f7f..f3f45db83 100755 --- a/cb/source/d4declar.h +++ b/cb/source/d4declar.h @@ -849,7 +849,7 @@ int l4lockCheck( void ) ; void l4lockRemove( int, long, long ) ; void l4lockSave( int, long, long ) ; -static Y4CHUNK *mem4allocChunkDefault( MEM4 * ) ; /* 0 Parm causes 0 return */ +Y4CHUNK *mem4allocChunkDefault( MEM4 * ) ; /* 0 Parm causes 0 return */ // verificare void mem4init( void ) ; int mem4reset( void ) ; #ifdef S4MEM_DBF @@ -1138,5 +1138,6 @@ S4LONG x4reverseLong( const void S4PTR * ) ; void t4noChangeStr( char *, const char *, const int ) ; void t4noChangeDouble( char *, const double ) ; #endif - -#include "a4declar.h" \ No newline at end of file + +#include "a4declar.h" + diff --git a/cb/source/d4index.c b/cb/source/d4index.c index 30b2c427d..60a2130a0 100755 --- a/cb/source/d4index.c +++ b/cb/source/d4index.c @@ -55,7 +55,7 @@ INDEX4 *S4FUNCTION d4index( DATA4 *data, const char *indexName ) char indexLookup2[258] ; #endif INDEX4 *indexOn ; - unsigned int i, extIndex ; + unsigned int i, extIndex = 0; int doAlias, hasExt, hasPath ; #ifdef S4VBASIC diff --git a/cb/source/e4expr.c b/cb/source/e4expr.c index 7d80c5afd..b16df757a 100755 --- a/cb/source/e4expr.c +++ b/cb/source/e4expr.c @@ -101,7 +101,7 @@ void t4intToFox( char *result, const long *val ) void t4curToFox( char *result, const CURRENCY4 *source ) { - char i ; + int i ; int isPositive ; isPositive = ( (short int)(source->lo[3]) >= 0 ) ; @@ -142,7 +142,7 @@ void t4dblToCurFox( char *result, const double doub ) void t4dblToFox( char *result, const double doub ) { - char i ; + int i ; int isPositive ; isPositive = ( doub >= 0 ) ; diff --git a/cb/source/e4functi.c b/cb/source/e4functi.c index 93aaabc17..efd194c11 100755 --- a/cb/source/e4functi.c +++ b/cb/source/e4functi.c @@ -1246,7 +1246,7 @@ void e4ascend() void e4descend() { #ifdef S4FOX - char loop ; + int loop ; #endif e4ascend() ; diff --git a/cb/source/e4parse.c b/cb/source/e4parse.c index 6b6b428c6..b8f5bd192 100755 --- a/cb/source/e4parse.c +++ b/cb/source/e4parse.c @@ -469,7 +469,7 @@ static int e4massage( E4PARSE *p4 ) case r4date: { int rem ; - if (rem=position[numParms]%sizeof(double)) + if ((rem=position[numParms]%sizeof(double))) delta=sizeof(double)-rem; } } @@ -1025,7 +1025,7 @@ int expr4parseFunction( E4PARSE *p4, const char *startPtr, const int fLen ) e4functionPop( &p4->expr ) ; numParms-- ; } - if ( numParms == 3 && fNum == E4SUBSTR || numParms == 2 && fNum == E4LEFT ) + if ((numParms == 3 && fNum == E4SUBSTR) || (numParms == 2 && fNum == E4LEFT)) { info = (E4INFO *)p4->codeBase->exprWorkBuf + p4->expr.infoN -1 ; if ( info->functionI != E4DOUBLE ) diff --git a/cb/source/f4create.c b/cb/source/f4create.c index 29ebe5a3f..f54e1a5af 100755 --- a/cb/source/f4create.c +++ b/cb/source/f4create.c @@ -130,7 +130,7 @@ #ifdef S4UNIX static int file4createLow( FILE4 *file, CODE4 *c4, const char *name ) { - int extraFlag, oflag, pmode ; + int oflag, pmode ; int rc = 0 ; #ifdef S4NO_FLOCK struct flock lck; diff --git a/cb/source/i4add.c b/cb/source/i4add.c index 94db77014..7bae57cc3 100755 --- a/cb/source/i4add.c +++ b/cb/source/i4add.c @@ -338,7 +338,7 @@ static int i4addOneTag( INDEX4 *i4, const TAG4INFO *tagData ) { int rc ; TAG4 *tagPtr ; - TAG4FILE *tagFile ; + TAG4FILE *tagFile = NULL ; R4REINDEX reindex ; DATA4 *d4 ; CODE4 *c4 ; diff --git a/cb/source/i4tag.c b/cb/source/i4tag.c index d7d55329b..f2d6def32 100755 --- a/cb/source/i4tag.c +++ b/cb/source/i4tag.c @@ -1535,8 +1535,8 @@ S4EXPORT long S4FUNCTION tfile4skip( TAG4FILE *t4, long numSkip ) if ( goTo == -1 ) { - if ( numSkip > 0 && t4->header.descending == 0 || - numSkip <= 0 && t4->header.descending == 1 ) + if ((numSkip > 0 && t4->header.descending == 0) || + (numSkip <= 0 && t4->header.descending == 1)) { saveDups = tfile4block( t4 )->curDupCnt ; rc = tfile4bottom( t4 ) ; diff --git a/cb/source/m4memory.c b/cb/source/m4memory.c index 6fc3a14f7..db3d93bb0 100755 --- a/cb/source/m4memory.c +++ b/cb/source/m4memory.c @@ -384,7 +384,7 @@ void *S4FUNCTION mem4allocDefault( MEM4 *memoryType ) return mem4alloc2Default( memoryType, 0 ) ; } -static Y4CHUNK *mem4allocChunkDefault( MEM4 *typePtr ) +Y4CHUNK *mem4allocChunkDefault( MEM4 *typePtr ) { Y4CHUNK *chunkPtr ; int nAllocate, i ; diff --git a/cb/source/o4opt.c b/cb/source/o4opt.c index 727a4c6a0..32fd5770c 100755 --- a/cb/source/o4opt.c +++ b/cb/source/o4opt.c @@ -337,7 +337,7 @@ int opt4flushAll( OPT4 *opt, char doFree ) OPT4BLOCK *blockOn ; LINK4 *linkOn, *nextLink ; LIST4 *flushList ; - char i ; + int i ; int rc, saveRc ; #ifdef E4PARM_LOW @@ -842,7 +842,7 @@ int opt4fileWrite( FILE4 *file, long pos, unsigned len, const void *data, char c unsigned readLen, lenRead, extraRead ; OPT4BLOCK *blockOn ; OPT4 *opt ; - int doUpgradeCheck ; + int doUpgradeCheck = 0; #ifdef E4PARM_LOW if ( file == 0 || pos < 0 || data == 0 ) diff --git a/cb/source/p4port.h b/cb/source/p4port.h index 02a8322b2..4e5a46e70 100755 --- a/cb/source/p4port.h +++ b/cb/source/p4port.h @@ -21,6 +21,7 @@ #define S4DATA_ALIGN /* Use if data needs to be on byte boundaries */ /* #define S4MEMCMP */ /* use if memcmp() uses signed byte comparison */ + #define S4LOCKF /* #define S4NO_ATOF */ /* use if atof() not found */ #define S4NO_CHSIZE /* use if chsize() not found */ /* #define S4NO_ECVT */ /* use if ecvt() not found */ diff --git a/cb/source/u4name.c b/cb/source/u4name.c index cabb3ea23..f78c22922 100755 --- a/cb/source/u4name.c +++ b/cb/source/u4name.c @@ -80,7 +80,7 @@ static int u4nameFix( char *buf ) len = strlen( buf ) ; for( i = 0 ; i < len - 2 ; i++ ) - { + { /* #ifdef S4UNIX if ( c4memcmp(buf+i, "../", 3 ) == 0 ) @@ -113,8 +113,8 @@ static int u4nameFix( char *buf ) } for( i = 0 ; i < len - 1 ; i++ ) - { -/* + { +/* #ifdef S4UNIX if ( c4memcmp( buf + i, "./", 2 ) == 0 ) #else @@ -466,7 +466,7 @@ int S4FUNCTION u4nameChar( unsigned char ch) #ifdef S4MDX ((ch>='0') && (ch<='9')) || ch=='&' || ch=='@' || #else - ch>='0' && ch<='9' || + (ch>='0' && ch<='9') || #endif ch=='_' /* ch=='\\' || ch=='.' || ch=='_' || ch==':' */ @@ -542,8 +542,8 @@ int u4namePath( char *result, const unsigned int lenResult, const char *from ) /* returns the length of the extension in 'from', and copies the extension in 'from' to 'result' */ int u4nameRetExt( char *result, const int lenIn, const char *from ) { - char len, name[LEN4PATH+1] ; - int lenResult, onPos ; + char name[LEN4PATH+1] ; + int lenResult, onPos, len ; lenResult = lenIn ; memset( result, 0, lenIn ) ;