diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2a1256098b..3541982b20 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,16 @@ +2001-11-04 18:34 UTC+0100 Viktor Szakats + + * source/compiler/cmdcheck.c + * source/compiler/gencobj.c + * source/compiler/hbpcode.c + * source/rtl/filesys.c + * source/rtl/idle.c + * source/vm/classes.c + * source/vm/hvm.c + ! Non-ansi comments fixed. + Note that RDD files has lots of // comments, if you're the author + of some those files and seeing this, please check your code. Thx. + 2001-11-04 18:14 UTC+0100 Viktor Szakats * include/hbexpra.c diff --git a/harbour/source/compiler/cmdcheck.c b/harbour/source/compiler/cmdcheck.c index 22c52ab55f..d2f0b9c290 100644 --- a/harbour/source/compiler/cmdcheck.c +++ b/harbour/source/compiler/cmdcheck.c @@ -847,8 +847,8 @@ static void hb_compChkDefineSwitch( char * pszSwitch ) { szDefText[ pAssign - szDefText ] = '\0'; - //hb_pp_AddDefine( szDefText, pAssign + 1 ); - sDefLine = (char*) hb_xgrab( strlen( szDefText ) + 1 + strlen( pAssign + 1 ) + 1 ); + /* hb_pp_AddDefine( szDefText, pAssign + 1 ); */ + sDefLine = ( char* ) hb_xgrab( strlen( szDefText ) + 1 + strlen( pAssign + 1 ) + 1 ); sprintf( sDefLine, "%s %s", szDefText, pAssign + 1 ); hb_pp_ParseDefine( sDefLine ); hb_xfree( sDefLine ); diff --git a/harbour/source/compiler/gencobj.c b/harbour/source/compiler/gencobj.c index 4d0e76927d..b1171fb22d 100644 --- a/harbour/source/compiler/gencobj.c +++ b/harbour/source/compiler/gencobj.c @@ -36,7 +36,8 @@ static char * hb_searchpath( const char *, char *, char * ); /* QUESTION: Allocate buffer dynamically ? */ #define HB_CFG_LINE_LEN 100 -//--------------------------------------------------------------------------// + +/*--------------------------------------------------------------------------*/ /* Builds platform dependant object module from Harbour C output */ void hb_compGenCObj( PHB_FNAME pFileName ) @@ -201,7 +202,6 @@ void hb_compGenCObj( PHB_FNAME pFileName ) sprintf( szCommandLine, "%s %s %s %s > /dev/null", szCompiler, szOptions, szOutPath, szFileName ); #endif } - //printf( "\n\nLine:[%s]\n", szCommandLine ); /* Compile it! */ iSuccess = ( system( szCommandLine ) != -1 ); diff --git a/harbour/source/compiler/hbpcode.c b/harbour/source/compiler/hbpcode.c index 9e1650d080..7d93ea7ac0 100644 --- a/harbour/source/compiler/hbpcode.c +++ b/harbour/source/compiler/hbpcode.c @@ -1457,66 +1457,60 @@ void hb_compStrongType( int iSize ) pFunc->iStackIndex--; if( ( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex - 1 ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType1 = ( pFunc->pStack[ pFunc->iStackIndex - 1 ] -= VT_OFFSET_VARIANT ); - //printf( "\n Op1 = Variant: %c\n", cSubType1 ); - } - + } if( cSubType1 && cSubType1 == '-' ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[NIL]" ); - } + } else if( cSubType1 ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[%c]", cSubType1 ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' ) - { + { strcpy( ( char * ) szType1, "NIL"); - } + } else - { + { sprintf( ( char * ) szType1, "%c", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } - /*---*/ + /*---*/ if( ( pFunc->pStack[ pFunc->iStackIndex ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType2 = ( pFunc->pStack[ pFunc->iStackIndex ] -= VT_OFFSET_VARIANT ); - //printf( "\n Op2 = Variant: %c\n", cSubType1 ); - } - + } if( cSubType2 && cSubType2 == '-' ) - { + { strcpy( ( char * ) szType2, "AnyType.SubType[NIL]" ); - } + } else if( cSubType2 ) - { + { sprintf( ( char * ) szType2, "AnyType.SubType[%c]", cSubType2 ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex ] == '-' ) - { + { strcpy( ( char * ) szType2, "NIL" ); - } + } else - { + { sprintf( ( char * ) szType2, "%c", pFunc->pStack[ pFunc->iStackIndex ] ); - } + } - /*---*/ + /*---*/ - if( ! cSubType1 ) - { + if( ! cSubType1 ) + { cSubType1 = pFunc->pStack[ pFunc->iStackIndex - 1 ]; - //printf( "\n Op1 = %c (%i)\n", cSubType1, cSubType1 ); - } + } - if( ! cSubType2 ) - { + if( ! cSubType2 ) + { cSubType2 = pFunc->pStack[ pFunc->iStackIndex ]; - //printf( "\n Op2 = %c (%i)\n", cSubType2, cSubType2 ); - } + } if( cSubType1 == '-' || cSubType2 == '-' ) { diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 977ccf9bcd..6cc283d476 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -369,14 +369,14 @@ FHANDLE hb_fsOpen( BYTE * pFilename, USHORT uiFlags ) DWORD dwShare = FILE_SHARE_READ | FILE_SHARE_WRITE; HANDLE hFile; - // read & write flags + /* read & write flags */ if( uiFlags & FO_WRITE ) dwFlags |= GENERIC_WRITE; if( uiFlags & FO_READWRITE ) dwFlags |= GENERIC_READ; - // shared flags + /* shared flags */ if( ( uiFlags & FO_DENYREAD ) == FO_DENYREAD ) dwShare = FILE_SHARE_WRITE; diff --git a/harbour/source/rtl/idle.c b/harbour/source/rtl/idle.c index 1b403a03c7..d77633b1ab 100644 --- a/harbour/source/rtl/idle.c +++ b/harbour/source/rtl/idle.c @@ -72,7 +72,7 @@ #include "hbvm.h" #include "error.ch" #if defined(HB_OS_UNIX) - #include + #include #endif /* list of background tasks @@ -140,6 +140,9 @@ static void hb_releaseCPU( void ) nanosleep( &nanosecs, NULL ); } #else + + /* Do nothing */ + #endif } @@ -269,8 +272,10 @@ HB_FUNC( HB_IDLEDEL ) if( s_uiIdleMaxTask ) { if( iTask != s_uiIdleMaxTask ) + { memcpy( &s_pIdleTasks[ iTask ], &s_pIdleTasks[ iTask + 1 ], - sizeof( HB_ITEM_PTR ) * (s_uiIdleMaxTask - iTask) ); + sizeof( HB_ITEM_PTR ) * ( s_uiIdleMaxTask - iTask ) ); + } s_pIdleTasks = ( HB_ITEM_PTR * ) hb_xrealloc( s_pIdleTasks, sizeof( HB_ITEM_PTR ) * s_uiIdleMaxTask ); } else diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index 408ceef285..b1e1e59990 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -631,7 +631,7 @@ char * hb_objGetRealClsName( PHB_ITEM pObject, char * szName ) szClassName = "ARRAY"; else { - PHB_DYNS pMsg = hb_dynsymFindName( szName ); + PHB_DYNS pMsg = hb_dynsymFindName( szName ); USHORT uiClass; USHORT uiCurCls; USHORT uiClsTree; @@ -847,11 +847,6 @@ PMETHOD hb_objGetpMethod( PHB_ITEM pObject, PHB_SYMB pMessage ) if( pClass->pMethods[ uiAt ].pMessage == pMsg ) return (pClass->pMethods + uiAt) ; - - - - - uiAt++; if( uiAt == uiMask ) uiAt = 0; @@ -879,7 +874,7 @@ ULONG hb_objHasMsg( PHB_ITEM pObject, char *szString ) return ( ULONG ) hb_objGetMthd( pObject, pDynSym->pSymbol, FALSE ); else return 0; -} /* Get funcptr of message */ +} /* ================================================ */ @@ -1439,10 +1434,10 @@ static PHB_ITEM hb_clsInst( USHORT uiClass ) pSelf->item.asArray.value->puiClsTree = NULL; - //pSelf->item.asArray.value->puiClsTree = ( USHORT * ) hb_xgrab( sizeof( USHORT ) ); - //pSelf->item.asArray.value->puiClsTree[0]=0; + /* pSelf->item.asArray.value->puiClsTree = ( USHORT * ) hb_xgrab( sizeof( USHORT ) ); */ + /* pSelf->item.asArray.value->puiClsTree[0]=0; */ - /* Initialise value if initialisation was requested */ + /* Initialise value if initialisation was requested */ pMeth = pClass->pMethods; for( uiAt = 0; uiAt < uiLimit; uiAt++, pMeth++ ) { @@ -1643,8 +1638,8 @@ HB_FUNC( __OBJCLONE ) pDstObject= hb_arrayClone( pSrcObject, NULL ) ; pDstObject->item.asArray.value->puiClsTree = NULL; - //pDstObject->item.asArray.value->puiClsTree = ( USHORT * ) hb_xgrab( sizeof( USHORT ) ); - //pDstObject->item.asArray.value->puiClsTree[0]=0; + /* pDstObject->item.asArray.value->puiClsTree = ( USHORT * ) hb_xgrab( sizeof( USHORT ) ); */ + /* pDstObject->item.asArray.value->puiClsTree[0]=0; */ hb_itemRelease( hb_itemReturn( pDstObject ) ); } @@ -1663,7 +1658,7 @@ HB_FUNC( __OBJSENDMSG ) PHB_ITEM pObject = hb_param( 1, HB_IT_OBJECT ); USHORT uiPCount = hb_pcount(); - if( uiPCount>=2 && pObject ) /* Object & message passed */ + if( uiPCount>=2 && pObject ) /* Object & message passed */ { /*hb_dynsymFindName( hb_parc(2) );*/ PHB_DYNS pMsg = hb_dynsymGet( hb_parc(2) ); @@ -1672,14 +1667,14 @@ HB_FUNC( __OBJSENDMSG ) { USHORT uiParam; - hb_vmPush( pObject ); /* Push object */ + hb_vmPush( pObject ); /* Push object */ hb_vmMessage( pMsg->pSymbol ); /* Push char symbol as message */ - for( uiParam = 3; uiParam <= uiPCount; uiParam++ ) /* Push arguments on stack */ + for( uiParam = 3; uiParam <= uiPCount; uiParam++ ) /* Push arguments on stack */ hb_vmPush( hb_param( uiParam, HB_IT_ANY ) ); - hb_vmDo( ( USHORT ) ( uiPCount - 2 ) ); /* Execute message */ + hb_vmDo( ( USHORT ) ( uiPCount - 2 ) ); /* Execute message */ } } else @@ -2411,4 +2406,5 @@ HB_FUNC( __CLSGETPROPERTIES ) } hb_itemRelease( hb_itemReturn( pReturn ) ); -} \ No newline at end of file +} + diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index e1fd503069..944b045c13 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -1335,7 +1335,7 @@ void hb_vmExecute( const BYTE * pCode, PHB_SYMB pSymbols ) hb_xfree( aExtraItems ); - w++; // To force skip the HB_P_ARRAYPUSH (was already processed above). + w++; /* To force skip the HB_P_ARRAYPUSH (was already processed above). */ } w++;