2014-01-02 13:11 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* src/rtl/itemseri.c
    ! fixed casting for C++ builds

  * contrib/rddads/ads1.c
    + use AdsIsNull() function instead of AdsIsEmpty() in DBS_ISNULL
      action for ACE library 9.0 or newer.

  * contrib/rddads/adsfunc.c
  * contrib/rddads/rddads.hbx
    + added new PRG function: AdsIsNull()
      For ACE libraries < 9.0 it's redirected to AdsIsEmpty()
This commit is contained in:
Przemysław Czerpak
2014-01-02 13:11:38 +01:00
parent 15c1a332dd
commit a5a9141109
5 changed files with 52 additions and 9 deletions

View File

@@ -10,6 +10,19 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2014-01-02 13:11 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/itemseri.c
! fixed casting for C++ builds
* contrib/rddads/ads1.c
+ use AdsIsNull() function instead of AdsIsEmpty() in DBS_ISNULL
action for ACE library 9.0 or newer.
* contrib/rddads/adsfunc.c
* contrib/rddads/rddads.hbx
+ added new PRG function: AdsIsNull()
For ACE libraries < 9.0 it's redirected to AdsIsEmpty()
2013-12-27 02:46 UTC+0100 Viktor Szakáts (vszakats users.noreply.github.com)
* ChangeLog.txt
* cleaned away abandoned domain from old entries

View File

@@ -1962,24 +1962,25 @@ static HB_ERRCODE adsFieldInfo( ADSAREAP pArea, HB_USHORT uiIndex, HB_USHORT uiT
{
case DBS_ISNULL:
{
UNSIGNED16 bEmpty;
UNSIGNED16 u16Null = 1;
if( pArea->fPositioned )
{
UNSIGNED32 u32RetVal;
u32RetVal = AdsIsEmpty( pArea->hTable, ADSFIELD( uiIndex ), &bEmpty );
#if ADS_LIB_VERSION >= 900
u32RetVal = AdsIsNull( pArea->hTable, ADSFIELD( uiIndex ), &u16Null );
#else
u32RetVal = AdsIsEmpty( pArea->hTable, ADSFIELD( uiIndex ), &u16Null );
#endif
if( u32RetVal != AE_SUCCESS )
{
commonError( pArea, EG_READ, ( HB_ERRCODE ) u32RetVal, 0, NULL, 0, NULL );
return HB_FAILURE;
}
}
else
bEmpty = 1;
hb_itemPutL( pItem, bEmpty != 0 );
return HB_SUCCESS;
hb_itemPutL( pItem, u16Null != 0 );
break;
}
case DBS_TYPE:
@@ -2076,11 +2077,12 @@ static HB_ERRCODE adsFieldInfo( ADSAREAP pArea, HB_USHORT uiIndex, HB_USHORT uiT
hb_itemPutC( pItem, "U" );
break;
}
return HB_SUCCESS;
break;
default:
return SUPER_FIELDINFO( ( AREAP ) pArea, uiIndex, uiType, pItem );
}
return HB_SUCCESS;
}
static HB_ERRCODE adsFieldName( ADSAREAP pArea, HB_USHORT uiIndex, void * szName )

View File

@@ -1720,6 +1720,33 @@ HB_FUNC( ADSISEMPTY )
hb_errRT_DBCMD( EG_ARG, 1014, NULL, HB_ERR_FUNCNAME );
}
HB_FUNC( ADSISNULL )
{
if( HB_ISCHAR( 1 ) || HB_ISNUM( 1 ) )
{
UNSIGNED16 u16Null = 0;
ADSAREAP pArea = hb_adsGetWorkAreaPointer();
if( pArea )
{
#if ADS_LIB_VERSION >= 900
AdsIsNull( pArea->hTable,
( HB_ISCHAR( 1 ) ? ( UNSIGNED8 * ) hb_parcx( 1 ) : ADSFIELD( hb_parni( 1 ) ) ) /* pucFldName */,
&u16Null );
#else
AdsIsEmpty( pArea->hTable,
( HB_ISCHAR( 1 ) ? ( UNSIGNED8 * ) hb_parcx( 1 ) : ADSFIELD( hb_parni( 1 ) ) ) /* pucFldName */,
&u16Null );
#endif
hb_retl( u16Null != 0 );
}
else
hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, HB_ERR_FUNCNAME );
}
else
hb_errRT_DBCMD( EG_ARG, 1014, NULL, HB_ERR_FUNCNAME );
}
HB_FUNC( ADSGETNUMACTIVELINKS ) /* Only valid for a DataDict */
{
UNSIGNED16 pusNumLinks = 0;

View File

@@ -104,6 +104,7 @@ DYNAMIC AdsIsEmpty
DYNAMIC AdsIsEncryptionEnabled
DYNAMIC AdsIsExprValid
DYNAMIC AdsIsIndexed
DYNAMIC AdsIsNull
DYNAMIC AdsIsRecordEncrypted
DYNAMIC AdsIsRecordInAOF
DYNAMIC AdsIsRecordLocked

View File

@@ -1672,7 +1672,7 @@ char * hb_itemSerializeCP( PHB_ITEM pItem, int iFlags,
if( ( iFlags & HB_SERIALIZE_COMPRESS ) != 0 && nSize > 20 )
{
HB_SIZE nDest = hb_zlibCompressBound( nSize );
char * pDest = hb_xgrab( nDest );
char * pDest = ( char * ) hb_xgrab( nDest );
if( hb_zlibCompress( pDest, &nDest, ( const char * ) pBuffer, nSize,
HB_ZLIB_COMPRESSION_DEFAULT ) == HB_ZLIB_RES_OK )
{