From b99a44d1904f382990dfc16f50804977264fff2a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 23 Jun 2010 17:09:42 +0000 Subject: [PATCH] 2010-06-23 19:08 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/vm/runner.c + Module name will now be filled with the .hrb filename if known, and default 'pcode.hrb' will only be used if running direct binary .hrb stream. This means that also PROCFILE() will return usable results. (f.e. in script run via hbrun) * contrib/hbmisc/hbeditc.c % int -> char. Dropped some casts. --- harbour/ChangeLog | 10 ++++++++++ harbour/contrib/hbmisc/hbeditc.c | 12 ++++++------ harbour/src/vm/runner.c | 10 +++++----- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 76e260be1b..1d1343dec5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,16 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-23 19:08 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/runner.c + + Module name will now be filled with the .hrb filename if known, + and default 'pcode.hrb' will only be used if running direct + binary .hrb stream. This means that also PROCFILE() will + return usable results. (f.e. in script run via hbrun) + + * contrib/hbmisc/hbeditc.c + % int -> char. Dropped some casts. + 2010-06-23 07:47 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/THbQtUI.prg ! Fixed wronly used MsgBox(), converted to hbqt_showError(). diff --git a/harbour/contrib/hbmisc/hbeditc.c b/harbour/contrib/hbmisc/hbeditc.c index 19896d7c48..6a95d76499 100644 --- a/harbour/contrib/hbmisc/hbeditc.c +++ b/harbour/contrib/hbmisc/hbeditc.c @@ -2187,7 +2187,7 @@ static int format_line( PHB_EDITOR pEd, char Karetka, HB_ISIZ LineDl ) /* Appends the character at the end of line */ -static int AppendChar( PHB_EDITOR pEd, int znak, int podz ) +static int AppendChar( PHB_EDITOR pEd, char znak, char podz ) { int status; HB_ISIZ diff; @@ -2209,9 +2209,9 @@ static int AppendChar( PHB_EDITOR pEd, int znak, int podz ) /* move the CRLF characters after the appended character */ cNew = pEd->begin + iPos + diff; - *cNew++ = ( char ) znak; + *cNew++ = znak; if( *cNew != '\r' ) - *cNew = ( char ) podz; /* insert requested soft/hard carriage */ + *cNew = podz; /* insert requested soft/hard carriage */ *++cNew = '\n'; /* the last line always have to end with the hard carriage return */ @@ -2255,7 +2255,7 @@ static void SetLastLine( PHB_EDITOR pEd ) /* Insert or replace the new character into the text buffer */ -static void PutChar( PHB_EDITOR pEd, HB_BOOL fInsert, int znak ) +static void PutChar( PHB_EDITOR pEd, HB_BOOL fInsert, char znak ) { HB_ISIZ i, jj, cc; HB_ISIZ rdl; @@ -2278,7 +2278,7 @@ static void PutChar( PHB_EDITOR pEd, HB_BOOL fInsert, int znak ) */ i = pEd->current_line + cc; MoveText( pEd, i, i + 1, pEd->buffer_size - pEd->current_line - cc - 1 ); - pEd->begin[ i ] = ( char ) znak; + pEd->begin[ i ] = znak; jj = format_line( pEd, HB_CHAR_SOFT1, 0 ); @@ -2308,7 +2308,7 @@ static void PutChar( PHB_EDITOR pEd, HB_BOOL fInsert, int znak ) { if( cc < GetLineLength( pEd, pEd->current_line, &rdl ) ) { - pEd->begin[ pEd->current_line + cc ] = ( char ) znak; + pEd->begin[ pEd->current_line + cc ] = znak; jj = 0; Right( pEd ); } diff --git a/harbour/src/vm/runner.c b/harbour/src/vm/runner.c index 27eeef4ca9..8f0300e1b0 100644 --- a/harbour/src/vm/runner.c +++ b/harbour/src/vm/runner.c @@ -323,7 +323,7 @@ static void hb_hrbUnLoad( PHRB_BODY pHrbBody ) -static PHRB_BODY hb_hrbLoad( const char * szHrbBody, HB_SIZE ulBodySize, HB_USHORT usMode ) +static PHRB_BODY hb_hrbLoad( const char * szHrbBody, HB_SIZE ulBodySize, HB_USHORT usMode, const char * szFileName ) { PHRB_BODY pHrbBody = NULL; @@ -549,7 +549,7 @@ static PHRB_BODY hb_hrbLoad( const char * szHrbBody, HB_SIZE ulBodySize, HB_USHO } pHrbBody->pModuleSymbols = hb_vmRegisterSymbols( pHrbBody->pSymRead, - ( HB_USHORT ) pHrbBody->ulSymbols, "pcode.hrb", 0, HB_TRUE, HB_FALSE ); + ( HB_USHORT ) pHrbBody->ulSymbols, szFileName ? szFileName : "pcode.hrb", 0, HB_TRUE, HB_FALSE ); if( pHrbBody->pModuleSymbols->pModuleSymbols != pSymRead ) { @@ -624,7 +624,7 @@ static PHRB_BODY hb_hrbLoadFromFile( const char * szHrb, HB_USHORT usMode ) hb_fsReadLarge( hFile, pbyBuffer, ulBodySize ); pbyBuffer[ ulBodySize ] = '\0'; - pHrbBody = hb_hrbLoad( ( const char * ) pbyBuffer, ulBodySize, usMode ); + pHrbBody = hb_hrbLoad( ( const char * ) pbyBuffer, ulBodySize, usMode, szFileName ); hb_xfree( pbyBuffer ); } hb_fsClose( hFile ); @@ -723,7 +723,7 @@ HB_FUNC( HB_HRBRUN ) PHRB_BODY pHrbBody; if( hb_hrbCheckSig( fileOrBody, ulLen ) != 0 ) - pHrbBody = hb_hrbLoad( fileOrBody, ulLen, usMode ); + pHrbBody = hb_hrbLoad( fileOrBody, ulLen, usMode, NULL ); else pHrbBody = hb_hrbLoadFromFile( fileOrBody, usMode ); @@ -773,7 +773,7 @@ HB_FUNC( HB_HRBLOAD ) PHRB_BODY pHrbBody; if( hb_hrbCheckSig( fileOrBody, ulLen ) != 0 ) - pHrbBody = hb_hrbLoad( fileOrBody, ulLen, usMode ); + pHrbBody = hb_hrbLoad( fileOrBody, ulLen, usMode, NULL ); else pHrbBody = hb_hrbLoadFromFile( fileOrBody, usMode );