diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3538cdbb2b..3be30e6d8e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,20 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-14 12:36 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/xhb/hbcrypt.c + * contrib/xhb/dbf2txt.c + * contrib/xhb/xstrdel.c + * contrib/xhb/hbcomprs.c + * contrib/xhb/txtline.c + * contrib/hbbmcdx/bmdbfcdx.c + ! Fixed to use current APIs instead of legacy/compatibility ones. + ; Pls review the cdp ones. + + * src/rtl/langapi.c + * include/hbapilng.h + + Un-marked hb_langDGetErrorDesc() with HB_LEGACY_LEVEL3. [REVERT] + 2010-01-14 12:25 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/vm/hashfunc.c * src/vm/macro.c diff --git a/harbour/contrib/hbbmcdx/bmdbfcdx.c b/harbour/contrib/hbbmcdx/bmdbfcdx.c index f4b2db7c14..c0cf992bc3 100644 --- a/harbour/contrib/hbbmcdx/bmdbfcdx.c +++ b/harbour/contrib/hbbmcdx/bmdbfcdx.c @@ -717,7 +717,7 @@ static LPCDXKEY hb_cdxKeyPutItem( LPCDXKEY pKey, PHB_ITEM pItem, ULONG ulRec, LP if( pTag->uiType == 'C' ) { if( fTrans ) - hb_cdpnTranslate( ( char * ) pKey->val, hb_vmCDP(), pTag->pIndex->pArea->dbfarea.area.cdPage, pKey->len ); + hb_cdpnDupLen( ( char * ) pKey->val, pKey->len, hb_vmCDP(), pTag->pIndex->pArea->dbfarea.area.cdPage ); if( pTag->IgnoreCase ) hb_strUpper( ( char * ) pKey->val, pKey->len ); @@ -742,8 +742,7 @@ static PHB_ITEM hb_cdxKeyGetItem( LPCDXKEY pKey, PHB_ITEM pItem, LPCDXTAG pTag, char * pVal = ( char * ) hb_xgrab( pKey->len + 1 ); memcpy( pVal, pKey->val, pKey->len ); pVal[ pKey->len ] = '\0'; - hb_cdpnTranslate( pVal, pTag->pIndex->pArea->dbfarea.area.cdPage, hb_vmCDP(), - pKey->len ); + hb_cdpnDupLen( pVal, pKey->len, pTag->pIndex->pArea->dbfarea.area.cdPage, hb_vmCDP() ); pItem = hb_itemPutCLPtr( pItem, pVal, pKey->len ); } else @@ -5669,7 +5668,7 @@ static BOOL hb_cdxRegexMatch( CDXAREAP pArea, PHB_REGEX pRegEx, LPCDXKEY pKey ) if( pArea->dbfarea.area.cdPage != hb_vmCDP() ) { memcpy( szBuff, szKey, pKey->len + 1 ); - hb_cdpnTranslate( szBuff, pArea->dbfarea.area.cdPage, hb_vmCDP(), pKey->len ); + hb_cdpnDupLen( szBuff, pKey->len, pArea->dbfarea.area.cdPage, hb_vmCDP() ); szKey = szBuff; } diff --git a/harbour/contrib/xhb/dbf2txt.c b/harbour/contrib/xhb/dbf2txt.c index 45199010ea..07e424ed99 100644 --- a/harbour/contrib/xhb/dbf2txt.c +++ b/harbour/contrib/xhb/dbf2txt.c @@ -99,7 +99,7 @@ static BOOL hb_ExportVar( HB_FHANDLE handle, PHB_ITEM pValue, const char * cDeli szStrEsc = hb_strescape( hb_itemGetCPtr( pValue ), hb_itemGetCLen( pValue ), cDelim ); if( cdp ) - hb_cdpnTranslate( szStrEsc, hb_vmCDP(), cdp, strlen( szStrEsc ) ); + hb_cdpnDupLen( szStrEsc, strlen( szStrEsc ), hb_vmCDP(), cdp ); szString = hb_xstrcpy( NULL, cDelim, szStrEsc, cDelim, NULL ); diff --git a/harbour/contrib/xhb/hbcomprs.c b/harbour/contrib/xhb/hbcomprs.c index a822dae87c..9365e59de3 100644 --- a/harbour/contrib/xhb/hbcomprs.c +++ b/harbour/contrib/xhb/hbcomprs.c @@ -165,7 +165,7 @@ HB_FUNC( HB_COMPRESS ) } else { - hb_retclenAdopt( cDest, ulDstlen ); + hb_retclen_buffer( cDest, ulDstlen ); } } s_hb_compress_error = cerr; @@ -247,7 +247,7 @@ HB_FUNC( HB_UNCOMPRESS ) } else { - hb_retclenAdopt( cDest, ulDstlen ); + hb_retclen_buffer( cDest, ulDstlen ); } } s_hb_compress_error = cerr; @@ -267,7 +267,7 @@ HB_FUNC( HB_COMPRESSERROR ) HB_FUNC( HB_COMPRESSERRORDESC ) { - hb_retcAdopt( hb_strdup( zError( hb_parni( 1 ) ) ) ); + hb_retc_buffer( hb_strdup( zError( hb_parni( 1 ) ) ) ); } /******************************* diff --git a/harbour/contrib/xhb/hbcrypt.c b/harbour/contrib/xhb/hbcrypt.c index ff73b8b580..1672bce145 100644 --- a/harbour/contrib/xhb/hbcrypt.c +++ b/harbour/contrib/xhb/hbcrypt.c @@ -427,7 +427,7 @@ HB_FUNC( HB_CRYPT ) ( unsigned char * ) hb_itemGetCPtr( pKey ), hb_itemGetCLen( pKey ), cRes ); - hb_retclenAdopt( ( char * ) cRes, hb_itemGetCLen( pSource ) ); + hb_retclen_buffer( ( char * ) cRes, hb_itemGetCLen( pSource ) ); } /***** @@ -448,5 +448,5 @@ HB_FUNC( HB_DECRYPT ) ( unsigned char * ) hb_itemGetCPtr( pKey ), hb_itemGetCLen( pKey ), cRes ); - hb_retclenAdopt( ( char * ) cRes, hb_itemGetCLen( pSource ) ); + hb_retclen_buffer( ( char * ) cRes, hb_itemGetCLen( pSource ) ); } diff --git a/harbour/contrib/xhb/txtline.c b/harbour/contrib/xhb/txtline.c index 279602092f..9e78528cf1 100644 --- a/harbour/contrib/xhb/txtline.c +++ b/harbour/contrib/xhb/txtline.c @@ -220,11 +220,11 @@ HB_FUNC( HB_TABEXPAND ) } else { - lSize = lStrLen + uiTabCount*(uiTabLen - 1); - szRet = (char *) hb_xgrab( lSize + 1 ); + lSize = lStrLen + uiTabCount * ( uiTabLen - 1 ); + szRet = ( char * ) hb_xgrab( lSize + 1 ); memset( szRet, ' ', lSize ); lStrLen = hb_tabexpand( szText, szRet, lStrLen, uiTabLen ); - hb_retclenAdopt( szRet, lStrLen); + hb_retclen_buffer( szRet, lStrLen ); } } diff --git a/harbour/contrib/xhb/xstrdel.c b/harbour/contrib/xhb/xstrdel.c index 90807d0060..92bb046978 100644 --- a/harbour/contrib/xhb/xstrdel.c +++ b/harbour/contrib/xhb/xstrdel.c @@ -82,7 +82,7 @@ HB_FUNC( STRDEL ) ulResult += ulText - ulPosTxt; szResult[ ulResult ] = '\0'; - hb_retclenAdopt( szResult, ulResult ); + hb_retclen_buffer( szResult, ulResult ); } else hb_retc( szText ); diff --git a/harbour/include/hbapilng.h b/harbour/include/hbapilng.h index 49916e6bae..fbed44911a 100644 --- a/harbour/include/hbapilng.h +++ b/harbour/include/hbapilng.h @@ -97,9 +97,7 @@ extern HB_EXPORT char * hb_langName ( void ); /* Compatibility interface */ -#ifdef HB_LEGACY_LEVEL3 extern HB_EXPORT const char * hb_langDGetErrorDesc ( int iIndex ); -#endif HB_EXTERN_END diff --git a/harbour/src/rtl/langapi.c b/harbour/src/rtl/langapi.c index a99162b9aa..b3e60303cd 100644 --- a/harbour/src/rtl/langapi.c +++ b/harbour/src/rtl/langapi.c @@ -357,8 +357,6 @@ char * hb_langName( void ) /* Compatibility interface */ -#ifdef HB_LEGACY_LEVEL3 - const char * hb_langDGetErrorDesc( int iIndex ) { HB_TRACE(HB_TR_DEBUG, ("hb_langDGetErrorDesc(%i)", iIndex)); @@ -366,8 +364,6 @@ const char * hb_langDGetErrorDesc( int iIndex ) return hb_langDGetItem( HB_LANG_ITEM_BASE_ERRDESC + iIndex ); } -#endif - /* Harbour interface */ HB_FUNC( HB_LANGSELECT )