20000330-13:25 EST <ptucker@sympatico.ca>
This commit is contained in:
@@ -1,3 +1,29 @@
|
||||
20000330-12:15 EST Paul Tucker <ptucker@sympatico.ca>
|
||||
* source/rtl/dates.c
|
||||
* account for possible overflow in calculation
|
||||
* source/rtl/defpath.c
|
||||
* initialise size to 0
|
||||
* source/rtl/environ.c
|
||||
* added missing ; for msc branch
|
||||
* source/rtl/isprint.c
|
||||
* added msc8 support (== _BORLANDC_)
|
||||
* source/rtl/dir.c
|
||||
* source/rtl/gtdos/gtdos.c
|
||||
* source/rtl/gtdos/mousedos.c
|
||||
* modified to work with msc8 (upcoming addition!)
|
||||
* include/hbvmpub.h
|
||||
* change alignment of HB_SYMB for msc8
|
||||
* source/rdd/dbcmd.c
|
||||
* changed if(!(...)) to if((...)==0) in rddInherit for /W4 compiler warning.
|
||||
* initialise uiArraylen in AFIELDS()
|
||||
* initialise ulNext in defEval()
|
||||
* source/rdd/dbf1.c
|
||||
* dbfUpdateRecord() Initialise local ulRecCount!
|
||||
NOTE: Something doesn't look right with the logic here.
|
||||
* dbfReadDBHeader() Init pFieldInfo.uiLen to 0
|
||||
* source/vm/memvars.c
|
||||
* hb_memvarCreateFromItem() Initialize pDynVar to NULL
|
||||
|
||||
20000329-16:33 GMT+1 Victor Szakats <info@szelvesz.hu>
|
||||
|
||||
* include/hbapi.h
|
||||
|
||||
@@ -45,6 +45,8 @@ extern "C" {
|
||||
struct _HB_DYNS;
|
||||
|
||||
/* symbol support structure */
|
||||
#pragma pack(8)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char * szName; /* the name of the symbol */
|
||||
|
||||
@@ -284,7 +284,7 @@ static ERRCODE defError( AREAP pArea, PHB_ITEM pError )
|
||||
static ERRCODE defEval( AREAP pArea, LPDBEVALINFO pEvalInfo )
|
||||
{
|
||||
BOOL bEof, bFor, bWhile;
|
||||
ULONG ulNext;
|
||||
ULONG ulNext = 0;
|
||||
|
||||
HB_TRACE(HB_TR_DEBUG, ("defEval(%p, %p)", pArea, pEvalInfo));
|
||||
|
||||
@@ -1026,7 +1026,7 @@ ERRCODE hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTa
|
||||
return FAILURE;
|
||||
|
||||
/* Copy the pSuperTable into pTable */
|
||||
if( !szDrvName || !( uiCount = strlen( ( const char * ) szDrvName ) ) )
|
||||
if( !szDrvName || ( uiCount = strlen( ( const char * ) szDrvName ) )==0 )
|
||||
{
|
||||
memcpy( pTable, &defTable, sizeof( RDDFUNCS ) );
|
||||
memcpy( pSuperTable, &defTable, sizeof( RDDFUNCS ) );
|
||||
@@ -1338,7 +1338,7 @@ void hb_rddShutDown( void )
|
||||
HB_FUNC( AFIELDS )
|
||||
{
|
||||
PHB_ITEM pName, pType, pLen, pDec, pItem;
|
||||
USHORT uiFields, uiArrayLen, uiCount;
|
||||
USHORT uiFields, uiArrayLen = 0, uiCount;
|
||||
|
||||
if( !s_pCurrArea )
|
||||
{
|
||||
|
||||
@@ -293,7 +293,7 @@ static BOOL hb_dbfWriteMemo( AREAP pArea, LPDBFMEMO pMemo, ULONG * lNewRecNo )
|
||||
|
||||
static BOOL hb_dbfUpdateRecord( AREAP pArea, ULONG ulRecNo )
|
||||
{
|
||||
ULONG ulRecCount;
|
||||
ULONG ulRecCount = 0;
|
||||
USHORT uiCount;
|
||||
LPFIELD pField;
|
||||
BYTE pBuffer[ 1 ];
|
||||
@@ -1719,6 +1719,7 @@ static ERRCODE dbfReadDBHeader( AREAP pArea )
|
||||
pArea->lpExtendInfo->uiRecordLen = 1;
|
||||
SELF_SETFIELDEXTENT( pArea, uiFields );
|
||||
pFieldInfo.typeExtended = 0;
|
||||
pFieldInfo.uiLen = 0;
|
||||
pDBField = ( LPDBFFIELD ) szBuffer;
|
||||
for( uiCount = 0; uiCount < uiFields; uiCount++ )
|
||||
{
|
||||
|
||||
@@ -146,8 +146,10 @@ void hb_dateStrGet( const char * szDate, long * plDay, long * plMonth, long * pl
|
||||
/* Date string has correct length, so attempt to convert */
|
||||
*plDay = ( ( szDate[ 6 ] - '0' ) * 10 ) + ( szDate[ 7 ] - '0' );
|
||||
*plMonth = ( ( szDate[ 4 ] - '0' ) * 10 ) + ( szDate[ 5 ] - '0' );
|
||||
*plYear = ( ( szDate[ 0 ] - '0' ) * 1000 ) + ( ( szDate[ 1 ] - '0' ) * 100 ) +
|
||||
( ( szDate[ 2 ] - '0' ) * 10 ) + ( szDate[ 3 ] - '0' );
|
||||
*plYear = ( ( USHORT ) ( szDate[ 0 ] - '0' ) * 1000 ) +
|
||||
( ( USHORT ) ( szDate[ 1 ] - '0' ) * 100 ) +
|
||||
( ( USHORT ) ( szDate[ 2 ] - '0' ) * 10 ) +
|
||||
( USHORT ) ( szDate[ 3 ] - '0' );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ HB_FUNC( DEFPATH )
|
||||
{
|
||||
char buffer[ _POSIX_PATH_MAX ];
|
||||
char delimiter[ 2 ] = ":";
|
||||
int size;
|
||||
int size = 0;
|
||||
|
||||
if( hb_set.HB_SET_DEFAULT )
|
||||
{
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__WATCOMC__) || defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if defined(__WATCOMC__) || defined(__MINGW32__) || ( defined(_MSC_VER) && _MSC_VER >= 1000 )
|
||||
#include <sys/stat.h>
|
||||
#include <share.h>
|
||||
#include <fcntl.h>
|
||||
@@ -140,6 +140,19 @@
|
||||
#include <direct.h>
|
||||
#include <time.h>
|
||||
|
||||
#if !defined(HAVE_POSIX_IO)
|
||||
#define HAVE_POSIX_IO
|
||||
#endif
|
||||
#elif defined(_MSC_VER)
|
||||
#include <sys/stat.h>
|
||||
#include <share.h>
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#include <errno.h>
|
||||
#include <direct.h>
|
||||
#include <time.h>
|
||||
#include <dos.h>
|
||||
|
||||
#if !defined(HAVE_POSIX_IO)
|
||||
#define HAVE_POSIX_IO
|
||||
#endif
|
||||
@@ -351,7 +364,7 @@ HB_FUNC( DIRECTORY )
|
||||
PHB_ITEM pDirSpec = hb_param( 1, IT_STRING );
|
||||
PHB_ITEM pAttributes = hb_param( 2, IT_STRING );
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if defined(__MINGW32__) || ( defined(_MSC_VER) && _MSC_VER >= 1000 )
|
||||
PHB_ITEM pEightDotThree = hb_param( 3, IT_LOGICAL );
|
||||
BOOL bEightDotThree;
|
||||
#elif defined(__WATCOMC__)
|
||||
@@ -371,7 +384,7 @@ HB_FUNC( DIRECTORY )
|
||||
char ttime[ 9 ];
|
||||
char aatrib[ 17 ];
|
||||
int attrib;
|
||||
long fsize;
|
||||
long fsize = 0;
|
||||
time_t ftime;
|
||||
char * pos;
|
||||
USHORT ushbMask = FA_ARCH;
|
||||
@@ -380,9 +393,12 @@ HB_FUNC( DIRECTORY )
|
||||
struct stat statbuf;
|
||||
struct tm * ft;
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if defined(__MINGW32__) || ( defined(_MSC_VER) && _MSC_VER >= 1000 )
|
||||
struct _finddata_t entry;
|
||||
long hFile;
|
||||
#elif defined(_MSC_VER)
|
||||
struct _find_t entry;
|
||||
long hFile;
|
||||
#elif defined(__IBMCPP__)
|
||||
FILEFINDBUF3 entry;
|
||||
HDIR hFind = HDIR_CREATE;
|
||||
@@ -401,7 +417,7 @@ HB_FUNC( DIRECTORY )
|
||||
if( pAttributes && hb_itemGetCLen( pAttributes ) >= 1 )
|
||||
ushbMask |= HarbourAttributesToMask( ( BYTE * ) hb_itemGetCPtr( pAttributes ) );
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if defined(__MINGW32__) || ( defined(_MSC_VER) && _MSC_VER >= 1000 )
|
||||
/* Do we want 8.3 support? */
|
||||
bEightDotThree = ( pEightDotThree ? hb_itemGetL( pEightDotThree ) : FALSE );
|
||||
#endif
|
||||
@@ -488,7 +504,7 @@ HB_FUNC( DIRECTORY )
|
||||
tzset();
|
||||
pDir = hb_itemArrayNew( 0 );
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if defined(__MINGW32__) || ( defined(_MSC_VER) && _MSC_VER >=1000 )
|
||||
|
||||
strcpy( string, dirname );
|
||||
strcat( string, pattern );
|
||||
@@ -504,6 +520,16 @@ HB_FUNC( DIRECTORY )
|
||||
if( bEightDotThree )
|
||||
GetShortPathName( string, string, _POSIX_PATH_MAX );
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
strcpy( string, dirname );
|
||||
strcat( string, pattern );
|
||||
|
||||
if( _dos_findfirst( string, ushbMask, &entry ) == 0 )
|
||||
{
|
||||
do
|
||||
{
|
||||
strcpy( string, entry.name );
|
||||
#elif defined(__IBMCPP__)
|
||||
|
||||
strcpy( string, dirname );
|
||||
@@ -567,7 +593,7 @@ HB_FUNC( DIRECTORY )
|
||||
{
|
||||
attrib = 0;
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if defined(__MINGW32__) || ( defined(_MSC_VER) && _MSC_VER >= 1000 )
|
||||
|
||||
/* due to short-name support: reconstruct the filename */
|
||||
if( bEightDotThree )
|
||||
@@ -593,6 +619,9 @@ HB_FUNC( DIRECTORY )
|
||||
strcpy( fullfile, dirname );
|
||||
strcpy( filename, entry.name );
|
||||
}
|
||||
#elif defined(_MSC_VER)
|
||||
strcpy( filename, entry.name );
|
||||
strcpy( fullfile, dirname );
|
||||
#elif defined(__IBMCPP__)
|
||||
strcpy( filename, entry.achName );
|
||||
strcpy( fullfile, dirname );
|
||||
@@ -613,8 +642,9 @@ HB_FUNC( DIRECTORY )
|
||||
attrib = statbuf.st_mode;
|
||||
#elif defined(__IBMCPP__)
|
||||
attrib = entry.attrFile;
|
||||
#elif defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#elif defined(__MINGW32__) || defined(_MSC_VER)
|
||||
attrib = entry.attrib;
|
||||
#if defined(_MSC_VER ) && _MSC_VER >= 1000
|
||||
if( bEightDotThree )
|
||||
{
|
||||
/* need to strip off the path */
|
||||
@@ -622,7 +652,7 @@ HB_FUNC( DIRECTORY )
|
||||
if( pos )
|
||||
strcpy( filename, ++pos );
|
||||
}
|
||||
|
||||
#endif
|
||||
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 1280)
|
||||
/* NOTE: _chmod( f, 0 ) => Get attribs
|
||||
_chmod( f, 1, n ) => Set attribs
|
||||
@@ -690,9 +720,11 @@ HB_FUNC( DIRECTORY )
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER >= 1000 )
|
||||
while( _findnext( hFile, &entry ) == 0 );
|
||||
_findclose( hFile );
|
||||
#elif defined(_MSC_VER )
|
||||
while( _dos_findnext( &entry ) == 0 );
|
||||
#elif defined(__IBMCPP__)
|
||||
while( DosFindNext( hFind, &entry, findSize, &findCount ) == NO_ERROR && findCount > 0 );
|
||||
DosFindClose( hFind );
|
||||
|
||||
@@ -245,7 +245,7 @@ HB_FUNC( OS )
|
||||
{
|
||||
hb_os = "Windows";
|
||||
hb_osmajor = _osmajor;
|
||||
hb_osminor = _osminor
|
||||
hb_osminor = _osminor;
|
||||
hb_osletter = 0;
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -71,6 +71,8 @@
|
||||
#include <sys\farptr.h>
|
||||
#elif defined(__WATCOMC__)
|
||||
#include <i86.h>
|
||||
#elif defined(_MSC_VER)
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#if defined(__WATCOMC__)
|
||||
@@ -129,11 +131,11 @@ static BOOL s_bBreak; /* Used to signal Ctrl+Break to hb_inkeyPoll() */
|
||||
static USHORT s_uiDispCount;
|
||||
|
||||
#ifndef __DJGPP__
|
||||
#if defined(__WATCOMC__)
|
||||
static void hb_gt_Watcom_CtrlBreak_Handler( int iSignal )
|
||||
#if defined(__WATCOMC__) || defined(_MSC_VER)
|
||||
static void hb_gt_CtrlBreak_Handler( int iSignal )
|
||||
{
|
||||
/* Ctrl-Break was pressed */
|
||||
/* NOTE: the layout of this function is forced by the Watcom compiler
|
||||
/* NOTE: the layout of this function is forced by the compiler
|
||||
*/
|
||||
HB_SYMBOL_UNUSED( iSignal );
|
||||
s_bBreak = TRUE;
|
||||
@@ -154,6 +156,8 @@ static void hb_gt_CtrlBrkRestore( void )
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_gt_CtrlBrkRestore()"));
|
||||
#if defined(__WATCOMC__)
|
||||
signal( SIGBREAK, SIG_DFL);
|
||||
#elif defined(_MSC_VER)
|
||||
signal( SIGINT, SIG_DFL);
|
||||
#else
|
||||
setcbrk( s_iOldCtrlBreak );
|
||||
#endif
|
||||
@@ -181,7 +185,9 @@ void hb_gt_Init( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr )
|
||||
/* Set the Ctrl+Break handler [vszakats] */
|
||||
|
||||
#if defined(__WATCOMC__)
|
||||
signal( SIGBREAK, hb_gt_Watcom_CtrlBreak_Handler );
|
||||
signal( SIGBREAK, hb_gt_CtrlBreak_Handler );
|
||||
#elif defined(_MSC_VER)
|
||||
signal( SIGINT, hb_gt_CtrlBreak_Handler );
|
||||
#else
|
||||
ctrlbrk( hb_gt_CtrlBrkHandler );
|
||||
s_iOldCtrlBreak = getcbrk();
|
||||
|
||||
@@ -42,6 +42,11 @@
|
||||
#include <dos.h>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define MOUSE_INTERRUPT 0x33
|
||||
#include <bios.h>
|
||||
#endif
|
||||
|
||||
#include "hbapigt.h"
|
||||
|
||||
/* C callable low-level interface */
|
||||
|
||||
@@ -81,7 +81,7 @@ HB_FUNC( ISPRINTER )
|
||||
union REGS regs;
|
||||
|
||||
regs.h.ah = 2;
|
||||
#if defined(__BORLANDC__)
|
||||
#if defined(__BORLANDC__) || defined(_MSC_VER)
|
||||
regs.x.dx = uiPort - 1;
|
||||
#else
|
||||
regs.w.dx = uiPort - 1;
|
||||
|
||||
@@ -574,7 +574,7 @@ char * hb_memvarGetStrValuePtr( char * szVarName, ULONG *pulLen )
|
||||
*/
|
||||
static void hb_memvarCreateFromItem( PHB_ITEM pMemvar, BYTE bScope, PHB_ITEM pValue )
|
||||
{
|
||||
PHB_DYNS pDynVar;
|
||||
PHB_DYNS pDynVar = NULL;
|
||||
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_memvarCreateFromItem(%p, %d, %p)", pMemvar, bScope, pValue));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user