From e0cb6ef0ecaf59a5628b846da0f6c84bf02cae4d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 8 Jan 2011 12:05:32 +0000 Subject: [PATCH] 2011-01-08 13:05 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbformat/hbformac.c ! Formatted with uncrustify. ! Fixed to use HB_SIZE instead of unsigned long. --- harbour/ChangeLog | 7 +++- harbour/contrib/hbformat/hbformac.c | 64 ++++++++++++++--------------- 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a733ece43e..d2908c00e1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,12 +16,17 @@ The license applies to all entries newer than 2009-04-28. */ +2011-01-08 13:05 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbformat/hbformac.c + ! Formatted with uncrustify. + ! Fixed to use HB_SIZE instead of unsigned long. + 2011-01-08 12:31 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + src/3rd/png/pngdebug.h + src/3rd/png/pnginfo.h + src/3rd/png/pngstru.h + src/3rd/png/pnglconf.h - + Added file for png 1.5. + + Added files for png 1.5. 2011-01-08 12:25 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) - contrib/hbformat/utils/hbformac.c diff --git a/harbour/contrib/hbformat/hbformac.c b/harbour/contrib/hbformat/hbformac.c index 721330101a..c30ab42330 100644 --- a/harbour/contrib/hbformat/hbformac.c +++ b/harbour/contrib/hbformat/hbformac.c @@ -53,65 +53,65 @@ #include "hbapi.h" #include "hbapiitm.h" -/* rf_FileRead( cText, @cEol ) */ -HB_FUNC( __HBFORMAT_FILEREAD ) +HB_FUNC( __HBFORMAT_FILEREAD ) /* ( cText, @cEol ) */ { - const char * szText = hb_parcx( 1 ); - const char * ptr; - const char * ptr1; - unsigned long ul, ulLines = 0; - PHB_ITEM arr; + const char * szText = hb_parcx( 1 ); + const char * ptr; + const char * ptr1; + HB_SIZE n, nLines = 0; + PHB_ITEM arr; ptr = szText; while( *ptr ) { if( *ptr == '\r' || *ptr == '\n' ) { - if( !ulLines ) - { - hb_storclen( ptr, ( *(ptr+1) == '\r' || *(ptr+1) == '\n' ) ? 2 : 1, 2 ); - } - if( *(ptr+1) == '\r' || *(ptr+1) == '\n' ) - { - ptr ++; - } - ulLines ++; + if( ! nLines ) + hb_storclen( ptr, ( *( ptr + 1 ) == '\r' || *( ptr + 1 ) == '\n' ) ? 2 : 1, 2 ); + + if( *( ptr + 1 ) == '\r' || *( ptr + 1 ) == '\n' ) + ptr++; + + nLines++; } - else if( (unsigned int)(*ptr) < 9 ) + else if( ( unsigned int ) ( *ptr ) < 9 ) { hb_ret(); return; } - ptr ++; + ptr++; } - ptr --; - if( *ptr != '\r' && *ptr != '\n' ) - ulLines ++; - arr = hb_itemArrayNew( ulLines ); + ptr--; + + if( *ptr != '\r' && *ptr != '\n' ) + nLines++; + + arr = hb_itemArrayNew( nLines ); ptr = ptr1 = szText; - ul = 1; + n = 1; while( *ptr ) { if( *ptr == '\r' || *ptr == '\n' ) { - hb_arraySetCL( arr, ul, ptr1, ptr - ptr1 ); + hb_arraySetCL( arr, n, ptr1, ptr - ptr1 ); - if( *(ptr+1) == '\r' || *(ptr+1) == '\n' ) - ptr ++; + if( *( ptr + 1 ) == '\r' || *( ptr + 1 ) == '\n' ) + ptr++; ptr1 = ptr + 1; - ul ++; + n++; } - ptr ++; + ptr++; } - if( ul == ulLines ) + if( n == nLines ) { - if( *(ptr-1) == 0x1A ) - ptr --; - hb_arraySetCL( arr, ul, ptr1, ptr - ptr1 ); + if( *( ptr - 1 ) == 0x1A ) + ptr--; + + hb_arraySetCL( arr, n, ptr1, ptr - ptr1 ); } hb_itemReturnRelease( arr );