diff --git a/.gitignore b/.gitignore index bb378cbd1c..3813983d57 100755 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ bin/*/ obj .hbmk/ *.hbr -*.def # misc junk .DS_Store diff --git a/ChangeLog.txt b/ChangeLog.txt index a0620e0816..c52701778f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,28 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-03-31 21:22 UTC+0200 Viktor Szakats (harbour syenar.net) + * .gitignore + * deleted .def file as they are now covered by bin/*/ and + otherwise .def files do exist in source repo + + * contrib/rddads/doc/en/adsfuncs.txt + * doc/en/string.txt + * cleanups + + * utils/hbmk2/hbmk2.prg + * cleaned function skeletons in help + + * extras/hbdoc/hbdoc.prg + + include unknown COMPLIANCE value as in is doc instead of an error msg + + * src/compiler/compi18n.c + * uncrustified, tweak formatting manually + % optimized variable scopes + + * src/rtl/hbi18n2.prg + * minor formatting + 2013-03-31 20:13 UTC+0200 Viktor Szakats (harbour syenar.net) - utils/hbmk2/po/hbmk2.hu!.po - deleted accidentally added file diff --git a/contrib/rddads/doc/en/adsfuncs.txt b/contrib/rddads/doc/en/adsfuncs.txt index f015b1031b..9dc31bdb4f 100644 --- a/contrib/rddads/doc/en/adsfuncs.txt +++ b/contrib/rddads/doc/en/adsfuncs.txt @@ -7,7 +7,7 @@ $ONELINER$ Write a Binary (memo) field's contents to a file $SYNTAX$ - AdsBlob2File( cFileName, cFieldName ) --> lSuccess + AdsBlob2File( , ) --> lSuccess $ARGUMENTS$ File to create. If it already exists, it will be overwritten on success and destroyed on error. @@ -43,7 +43,7 @@ $ONELINER$ Save a Binary file to a field $SYNTAX$ - AdsFile2Blob( cFileName, cFieldName, ) --> lSuccess + AdsFile2Blob( , , ) --> lSuccess $ARGUMENTS$ File to read. Can be in UNC format. A common example is an image file. @@ -680,7 +680,7 @@ $ONELINER$ For Progress displays: Sets a codeblock to be called during indexing $SYNTAX$ - AdsRegCallback( bEval ) --> nil + AdsRegCallback( ) --> NIL $ARGUMENTS$ The codeblock that is eval'ed every 2 seconds during indexing. A numeric value of the "percent completed" is passed @@ -688,7 +688,7 @@ a logical value: .T. to abort or .F. to not stop indexing. $RETURNS$ - + NIL $DESCRIPTION$ See ace.hlp for full details on AdsRegisterProgressCallback. ace32.dll does not support the EVAL/EVERY clauses. Remember, there @@ -734,11 +734,11 @@ $ONELINER$ Clears the callback set by AdsRegCallback(). $SYNTAX$ - AdsClrCallback() --> nil + AdsClrCallback() --> NIL $ARGUMENTS$ $RETURNS$ - + NIL $DESCRIPTION$ See AdsRegCallback(). $EXAMPLES$ diff --git a/doc/en/string.txt b/doc/en/string.txt index 613f1c3797..2a64319c05 100644 --- a/doc/en/string.txt +++ b/doc/en/string.txt @@ -698,7 +698,7 @@ A string representation of using default conversions. $DESCRIPTION$ - HB_VALTOSTR can be used to convert any scalar value to a string. + hb_ValToStr() can be used to convert any scalar value to a string. $EXAMPLES$ Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) ? hb_ValToStr( 4 ) == " 4" diff --git a/extras/hbdoc/hbdoc.prg b/extras/hbdoc/hbdoc.prg index 23d731c56a..75146f04fd 100644 --- a/extras/hbdoc/hbdoc.prg +++ b/extras/hbdoc/hbdoc.prg @@ -805,7 +805,7 @@ FUNCTION Decode( cType, hsBlock, cKey ) IF ( idx := AScan( p_aPlatforms, {| a | a[ 1 ] == cCode } ) ) > 0 RETURN p_aPlatforms[ idx ][ 2 ] ELSE - RETURN "Unknown 'PLATFORMS' code: '" + cCode + "'" + RETURN cCode ENDIF CASE cType == "COMPLIANCE" @@ -840,7 +840,7 @@ FUNCTION Decode( cType, hsBlock, cKey ) ELSEIF ! hb_HHasKey( hsBlock, "RETURNS" ) RETURN hsBlock[ "NAME" ] ELSEIF Empty( hsBlock[ "RETURNS" ] ) .OR. ; - Lower( hsBlock[ "RETURNS" ] ) == "nil" .OR. ; + Upper( hsBlock[ "RETURNS" ] ) == "NIL" .OR. ; Lower( hsBlock[ "RETURNS" ] ) == "none" .OR. ; Lower( hsBlock[ "RETURNS" ] ) == "none." diff --git a/src/compiler/compi18n.c b/src/compiler/compi18n.c index 781dfa5203..d6b3f2f7d7 100644 --- a/src/compiler/compi18n.c +++ b/src/compiler/compi18n.c @@ -53,11 +53,11 @@ /* ============================ I18N ============================ */ static PHB_I18NTABLE hb_compI18nCreate( void ) { - PHB_I18NTABLE pI18n; + PHB_I18NTABLE pI18n; pI18n = ( PHB_I18NTABLE ) hb_xgrab( sizeof( HB_I18NTABLE ) ); - pI18n->pString = NULL; - pI18n->uiCount = 0; + pI18n->pString = NULL; + pI18n->uiCount = 0; pI18n->uiAllocated = 0; return pI18n; @@ -87,7 +87,7 @@ void hb_compI18nFree( HB_COMP_DECL ) static int hb_compI18nCompare( PHB_I18NSTRING pString, const char * pText, const char * pContext ) { - int i; + int i; i = pString->szText == pText ? 0 : pString->szText > pText ? 1 : -1; if( i == 0 && pString->szContext != pContext ) @@ -102,7 +102,6 @@ static PHB_I18NSTRING hb_compI18nAddSingle( HB_COMP_DECL, const char * szText, c PHB_I18NTABLE pI18n; PHB_I18NSTRING pString; HB_UINT uiLeft, uiRight, uiMiddle; - int iCompare; if( ! HB_COMP_PARAM->pI18n ) HB_COMP_PARAM->pI18n = hb_compI18nCreate(); @@ -117,21 +116,23 @@ static PHB_I18NSTRING hb_compI18nAddSingle( HB_COMP_DECL, const char * szText, c if( pI18n->pString ) { pI18n->uiAllocated += 32; - pI18n->pString = ( PHB_I18NSTRING ) hb_xrealloc( pI18n->pString, sizeof( HB_I18NSTRING ) - * pI18n->uiAllocated ); + pI18n->pString = ( PHB_I18NSTRING ) hb_xrealloc( pI18n->pString, sizeof( HB_I18NSTRING ) + * pI18n->uiAllocated ); } else { - pI18n->pString = ( PHB_I18NSTRING ) hb_xgrab( sizeof( HB_I18NSTRING ) * 32 ); + pI18n->pString = ( PHB_I18NSTRING ) hb_xgrab( sizeof( HB_I18NSTRING ) * 32 ); pI18n->uiAllocated = 32; } } - uiLeft = 0; + uiLeft = 0; uiRight = pI18n->uiCount; while( uiLeft < uiRight ) { + int iCompare; + uiMiddle = ( uiLeft + uiRight ) >> 1; iCompare = hb_compI18nCompare( &pI18n->pString[ uiMiddle ], szText, szContext ); @@ -165,13 +166,13 @@ static PHB_I18NSTRING hb_compI18nAddSingle( HB_COMP_DECL, const char * szText, c memmove( &pI18n->pString[ uiLeft + 1 ], &pI18n->pString[ uiLeft ], ( pI18n->uiCount - uiLeft ) * sizeof( HB_I18NSTRING ) ); - pString = &pI18n->pString[ uiLeft ]; - pString->szText = szText; - pString->szContext = szContext; + pString = &pI18n->pString[ uiLeft ]; + pString->szText = szText; + pString->szContext = szContext; pString->pPos.uiLine = uiLine; pString->pPos.szFile = szModule; - pString->uiPosCount = 0; - pString->uiPlurals = 0; + pString->uiPosCount = 0; + pString->uiPlurals = 0; pI18n->uiCount++; @@ -186,25 +187,25 @@ void hb_compI18nAdd( HB_COMP_DECL, const char * szText, const char * szContext, void hb_compI18nAddPlural( HB_COMP_DECL, const char ** szTexts, HB_ULONG ulCount, const char * szContext, const char * szModule, HB_UINT uiLine ) { - PHB_I18NSTRING pString; + PHB_I18NSTRING pString = hb_compI18nAddSingle( HB_COMP_PARAM, szTexts[ 0 ], szContext, szModule, uiLine ); - pString = hb_compI18nAddSingle( HB_COMP_PARAM, szTexts[ 0 ], szContext, szModule, uiLine ); if( ulCount == 1 ) { /* set the same string as plural form to mark it as plural text */ if( ! pString->uiPlurals ) { pString->szPlurals[ 0 ] = pString->szText; - pString->uiPlurals = 1; + pString->uiPlurals = 1; } } else { - HB_ULONG ul, ulPlural; + HB_ULONG ul; for( ul = 1; ul < ulCount && pString->uiPlurals < HB_I18N_PLURAL_MAX; ++ul ) { const char * szText = hb_compIdentifierNew( HB_COMP_PARAM, szTexts[ ul ], HB_IDENT_COPY ); + HB_ULONG ulPlural; for( ulPlural = 0; ulPlural < pString->uiPlurals; ++ulPlural ) { @@ -253,7 +254,7 @@ static void hb_compI18nEscapeString( FILE * file, const char * szText ) static char * hb_compI18nFileName( char * szBuffer, const char * szFileName ) { HB_UINT ui = 0; - char ch; + char ch; do { @@ -274,25 +275,26 @@ static char * hb_compI18nFileName( char * szBuffer, const char * szFileName ) HB_BOOL hb_compI18nSave( HB_COMP_DECL, HB_BOOL fFinal ) { - PHB_I18NTABLE pI18n; - PHB_I18NSTRING pString; - HB_FNAME FileName; - char szFileName[ HB_PATH_MAX ]; - char* szText; - HB_UINT uiIndex, uiLine; - FILE* file; + PHB_I18NTABLE pI18n; + HB_FNAME FileName; + char szFileName[ HB_PATH_MAX ]; + char * szText; + HB_UINT uiIndex; + FILE * file; pI18n = HB_COMP_PARAM->pI18n; if( ! pI18n ) return HB_FALSE; - FileName.szPath = FileName.szName = FileName.szExtension = - FileName.szDrive = NULL; + FileName.szPath = + FileName.szName = + FileName.szExtension = + FileName.szDrive = NULL; if( HB_COMP_PARAM->pOutPath ) { FileName.szDrive = HB_COMP_PARAM->pOutPath->szDrive; - FileName.szPath = HB_COMP_PARAM->pOutPath->szPath; + FileName.szPath = HB_COMP_PARAM->pOutPath->szPath; } if( HB_COMP_PARAM->pI18nFileName ) @@ -306,7 +308,7 @@ HB_BOOL hb_compI18nSave( HB_COMP_DECL, HB_BOOL fFinal ) if( HB_COMP_PARAM->pI18nFileName->szPath ) { FileName.szDrive = HB_COMP_PARAM->pI18nFileName->szDrive; - FileName.szPath = HB_COMP_PARAM->pI18nFileName->szPath; + FileName.szPath = HB_COMP_PARAM->pI18nFileName->szPath; } } @@ -337,14 +339,17 @@ HB_BOOL hb_compI18nSave( HB_COMP_DECL, HB_BOOL fFinal ) for( uiIndex = 0; uiIndex < pI18n->uiCount; uiIndex++ ) { - pString = &pI18n->pString[ uiIndex ]; + PHB_I18NSTRING pString = &pI18n->pString[ uiIndex ]; + HB_UINT uiLine; - fprintf( file, "#: %s:%d", hb_compI18nFileName( szFileName, pString->pPos.szFile ), - pString->pPos.uiLine ); + fprintf( file, "#: %s:%d", + hb_compI18nFileName( szFileName, pString->pPos.szFile ), + pString->pPos.uiLine ); for( uiLine = 0; uiLine < pString->uiPosCount; ++uiLine ) - fprintf( file, " %s:%d", hb_compI18nFileName( szFileName, pString->pPosLst[ uiLine ].szFile ), - pString->pPosLst[ uiLine ].uiLine ); + fprintf( file, " %s:%d", + hb_compI18nFileName( szFileName, pString->pPosLst[ uiLine ].szFile ), + pString->pPosLst[ uiLine ].uiLine ); fprintf( file, "\n#, c-format\n" ); diff --git a/src/rtl/hbi18n2.prg b/src/rtl/hbi18n2.prg index 04da7fa79d..73d6d3a841 100644 --- a/src/rtl/hbi18n2.prg +++ b/src/rtl/hbi18n2.prg @@ -71,7 +71,6 @@ STATIC FUNCTION __i18n_fileName( cFileName ) RETURN cFileName STATIC FUNCTION __i18n_strEncode( cStr ) - RETURN SubStr( hb_StrToExp( cStr, .T. ), 2 ) STATIC FUNCTION __i18n_strDecode( cLine, cValue, lCont ) diff --git a/utils/hbmk2/hbmk2.prg b/utils/hbmk2/hbmk2.prg index b7d063f723..64c20e99f1 100644 --- a/utils/hbmk2/hbmk2.prg +++ b/utils/hbmk2/hbmk2.prg @@ -16225,26 +16225,26 @@ STATIC PROCEDURE ShowHelp( hbmk, lMore, lLong ) LOCAL aLst_APIPlugin := { ; NIL, ; - { "hbmk_Register_Input_File_Extension( hbmk, cExt ) -> NIL" , I_( "Register input file extension to be passed to plugin (by default all unknown file extensions are passed to Harbour compiler)." ) }, ; - { "hbmk_AddInput_PRG( hbmk, cFileName ) -> NIL" , I_( "Add a Harbour input file to the project." ) }, ; - { "hbmk_AddInput_C( hbmk, cFileName ) -> NIL" , I_( "Add a C input file to the project." ) }, ; - { "hbmk_AddInput_CPP( hbmk, cFileName ) -> NIL" , I_( "Add a C++ input file to the project." ) }, ; - { "hbmk_AddInput_RC( hbmk, cFileName ) -> NIL" , I_( "Add a Windows resource input file to the project." ) }, ; - { "hbmk_AddInput_OBJ( hbmk, cFileName ) -> NIL" , I_( "Add a binary object file to the project." ) }, ; - { "hbmk_AddInput_INSTFILE( hbmk, cFileName, [] ) -> NIL" , I_( "Add a file to be installed, with an optional -instpath= group name." ) }, ; - { "hbmk_OutStd( hbmk, cText ) -> NIL" , I_( "Output text to stdout." ) }, ; - { "hbmk_OutErr( hbmk, cText ) -> NIL" , I_( "Output text to stderr." ) }, ; + { "hbmk_Register_Input_File_Extension( hbmk, ) -> NIL" , I_( "Register input file extension to be passed to plugin (by default all unknown file extensions are passed to Harbour compiler)." ) }, ; + { "hbmk_AddInput_PRG( hbmk, ) -> NIL" , I_( "Add a Harbour input file to the project." ) }, ; + { "hbmk_AddInput_C( hbmk, ) -> NIL" , I_( "Add a C input file to the project." ) }, ; + { "hbmk_AddInput_CPP( hbmk, ) -> NIL" , I_( "Add a C++ input file to the project." ) }, ; + { "hbmk_AddInput_RC( hbmk, ) -> NIL" , I_( "Add a Windows resource input file to the project." ) }, ; + { "hbmk_AddInput_OBJ( hbmk, ) -> NIL" , I_( "Add a binary object file to the project." ) }, ; + { "hbmk_AddInput_INSTFILE( hbmk, , [] ) -> NIL" , I_( "Add a file to be installed, with an optional -instpath= group name." ) }, ; + { "hbmk_OutStd( hbmk, ) -> NIL" , I_( "Output text to stdout." ) }, ; + { "hbmk_OutErr( hbmk, ) -> NIL" , I_( "Output text to stderr." ) }, ; { "hbmk_OutStdRaw( hbmk, ... ) -> NIL" , I_( "Output text to stdout without any formatting." ) }, ; { "hbmk_OutErrRaw( hbmk, ... ) -> NIL" , I_( "Output text to stderr without any formatting." ) }, ; { "hbmk_Macro( hbmk, ) -> " , hb_StrFormat( I_( "Evaluate %1$s macro expression." ), _SELF_NAME_ ) }, ; - { "hbmk_FNameEscape( hbmk, cFileName ) -> " , I_( "Escape/quote filename for using it as external command parameter." ) }, ; - { "hbmk_PathSepToTarget( hbmk, cFileName ) -> " , I_( "Convert filename to the format required for the target toolchain." ) }, ; + { "hbmk_FNameEscape( hbmk, ) -> " , I_( "Escape/quote filename for using it as external command parameter." ) }, ; + { "hbmk_PathSepToTarget( hbmk, ) -> " , I_( "Convert filename to the format required for the target toolchain." ) }, ; { "hbmk_PathSepToForward( ) -> " , I_( "Convert filename to have forward slash directory separators." ) }, ; { "hbmk_PathFromWorkdirToCWD( hbmk ) -> " , I_( "Return relative path of -workdir= value from current working directory." ) }, ; { "hbmk_FindInPath( , [], [] ) -> | NIL" , I_( "Find file in (array or pathsep delimited string are accepted) with list of alternate extensions (defaults to executable binaries). Returns filename if found and NIL if not." ) }, ; { "hbmk_FNameDirExtSet( , [], [] ) -> " , I_( "Change directory and/or extension in filename." ) }, ; { "hbmk_FuncNameEncode( ) -> " , I_( "Encode function name according to Harbour compiler rules for forming HB_FUNC() function names in C code." ) }, ; - { "hbmk_StrStripQuote( cString ) -> " , I_( "Strip double quote enclosure from a string." ) }, ; + { "hbmk_StrStripQuote( ) -> " , I_( "Strip double quote enclosure from a string." ) }, ; { "hbmk_ArrayToList( , [] ) -> " , I_( "Convert array of strings to a string. Default separator is a single space." ) } } LOCAL aHdr_PluginVars := { ;