2009-09-23 17:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbcomp.h
    * minor formatting

  * harbour/source/rdd/dbfnsx/dbfnsx1.c
    ! fixed false corruption RT error generated due to missing reset
      on cached current key offset - thanks to Jaroslav Janik for
      information and self contain example
This commit is contained in:
Przemyslaw Czerpak
2009-09-23 15:52:09 +00:00
parent 3bf190ea51
commit 1c7c124232
3 changed files with 22 additions and 5 deletions

View File

@@ -17,6 +17,15 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-09-23 17:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
* minor formatting
* harbour/source/rdd/dbfnsx/dbfnsx1.c
! fixed false corruption RT error generated due to missing reset
on cached current key offset - thanks to Jaroslav Janik for
information and self contain example
2009-09-23 16:30 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
* contrib/hbmemio/memio.c

View File

@@ -383,9 +383,9 @@ extern const BYTE hb_comp_pcode_len[];
#define HB_COMPFLAG_ARRSTR HB_SM_ARRSTR /* 16 -ks strings as array of bytes */
#define HB_COMPFLAG_EXTOPT HB_SM_EXTOPT /* 32 -ko clipper incompatible optimizations */
#define HB_COMPFLAG_RT_MACRO HB_SM_RT_MACRO /* 64 -kr */
#define HB_COMPFLAG_OPTJUMP 256 /* -kj turn off jump optimalization */
#define HB_COMPFLAG_HB_INLINE 512 /* -ki hb_inLine(...) { ... } support */
#define HB_COMPFLAG_MACROTEXT 1024 /* -kM turn off macrotext substitution */
#define HB_COMPFLAG_OPTJUMP 0x0100 /* -kj turn off jump optimalization */
#define HB_COMPFLAG_HB_INLINE 0x0200 /* -ki hb_inLine(...) { ... } support */
#define HB_COMPFLAG_MACROTEXT 0x0400 /* -kM turn off macrotext substitution */
#define HB_COMP_ISSUPPORTED(flag) ( HB_COMP_PARAM->supported & (flag) )

View File

@@ -1257,6 +1257,7 @@ static void hb_nsxDiscardBuffers( LPNSXINDEX pIndex )
{
pIndex->lpTags[ i ]->RootBlock = 0;
pIndex->lpTags[ i ]->stackLevel = 0;
pIndex->lpTags[ i ]->CurKeyOffset = 0;
}
}
@@ -2106,13 +2107,12 @@ static HB_ERRCODE hb_nsxIndexHeaderRead( LPNSXINDEX pIndex )
pIndex->Version = ulVersion;
pIndex->NextAvail = ulNext;
pIndex->FileSize = ulFileSize;
for( i = 1; i < pIndex->iTags; i++ )
for( i = 0; i < pIndex->iTags; i++ )
{
pIndex->lpTags[ i ]->HeadBlock =
hb_nsxIndexTagFind( &pIndex->HeaderBuff, pIndex->lpTags[ i ]->TagName );
if( !pIndex->lpTags[ i ]->HeadBlock )
pIndex->lpTags[ i ]->RootBlock = 0;
pIndex->lpTags[ i ]->CurKeyOffset = 0;
}
}
}
@@ -3096,6 +3096,8 @@ static BOOL hb_nsxTagInsertKey( LPTAGINFO pTag, LPPAGEINFO pPage,
if( ! pPage )
{
hb_xfree( pKeyBuff );
pTag->CurKeyOffset = 0;
pTag->stackLevel = 0;
return FALSE;
}
pNewKey = hb_nsxKeyNew( iLen );
@@ -3128,6 +3130,7 @@ static BOOL hb_nsxTagInsertKey( LPTAGINFO pTag, LPPAGEINFO pPage,
if( ! pPage )
{
hb_nsxKeyFree( pNewKey );
pTag->CurKeyOffset = 0;
pTag->stackLevel = 0;
return FALSE;
}
@@ -3156,6 +3159,7 @@ static BOOL hb_nsxTagInsertKey( LPTAGINFO pTag, LPPAGEINFO pPage,
if( ! pPage )
{
hb_nsxKeyFree( pNewKey );
pTag->CurKeyOffset = 0;
pTag->stackLevel = 0;
return FALSE;
}
@@ -3165,11 +3169,13 @@ static BOOL hb_nsxTagInsertKey( LPTAGINFO pTag, LPPAGEINFO pPage,
hb_nsxPageKeyAdd( pTag, pPage, 0, pNewKey );
pTag->RootBlock = pPage->Page;
pTag->HdrChanged = TRUE;
pTag->CurKeyOffset = 0;
pTag->stackLevel = 0;
hb_nsxKeyFree( pNewKey );
}
}
hb_nsxPageRelease( pTag, pPage );
pTag->CurKeyOffset = 0;
pTag->stackLevel = 0;
return TRUE;
}
@@ -3412,6 +3418,7 @@ static BOOL hb_nsxTagKeyDel( LPTAGINFO pTag, LPKEYINFO pKey )
hb_nsxKeyFree( pKeyNew );
}
}
pTag->CurKeyOffset = 0;
pTag->stackLevel = 0;
return fResult;
}
@@ -5680,6 +5687,7 @@ static void hb_nsxSortOut( LPNSXSORTINFO pSort )
return;
pSort->ulLastRec = pTag->CurKeyInfo->rec;
memcpy( pSort->pLastKey, pTag->CurKeyInfo->val, iLen );
pTag->CurKeyOffset = 0;
pTag->stackLevel = 0;
}