2011-02-01 03:34 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/src/vm/hashfunc.c
  * harbour/src/vm/hashes.c
    * moved HB_HASH_RESORT setting to avoid potential problems when some
      3-rd party code didn't set it correctly.

  * harbour/src/rtl/itemseri.c
    ! fixed restoring hash arrays with strict order - they were not resorted
This commit is contained in:
Przemyslaw Czerpak
2011-02-01 02:34:25 +00:00
parent 2b321edc14
commit 0469427295
4 changed files with 18 additions and 7 deletions

View File

@@ -16,6 +16,15 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-02-01 03:34 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/hashfunc.c
* harbour/src/vm/hashes.c
* moved HB_HASH_RESORT setting to avoid potential problems when some
3-rd party code didn't set it correctly.
* harbour/src/rtl/itemseri.c
! fixed restoring hash arrays with strict order - they were not resorted
2011-02-01 01:56 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbnetio/utils/hbnetio/netiosrv.prg
* contrib/hbnetio/utils/hbnetio/netiocon.prg

View File

@@ -1057,9 +1057,9 @@ static HB_SIZE hb_deserializeItem( PHB_ITEM pItem,
{
int iFlags = HB_GET_LE_UINT16( &pBuffer[ nOffset ] );
nOffset = hb_deserializeItem( pItem, cdpIn, cdpOut, pBuffer,
nOffset + 2, pRef );
nOffset + 2, pRef );
hb_hashClearFlags( pItem, HB_HASH_FLAG_MASK );
if( ( iFlags & HB_HASH_BINARY ) == 0 )
if( ( iFlags & ( HB_HASH_KEEPORDER | HB_HASH_BINARY ) ) != HB_HASH_BINARY )
iFlags |= HB_HASH_RESORT;
hb_hashSetFlags( pItem, iFlags );
break;
@@ -1069,9 +1069,9 @@ static HB_SIZE hb_deserializeItem( PHB_ITEM pItem,
{
PHB_ITEM pDefVal = hb_itemNew( NULL );
nOffset = hb_deserializeItem( pDefVal, cdpIn, cdpOut, pBuffer,
nOffset, pRef );
nOffset, pRef );
nOffset = hb_deserializeItem( pItem, cdpIn, cdpOut, pBuffer,
nOffset, pRef );
nOffset, pRef );
hb_hashSetDefault( pItem, pDefVal );
hb_itemRelease( pDefVal );
break;

View File

@@ -1092,6 +1092,8 @@ void hb_hashClearFlags( PHB_ITEM pHash, int iFlags )
{
hb_xfree( pHash->item.asHash.value->pnPos );
pHash->item.asHash.value->pnPos = NULL;
if( pHash->item.asHash.value->nSize )
pHash->item.asHash.value->iFlags |= HB_HASH_RESORT;
}
}
}

View File

@@ -752,10 +752,10 @@ HB_FUNC( HB_HKEEPORDER )
if( ( iFlags & HB_HASH_KEEPORDER ) == 0 )
hb_hashSetFlags( pHash, HB_HASH_KEEPORDER );
}
else if( ( iFlags & HB_HASH_KEEPORDER ) != 0 )
else
{
hb_hashClearFlags( pHash, HB_HASH_KEEPORDER );
hb_hashSetFlags( pHash, HB_HASH_RESORT );
if( ( iFlags & HB_HASH_KEEPORDER ) != 0 )
hb_hashClearFlags( pHash, HB_HASH_KEEPORDER );
}
}
}