Skip to content

Commit

Permalink
version: change return value of hb_verCommitRev() from HB_ULONG to HB…
Browse files Browse the repository at this point in the history
…_MAXINT

2022-12-06 18:28 UTC Viktor Szakats
  * include/hbapi.h
  * src/common/hbver.c
  * src/main/harbour.c
  * src/pp/hbpp.c
  * src/vm/cmdarg.c
    * change return value of hb_verCommitRev() from HB_ULONG to HB_MAXINT
      to match Harbour 3.2
  • Loading branch information
vszakats committed Jan 23, 2024
1 parent b702012 commit 81dc666
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/hbapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ extern HB_EXPORT void hb_verBuildInfo( void ); /* display Harbour,
extern HB_EXPORT void hb_verBuildInfoCB( PHB_OUT_FUNC ); /* pass Harbour, compiler and platform versions to callback function */
extern HB_EXPORT const char * hb_verCommitID( void ); /* retrieves a static buffer containing source repository hash/id */
extern HB_EXPORT const char * hb_verCommitIDShort( void ); /* retrieves a static buffer containing source repository hash/id (short version) */
extern HB_EXPORT HB_ULONG hb_verCommitRev( void ); /* retrieves source repository revision number */
extern HB_EXPORT HB_MAXINT hb_verCommitRev( void ); /* retrieves source repository revision number */
extern HB_EXPORT const char * hb_verCommitInfo( void ); /* retrieves a static buffer containing source repository last commit header */
#if defined( HB_LEGACY_LEVEL4 )
extern HB_EXPORT char * hb_verBuildDate( void ); /* retrieves a newly allocated buffer containing build date and time */
Expand Down
2 changes: 1 addition & 1 deletion src/common/hbver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ char * hb_verHarbour( void )

HB_TRACE( HB_TR_DEBUG, ( "hb_verHarbour()" ) );

hb_snprintf( szDateRaw, sizeof( szDateRaw ), "%lu", hb_verCommitRev() );
hb_snprintf( szDateRaw, sizeof( szDateRaw ), "%" PFHL "u", hb_verCommitRev() );

szDate[ 0 ] = '2';
szDate[ 1 ] = '0';
Expand Down
2 changes: 1 addition & 1 deletion src/main/harbour.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const char * hb_verCommitIDShort( void )
}

/* Source repository revision number */
HB_ULONG hb_verCommitRev( void )
HB_MAXINT hb_verCommitRev( void )
{
return HB_VER_COMMIT_REV;
}
Expand Down
16 changes: 8 additions & 8 deletions src/pp/hbpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

#define _DEFAULT_ORIGIN_URL "https://github.com/vszakats/hb/"

HB_ULONG hb_verCommitRev( void )
HB_MAXINT hb_verCommitRev( void )
{
return 0;
}
Expand Down Expand Up @@ -332,7 +332,7 @@ static char * hb_pp_escapeString( char * szString )

static int hb_pp_generateVerInfo( char * szVerFile,
char * szCommitYear,
HB_ULONG nCommitRev,
HB_MAXINT nCommitRev,
char * szCommitInfo,
char * szCommitID,
char * szCommitIDShort,
Expand Down Expand Up @@ -391,7 +391,7 @@ static int hb_pp_generateVerInfo( char * szVerFile,
hb_xfree( pszEscaped );
}

fprintf( fout, "#define HB_VER_COMMIT_REV %lu\n", nCommitRev );
fprintf( fout, "#define HB_VER_COMMIT_REV %" PFHL "u\n", nCommitRev );

if( szCommitInfo )
{
Expand Down Expand Up @@ -474,7 +474,7 @@ static char * hb_fsFileFind( const char * pszFileMask )
return NULL;
}

static HB_ULONG hb_pp_TimeStampToNum( PHB_PP_STATE pState, char * pszLog, char * pszYear )
static HB_MAXINT hb_pp_TimeStampToNum( PHB_PP_STATE pState, char * pszLog, char * pszYear )
{
char szRevID[ 18 ];
int iLen;
Expand Down Expand Up @@ -538,12 +538,12 @@ static HB_ULONG hb_pp_TimeStampToNum( PHB_PP_STATE pState, char * pszLog, char *
hb_pp_addDefine( pState, "HB_VER_SVNID", szRevID );
#endif

return ( HB_ULONG ) hb_strValInt( szRevID, &iLen );
return hb_strValInt( szRevID, &iLen );
}

static int hb_pp_parseChangelog( PHB_PP_STATE pState, const char * pszFileName,
int iQuiet, char ** pszCommitYear,
HB_ULONG * pnCommitRev, char ** pszCommitInfo )
HB_MAXINT * pnCommitRev, char ** pszCommitInfo )
{
char * pszFree = NULL;
int iResult = 0;
Expand Down Expand Up @@ -684,7 +684,7 @@ static int hb_pp_parseRepoVer( PHB_PP_STATE pState, const char * pszFileName,
int iQuiet,
char ** pszCommitID, char ** pszCommitIDShort,
char ** pszCommitYear,
HB_ULONG * pnCommitRev, char ** pszCommitInfo,
HB_MAXINT * pnCommitRev, char ** pszCommitInfo,
char ** pszURL )
{
FILE * file_in;
Expand Down Expand Up @@ -828,7 +828,7 @@ int main( int argc, char * argv[] )
HB_BOOL fWrite = HB_FALSE, fChgLog = HB_FALSE, fRepoVer = HB_FALSE;
char * szCommitID = NULL, * szCommitIDShort = NULL;
char * szCommitYear = NULL, * szCommitInfo = NULL, * szURL = NULL;
HB_ULONG nCommitRev = 0, iResult = 0, iQuiet = 0;
HB_MAXINT nCommitRev = 0, iResult = 0, iQuiet = 0;
char * szPPRuleFuncName = NULL;
PHB_PP_STATE pState;

Expand Down
2 changes: 1 addition & 1 deletion src/vm/cmdarg.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ const char * hb_verCommitIDShort( void )
}

/* Source repository revision number */
HB_ULONG hb_verCommitRev( void )
HB_MAXINT hb_verCommitRev( void )
{
return HB_VER_COMMIT_REV;
}
Expand Down

0 comments on commit 81dc666

Please sign in to comment.