diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3940e33171..8dc3f35c04 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,27 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-15 13:55 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/gtwvg/wvgwin.c + * contrib/hbamf/amfdec.c + * contrib/hbamf/amfenc.c + * contrib/hblzf/core.c + * contrib/hbpgsql/postgres.c + * contrib/hbxdiff/core.c + * contrib/hbzebra/codabar.c + * contrib/hbzebra/code39.c + * contrib/hbzebra/code93.c + * contrib/hbzebra/core.c + * contrib/hbzebra/qrcode.c + * contrib/rddads/ads1.c + ! fixed various 64-bit problems revealed by compiler warnings + (used casts, changed variables type, changed Harbour + API functions, please review especially hbamf, hbzebra and gtwvg) + + * extras/httpsrv/uhttpd.prg + + changed to use keyboard events to detect window close, + instead of deprecated and now dummy feature HB_GTI_NOTIFIERBLOCK + 2012-10-15 13:43 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * harbour/contrib/hbwin/win_prn1.c ! disabled EnumFontFamiliesEx() in WinCE builds diff --git a/harbour/contrib/gtwvg/wvgwin.c b/harbour/contrib/gtwvg/wvgwin.c index 6f5982e78d..3bc367a0cb 100644 --- a/harbour/contrib/gtwvg/wvgwin.c +++ b/harbour/contrib/gtwvg/wvgwin.c @@ -1444,19 +1444,19 @@ HB_FUNC( WVG_SENDCBMESSAGE ) switch( msg ) { case CB_ADDSTRING : // Adds a string to the list box of a combo box. If the combo box does not have the CBS_SORT style, the string is added to the end of the list. Otherwise, the string is inserted into the list, and the list is sorted. - hb_retni( SendMessage( hCB, CB_ADDSTRING, ( WPARAM ) NULL, ( LPARAM ) ( LPCTSTR ) HB_PARSTR( 3, &hText, NULL ) ) ); + hb_retnint( SendMessage( hCB, CB_ADDSTRING, ( WPARAM ) NULL, ( LPARAM ) ( LPCTSTR ) HB_PARSTR( 3, &hText, NULL ) ) ); break; case CB_DELETESTRING : // Deletes a string in the list box of a combo box. - hb_retni( SendMessage( hCB, CB_DELETESTRING, hb_parni( 3 ), 0 ) ); + hb_retnint( SendMessage( hCB, CB_DELETESTRING, hb_parni( 3 ), 0 ) ); break; case CB_DIR : // Adds names to the list displayed by the combo box. The message adds the names of directories and files that match a specified string and set of file attributes. CB_DIR can also add mapped drive letters to the list. - hb_retni( SendMessage( hCB, CB_DIR, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); + hb_retnint( SendMessage( hCB, CB_DIR, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); break; case CB_FINDSTRING : // Searches the list box of a combo box for an item beginning with the characters in a specified string. - hb_retni( SendMessage( hCB, CB_FINDSTRING, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); + hb_retnint( SendMessage( hCB, CB_FINDSTRING, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); break; case CB_FINDSTRINGEXACT : // Finds the first list box string in a combo box that matches the string specified in the lParam parameter. - hb_retni( SendMessage( hCB, CB_FINDSTRINGEXACT, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); + hb_retnint( SendMessage( hCB, CB_FINDSTRINGEXACT, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); break; case CB_GETCOMBOBOXINFO : // Gets information about the specified combo box. { @@ -1500,14 +1500,14 @@ HB_FUNC( WVG_SENDCBMESSAGE ) break; } case CB_GETCOUNT : // Gets the number of items in the list box of a combo box. - hb_retni( SendMessage( hCB, CB_GETCOUNT, 0, 0 ) ); + hb_retnint( SendMessage( hCB, CB_GETCOUNT, 0, 0 ) ); break; #if defined( CB_GETCUEBANNER ) case CB_GETCUEBANNER : // Gets the cue banner text displayed in the edit control of a combo box. Send this message explicitly or by using the ComboBox_GetCueBannerText macro. break; #endif case CB_GETCURSEL : // An application sends a CB_GETCURSEL message to retrieve the index of the currently selected item, if any, in the list box of a combo box. - hb_retni( SendMessage( hCB, CB_GETCURSEL, 0, 0 ) ); + hb_retnint( SendMessage( hCB, CB_GETCURSEL, 0, 0 ) ); break; case CB_GETDROPPEDCONTROLRECT : // An application sends a CB_GETDROPPEDCONTROLRECT message to retrieve the screen coordinates of a combo box in its dropped-down state. { @@ -1526,14 +1526,14 @@ HB_FUNC( WVG_SENDCBMESSAGE ) break; } case CB_GETDROPPEDSTATE : // Determines whether the list box of a combo box is dropped down. - hb_retl( SendMessage( hCB, CB_GETDROPPEDSTATE, 0, 0 ) ); + hb_retnint( SendMessage( hCB, CB_GETDROPPEDSTATE, 0, 0 ) ); break; case CB_GETDROPPEDWIDTH : // Gets the minimum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style. - hb_retni( SendMessage( hCB, CB_GETDROPPEDWIDTH, 0, 0 ) ); + hb_retnint( SendMessage( hCB, CB_GETDROPPEDWIDTH, 0, 0 ) ); break; case CB_GETEDITSEL : // Gets the starting and ending character positions of the current selection in the edit control of a combo box. { - DWORD range = SendMessage( hCB, CB_GETEDITSEL, ( WPARAM ) NULL, ( LPARAM ) NULL ); + DWORD range = ( DWORD ) SendMessage( hCB, CB_GETEDITSEL, ( WPARAM ) NULL, ( LPARAM ) NULL ); PHB_ITEM pRng = hb_itemNew( NULL ); hb_arrayNew( pRng, 2 ); @@ -1544,20 +1544,20 @@ HB_FUNC( WVG_SENDCBMESSAGE ) break; } case CB_GETEXTENDEDUI : // Determines whether a combo box has the default user interface or the extended user interface. - hb_retl( SendMessage( hCB, CB_GETEXTENDEDUI, 0, 0 ) ); + hb_retnint( SendMessage( hCB, CB_GETEXTENDEDUI, 0, 0 ) ); break; case CB_GETHORIZONTALEXTENT : // Gets the width, in pixels, that the list box can be scrolled horizontally (the scrollable width). This is applicable only if the list box has a horizontal scroll bar. - hb_retni( SendMessage( hCB, CB_GETHORIZONTALEXTENT, 0, 0 ) ); + hb_retnint( SendMessage( hCB, CB_GETHORIZONTALEXTENT, 0, 0 ) ); break; case CB_GETITEMDATA : // An application sends a CB_GETITEMDATA message to a combo box to retrieve the application-supplied value associated with the specified item in the combo box. - hb_retnint( SendMessage( hCB, CB_GETITEMDATA, hb_parni( 3 ), 0 ) ); + hb_retnint( SendMessage( hCB, CB_GETITEMDATA, hb_parnint( 3 ), 0 ) ); break; case CB_GETITEMHEIGHT : // Determines the height of list items or the selection field in a combo box. - hb_retni( SendMessage( hCB, CB_GETITEMHEIGHT, 0, 0 ) ); + hb_retnint( SendMessage( hCB, CB_GETITEMHEIGHT, 0, 0 ) ); break; case CB_GETLBTEXT : // Gets a string from the list of a combo box. { - int iSize = SendMessage( hCB, CB_GETLBTEXTLEN, hb_parni( 3 ), 0 ); + HB_ISIZ iSize = SendMessage( hCB, CB_GETLBTEXTLEN, hb_parnint( 3 ), 0 ); LPTSTR text = ( LPTSTR ) hb_xgrab( iSize + 1 ); SendMessage( hCB, CB_GETLBTEXT, iSize, ( LPARAM ) text ); HB_RETSTR( text ); @@ -1565,21 +1565,21 @@ HB_FUNC( WVG_SENDCBMESSAGE ) break; } case CB_GETLBTEXTLEN : // Gets the length, in characters, of a string in the list of a combo box. - hb_retni( SendMessage( hCB, CB_GETLBTEXTLEN, hb_parni( 3 ), 0 ) ); + hb_retnint( SendMessage( hCB, CB_GETLBTEXTLEN, hb_parnint( 3 ), 0 ) ); break; case CB_GETLOCALE : // Gets the current locale of the combo box. The locale is used to determine the correct sorting order of displayed text for combo boxes with the CBS_SORT style and text added by using the CB_ADDSTRING message. #if ( _WIN32_IE >= 0x0600 ) case CB_GETMINVISIBLE : // Gets the minimum number of visible items in the drop-down list of a combo box. - hb_retni( SendMessage( hCB, CB_GETMINVISIBLE, 0, 0 ) ); + hb_retnint( SendMessage( hCB, CB_GETMINVISIBLE, 0, 0 ) ); break; #endif case CB_GETTOPINDEX : // An application sends the CB_GETTOPINDEX message to retrieve the zero-based index of the first visible item in the list box portion of a combo box. Initially, the item with index 0 is at the top of the list box, but if the list box contents have been scrolled, another item may be at the top. - hb_retni( SendMessage( hCB, CB_GETTOPINDEX, 0, 0 ) ); + hb_retnint( SendMessage( hCB, CB_GETTOPINDEX, 0, 0 ) ); break; case CB_INITSTORAGE : // An application sends the CB_INITSTORAGE message before adding a large number of items to the list box portion of a combo box. This message allocates memory for storing list box items. break; case CB_INSERTSTRING : // Inserts a string or item data into the list of a combo box. Unlike the CB_ADDSTRING message, the CB_INSERTSTRING message does not cause a list with the CBS_SORT style to be sorted. - hb_retni( SendMessage( hCB, CB_INSERTSTRING, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); + hb_retnint( SendMessage( hCB, CB_INSERTSTRING, ( WPARAM ) hb_parnint( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); break; case CB_LIMITTEXT : // Limits the length of the text the user may type into the edit control of a combo box. SendMessage( hCB, CB_LIMITTEXT, hb_parni( 3 ), 0 ); @@ -1588,17 +1588,17 @@ HB_FUNC( WVG_SENDCBMESSAGE ) SendMessage( hCB, CB_RESETCONTENT, 0, 0 ); break; case CB_SELECTSTRING : // Searches the list of a combo box for an item that begins with the characters in a specified string. If a matching item is found, it is selected and copied to the edit control. - hb_retni( SendMessage( hCB, CB_SELECTSTRING, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); + hb_retnint( SendMessage( hCB, CB_SELECTSTRING, ( WPARAM ) hb_parnint( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); break; #if defined( CB_SETCUEBANNER ) case CB_SETCUEBANNER : // Sets the cue banner text that is displayed for the edit control of a combo box. break; #endif case CB_SETCURSEL : // An application sends a CB_SETCURSEL message to select a string in the list of a combo box. If necessary, the list scrolls the string into view. The text in the edit control of the combo box changes to reflect the new selection, and any previous selection in the list is removed. - hb_retni( SendMessage( hCB, CB_SETCURSEL, hb_parni( 3 ), 0 ) ); + hb_retnint( SendMessage( hCB, CB_SETCURSEL, hb_parnint( 3 ), 0 ) ); break; case CB_SETDROPPEDWIDTH : // An application sends the CB_SETDROPPEDWIDTH message to set the maximum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style. - hb_retni( SendMessage( hCB, CB_SETDROPPEDWIDTH, hb_parni( 3 ), 0 ) ); + hb_retnint( SendMessage( hCB, CB_SETDROPPEDWIDTH, hb_parnint( 3 ), 0 ) ); break; case CB_SETEDITSEL : // An application sends a CB_SETEDITSEL message to select characters in the edit control of a combo box. break; @@ -1612,18 +1612,18 @@ HB_FUNC( WVG_SENDCBMESSAGE ) SendMessage( hCB, CB_SETITEMDATA, hb_parl( 3 ), ( LPARAM ) hb_parnint( 4 ) ); break; case CB_SETITEMHEIGHT : // An application sends a CB_SETITEMHEIGHT message to set the height of list items or the selection field in a combo box. - hb_retni( SendMessage( hCB, CB_SETITEMHEIGHT, hb_parni( 3 ), 0 ) ); + hb_retnint( SendMessage( hCB, CB_SETITEMHEIGHT, hb_parnint( 3 ), 0 ) ); break; case CB_SETLOCALE : // An application sends a CB_SETLOCALE message to set the current locale of the combo box. If the combo box has the CBS_SORT style and strings are added using CB_ADDSTRING, the locale of a combo box affects how list items are sorted. hb_retnint( SendMessage( hCB, CB_SETLOCALE, ( WPARAM ) hb_parnint( 3 ), 0 ) ); break; #if ( _WIN32_IE >= 0x0600 ) case CB_SETMINVISIBLE : // An application sends a CB_SETMINVISIBLE message to set the minimum number of visible items in the drop-down list of a combo box. - hb_retl( SendMessage( hCB, CB_SETMINVISIBLE, hb_parni( 3 ), 0 ) ); + hb_retl( SendMessage( hCB, CB_SETMINVISIBLE, hb_parnint( 3 ), 0 ) ); break; #endif case CB_SETTOPINDEX : // An application sends the CB_SETTOPINDEX message to ensure that a particular item is visible in the list box of a combo box. The system scrolls the list box contents so that either the specified item appears at the top of the list box or the maximum scroll range has been reached. - hb_retl( SendMessage( hCB, CB_SETTOPINDEX, hb_parni( 3 ), 0 ) ? FALSE : TRUE ); + hb_retl( SendMessage( hCB, CB_SETTOPINDEX, hb_parnint( 3 ), 0 ) ? FALSE : TRUE ); break; case CB_SHOWDROPDOWN : // An application sends a CB_SHOWDROPDOWN message to show or hide the list box of a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style. SendMessage( hCB, CB_SHOWDROPDOWN, hb_parl( 3 ), 0 ); diff --git a/harbour/contrib/hbamf/amfdec.c b/harbour/contrib/hbamf/amfdec.c index 21609d5b29..626d55c2e4 100644 --- a/harbour/contrib/hbamf/amfdec.c +++ b/harbour/contrib/hbamf/amfdec.c @@ -29,8 +29,8 @@ typedef struct { const char * cBuf; - int position; - int length; + HB_ISIZ position; + HB_ISIZ length; PHB_ITEM obj_ref; PHB_ITEM str_ref; PHB_ITEM class_ref; @@ -78,7 +78,7 @@ static PHB_ITEM hbamf_cls_externalizable_instance( PHB_ITEM pClassFuncStr ) static char * readByte( amfContext * context ) { - int new_position = context->position + 1; + HB_ISIZ new_position = context->position + 1; char * byte_ref; if( new_position < 0 || new_position > context->length ) @@ -89,9 +89,9 @@ static char * readByte( amfContext * context ) return byte_ref; } -static char * readBytes( amfContext * context, int len ) +static char * readBytes( amfContext * context, HB_ISIZ len ) { - int new_position = context->position + len; + HB_ISIZ new_position = context->position + len; char * result; if( new_position < 0 || new_position > context->length ) @@ -236,7 +236,7 @@ static void amf3_add_reference( PHB_ITEM pHash, PHB_ITEM pItem ) sequentially - this means we can also use an array, not hash for the purpose */ - hb_itemPutNI( pKey, /* ++ first one was 0 */ iRef ); + hb_itemPutNS( pKey, /* ++ first one was 0 */ iRef ); hb_hashAdd( pHash, pKey, pItem ); hb_itemRelease( pKey ); diff --git a/harbour/contrib/hbamf/amfenc.c b/harbour/contrib/hbamf/amfenc.c index a19b6cf2a0..68d3ea9158 100644 --- a/harbour/contrib/hbamf/amfenc.c +++ b/harbour/contrib/hbamf/amfenc.c @@ -34,8 +34,8 @@ typedef struct { char * cBuf; - int position; - int length; + HB_ISIZ position; + HB_ISIZ length; HB_BOOL use_refs; HB_BOOL use_strstr; HB_BOOL str_rtrim; @@ -71,10 +71,10 @@ static void _ref_realItemPtr( PHB_ITEM pKey, PHB_ITEM pItem ) } } -static int bufferGrow( amfContext * context, int len ) +static HB_ISIZ bufferGrow( amfContext * context, HB_ISIZ len ) { - int new_len = context->position + len; - int current_len = context->length; + HB_ISIZ new_len = context->position + len; + HB_ISIZ current_len = context->length; while( new_len > current_len ) current_len *= 2; @@ -101,7 +101,7 @@ static int writeByte( amfContext * context, char byte ) return 1; } -static int writeBuffer( amfContext * context, const char * str, int len ) +static HB_ISIZ writeBuffer( amfContext * context, const char * str, HB_ISIZ len ) { if( bufferGrow( context, len ) == -1 ) return 0; @@ -299,7 +299,7 @@ static int amf3_add_index( amfContext * context, PHB_ITEM pHash, PHB_ITEM pItem hb_itemRelease( pVal ); hb_itemRelease( pKey ); - result = ( int ) hb_hashLen( pHash ) - 1 + context->strstr_count; + result = ( int ) ( hb_hashLen( pHash ) - 1 + context->strstr_count ); /* used only when some inner context inside * conversion function uses only strstr mode * like AMF3_FROMWA function f.e. */ @@ -311,7 +311,7 @@ static int amf3_add_index( amfContext * context, PHB_ITEM pHash, PHB_ITEM pItem if( str_len > 3 && str_len < 32 ) /* do this only for mid-sized strings */ { if( ! context->use_refs ) - result = context->strstr_count; + result = ( int ) context->strstr_count; pVal = hb_itemPutNS( NULL, result ); /* put the AMF reference id as value */ hb_hashAdd( context->strstr_ref, pItem, pVal ); @@ -343,7 +343,7 @@ static int amf3_get_index( amfContext * context, PHB_ITEM pHash, PHB_ITEM pItem if( hb_hashScan( pHash, pKey, &nPos ) ) { hb_itemRelease( pKey ); - return nPos - 1; + return ( int ) ( nPos - 1 ); } else hb_itemRelease( pKey ); @@ -356,7 +356,7 @@ static int amf3_get_index( amfContext * context, PHB_ITEM pHash, PHB_ITEM pItem { pStrIdx = hb_hashGetItemPtr( context->strstr_ref, pItem, 0 ); if( pStrIdx ) - return hb_itemGetNS( pStrIdx ); + return ( int ) hb_itemGetNS( pStrIdx ); else return -1; } @@ -433,9 +433,9 @@ static HB_BOOL amf3_encode_hash( amfContext * context, PHB_ITEM pItem ) { PHB_ITEM pKey; PHB_ITEM pVal; - int i; - int len = hb_hashLen( pItem ); - int nIntKeys = 0; + HB_ISIZ i; + HB_ISIZ len = hb_hashLen( pItem ); + HB_ISIZ nIntKeys = 0; if( ( ( ( hb_hashGetFlags( pItem ) & HB_HASH_KEEPORDER ) != 0 && HB_IS_INTEGER( hb_hashGetKeyAt( pItem, 1 ) ) ) @@ -449,7 +449,7 @@ static HB_BOOL amf3_encode_hash( amfContext * context, PHB_ITEM pItem ) } } - if( ! amf3_encode_int( context, ( nIntKeys << 1 ) | REFERENCE_BIT ) ) + if( ! amf3_encode_int( context, ( int ) ( ( nIntKeys << 1 ) | REFERENCE_BIT ) ) ) return HB_FALSE; for( i = 1; i <= len; i++ ) @@ -489,8 +489,8 @@ static HB_BOOL amf3_encode_dynamic_dict( amfContext * context, PHB_ITEM pItem ) { PHB_ITEM pKey; PHB_ITEM pVal; - int i; - int len = hb_hashLen( pItem ); + HB_ISIZ i; + HB_ISIZ len = hb_hashLen( pItem ); for( i = 1; i <= len; i++ ) { @@ -531,9 +531,9 @@ static HB_BOOL amf3_write_hash( amfContext * context, PHB_ITEM pItem ) return amf3_serialize_hash( context, pItem ); } -static int amf3_encode_byte_array( amfContext * context, PHB_ITEM pItem ) +static HB_ISIZ amf3_encode_byte_array( amfContext * context, PHB_ITEM pItem ) { - int item_len; + HB_ISIZ item_len; const char * bytes; if( HB_IS_STRING( pItem ) || HB_IS_MEMO( pItem ) ) @@ -550,7 +550,7 @@ static int amf3_encode_byte_array( amfContext * context, PHB_ITEM pItem ) return writeBuffer( context, bytes, item_len ); } -static int amf3_serialize_byte_array( amfContext * context, PHB_ITEM pItem ) +static HB_ISIZ amf3_serialize_byte_array( amfContext * context, PHB_ITEM pItem ) { int result; @@ -631,8 +631,8 @@ static int amf3_encode_class_def( amfContext * context, PHB_ITEM pClass ) { int header; int result; - int static_attr_len; - int i; + HB_ISIZ static_attr_len; + HB_ISIZ i; PHB_ITEM class_alias; PHB_ITEM static_attrs; /* PHB_ITEM attr_len = NULL; */ @@ -866,7 +866,7 @@ static HB_BOOL amf3_encode_object( amfContext * context, PHB_ITEM pItem ) return HB_FALSE; } - result = amf3_encode_byte_array( context, pStr ); + result = amf3_encode_byte_array( context, pStr ) != 0; hb_itemRelease( pClass ); hb_itemMove( hb_stackReturnItem(), pRetCopy ); @@ -953,7 +953,7 @@ static HB_BOOL amf3_serialize_object( amfContext * context, PHB_ITEM pItem ) PHB_ITEM pStr = hb_itemNew( NULL ); hb_arrayGet( pItem, 1, pStr ); context->position--; - result = amf3_encode_byte_array( context, pStr ); + result = amf3_encode_byte_array( context, pStr ) != 0; hb_itemRelease( pStr ); return result; } @@ -1024,7 +1024,7 @@ static HB_BOOL amf3_encode( amfContext * context, PHB_ITEM pItem ) if( ! writeByte( context, BYTE_ARRAY_TYPE ) ) result = HB_FALSE; else - result = amf3_serialize_byte_array( context, pItem ); + result = amf3_serialize_byte_array( context, pItem ) != 0; } else { diff --git a/harbour/contrib/hblzf/core.c b/harbour/contrib/hblzf/core.c index ef258f71ff..760ef3fc0d 100644 --- a/harbour/contrib/hblzf/core.c +++ b/harbour/contrib/hblzf/core.c @@ -129,7 +129,7 @@ HB_FUNC( HB_LZF_COMPRESS ) if( out_data ) { - unsigned int uiResult = lzf_compress( in_data, in_len, out_data, out_len ); + unsigned int uiResult = lzf_compress( in_data, ( unsigned int ) in_len, out_data, ( unsigned int ) out_len ); if( uiResult != 0 ) { @@ -199,7 +199,7 @@ HB_FUNC( HB_LZF_DECOMPRESS ) buffer_size <<= 1; buffer = ( char * ) hb_xrealloc( buffer, buffer_size + 1 ); - uiResult = lzf_decompress( in_data, in_len, buffer, buffer_size ); + uiResult = lzf_decompress( in_data, ( unsigned int ) in_len, buffer, ( unsigned int ) buffer_size ); } while( uiResult == 0 #if ! AVOID_ERRNO diff --git a/harbour/contrib/hbpgsql/postgres.c b/harbour/contrib/hbpgsql/postgres.c index 728e099b1f..ad48ec8b65 100644 --- a/harbour/contrib/hbpgsql/postgres.c +++ b/harbour/contrib/hbpgsql/postgres.c @@ -1140,7 +1140,7 @@ HB_FUNC( PQEXECPREPARED ) for( i = 0; i < n; ++i ) paramvalues[ i ] = hb_arrayGetCPtr( aParam, i + 1 ); - hb_PGresult_ret( PQexecPrepared( conn, hb_parcx( 2 ), n, ( const char * const * ) paramvalues, NULL, NULL, 1 ) ); + hb_PGresult_ret( PQexecPrepared( conn, hb_parcx( 2 ), ( int ) n, ( const char * const * ) paramvalues, NULL, NULL, 1 ) ); hb_xfree( paramvalues ); } @@ -1154,7 +1154,7 @@ HB_FUNC( PQPUTCOPYDATA ) PGconn * conn = hb_PGconn_par( 1 ); if( conn ) - hb_retni( PQputCopyData( conn, hb_parcx( 2 ), hb_parclen( 2 ) ) ); + hb_retni( PQputCopyData( conn, hb_parcx( 2 ), ( int ) hb_parclen( 2 ) ) ); else hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); #else diff --git a/harbour/contrib/hbxdiff/core.c b/harbour/contrib/hbxdiff/core.c index 0a9960dbc7..38e8f8c224 100644 --- a/harbour/contrib/hbxdiff/core.c +++ b/harbour/contrib/hbxdiff/core.c @@ -251,7 +251,7 @@ HB_FUNC( XDL_READ_MMFILE ) if( data && size ) { - lResult = xdl_read_mmfile( phb_mmf->mmf, data, size ); + lResult = xdl_read_mmfile( phb_mmf->mmf, data, ( long ) size ); if( lResult == -1 ) { hb_retc_null(); @@ -287,7 +287,7 @@ HB_FUNC( XDL_WRITE_MMFILE ) { if( HB_ISCHAR( 2 ) ) { - long lSize = hb_parclen( 2 ); + long lSize = ( long ) hb_parclen( 2 ); if( hb_pcount() > 2 ) lSize = hb_parnldef( 3, lSize ); diff --git a/harbour/contrib/hbzebra/codabar.c b/harbour/contrib/hbzebra/codabar.c index 90c468284c..f47b263b39 100644 --- a/harbour/contrib/hbzebra/codabar.c +++ b/harbour/contrib/hbzebra/codabar.c @@ -77,7 +77,7 @@ static const char s_code[] = { 0x68, /* C */ 0x38}; /* D */ -static int _codabar_charno( char ch ) +static HB_PTRDIFF _codabar_charno( char ch ) { static const char * s_symbols = "-$:/.+ABCD"; @@ -131,7 +131,8 @@ static void _codabar_add( PHB_BITBUFFER pBits, char code, int iFlags, HB_BOOL fL PHB_ZEBRA hb_zebra_create_codabar( const char * szCode, HB_SIZE nLen, int iFlags ) { PHB_ZEBRA pZebra; - int i, j, iLen = ( int ) nLen; + int i, iLen = ( int ) nLen; + HB_PTRDIFF j; pZebra = hb_zebra_create(); pZebra->iType = HB_ZEBRA_TYPE_CODABAR; @@ -154,16 +155,16 @@ PHB_ZEBRA hb_zebra_create_codabar( const char * szCode, HB_SIZE nLen, int iFlags pZebra->pBits = hb_bitbuffer_create(); if( iLen == 0 || _codabar_charno( ( int ) szCode[ 0 ] ) < 16 ) - _codabar_add( pZebra->pBits, s_code[ ( int ) _codabar_charno( 'A' ) ], iFlags, HB_FALSE ); /* Default start A */ + _codabar_add( pZebra->pBits, s_code[ _codabar_charno( 'A' ) ], iFlags, HB_FALSE ); /* Default start A */ for( i = 0; i < iLen; i++ ) { - int no = _codabar_charno( szCode[ i ] ); + HB_PTRDIFF no = _codabar_charno( szCode[ i ] ); _codabar_add( pZebra->pBits, s_code[ no ], iFlags, i > 0 && no >= 16 ); } if( iLen == 0 || _codabar_charno( szCode[ i - 1 ] ) < 16 ) - _codabar_add( pZebra->pBits, s_code[ ( int ) _codabar_charno( 'B' ) ], iFlags, HB_TRUE ); /* Default stop B */ + _codabar_add( pZebra->pBits, s_code[ _codabar_charno( 'B' ) ], iFlags, HB_TRUE ); /* Default stop B */ return pZebra; } diff --git a/harbour/contrib/hbzebra/code39.c b/harbour/contrib/hbzebra/code39.c index d390583088..64cebafc24 100644 --- a/harbour/contrib/hbzebra/code39.c +++ b/harbour/contrib/hbzebra/code39.c @@ -103,7 +103,7 @@ static const HB_UCHAR s_code[] = 0xA2, /* + */ 0xA8 }; /* % */ -static int _code39_charno( char ch ) +static HB_PTRDIFF _code39_charno( char ch ) { static const char * s_symbols = "-. $/+%"; @@ -165,7 +165,8 @@ static void _code39_add( PHB_BITBUFFER pBits, char code, int iFlags, HB_BOOL fLa PHB_ZEBRA hb_zebra_create_code39( const char * szCode, HB_SIZE nLen, int iFlags ) { PHB_ZEBRA pZebra; - int i, csum, iLen = ( int ) nLen; + int i, iLen = ( int ) nLen; + HB_PTRDIFF csum; pZebra = hb_zebra_create(); pZebra->iType = HB_ZEBRA_TYPE_CODE39; @@ -191,7 +192,7 @@ PHB_ZEBRA hb_zebra_create_code39( const char * szCode, HB_SIZE nLen, int iFlags csum = 0; for( i = 0; i < iLen; i++ ) { - int no = _code39_charno( szCode[ i ] ); + HB_PTRDIFF no = _code39_charno( szCode[ i ] ); _code39_add( pZebra->pBits, ( char ) s_code[ no ], iFlags, HB_FALSE ); csum += no; } diff --git a/harbour/contrib/hbzebra/code93.c b/harbour/contrib/hbzebra/code93.c index 1653665213..457de99223 100644 --- a/harbour/contrib/hbzebra/code93.c +++ b/harbour/contrib/hbzebra/code93.c @@ -105,7 +105,7 @@ static const char s_code[] = { 0x4C, /* (+) 46 */ 0x7A}; /* Start/Stop 47 */ -static int _code93_charno( char ch ) +static HB_PTRDIFF _code93_charno( char ch ) { static const char * s_symbols = "-. $/+%"; @@ -125,7 +125,8 @@ static int _code93_charno( char ch ) PHB_ZEBRA hb_zebra_create_code93( const char * szCode, HB_SIZE nLen, int iFlags ) { PHB_ZEBRA pZebra; - int csum, ksum, k, i, j, iLen = ( int ) nLen; + int k, i, j, iLen = ( int ) nLen; + HB_PTRDIFF csum, ksum; HB_SYMBOL_UNUSED( iFlags ); @@ -168,7 +169,7 @@ PHB_ZEBRA hb_zebra_create_code93( const char * szCode, HB_SIZE nLen, int iFlags k++; for( i = 0; i < iLen; i++ ) { - int no = _code93_charno( szCode[ i ] ); + HB_PTRDIFF no = _code93_charno( szCode[ i ] ); if( no >= 0 ) { hb_bitbuffer_cat_int( pZebra->pBits, 1, 1 ); diff --git a/harbour/contrib/hbzebra/core.c b/harbour/contrib/hbzebra/core.c index 0e667e2fa3..ed7dff0e4c 100644 --- a/harbour/contrib/hbzebra/core.c +++ b/harbour/contrib/hbzebra/core.c @@ -97,16 +97,16 @@ void hb_bitbuffer_set( PHB_BITBUFFER pBitBuffer, HB_SIZE nPos, HB_BOOL fValue ) { if( pBitBuffer->nAlloc * 8 <= nPos ) { - HB_SIZE nNewAlloc = ( ( pBitBuffer->nAlloc >> 1 ) + nPos + 8 ) / 8; + HB_SIZE nNewAlloc = ( ( pBitBuffer->nAlloc >> 1 ) + nPos + 8 ) / 8; pBitBuffer->pBuffer = ( unsigned char * ) hb_xrealloc( pBitBuffer->pBuffer, nNewAlloc ); hb_xmemset( pBitBuffer->pBuffer + pBitBuffer->nAlloc, 0, nNewAlloc - pBitBuffer->nAlloc ); pBitBuffer->nAlloc = nNewAlloc; } if( fValue ) - * ( pBitBuffer->pBuffer + ( nPos >> 3 ) ) |= 1 << ( nPos & 0x7 ); + *( pBitBuffer->pBuffer + ( nPos >> 3 ) ) |= 1 << ( nPos & 0x7 ); else - * ( pBitBuffer->pBuffer + ( nPos >> 3 ) ) &= ~ ( 1 << ( nPos & 0x7 ) ); + *( pBitBuffer->pBuffer + ( nPos >> 3 ) ) &= ~ ( 1 << ( nPos & 0x7 ) ); if( pBitBuffer->nLen <= nPos ) pBitBuffer->nLen = nPos + 1; @@ -117,7 +117,7 @@ void hb_bitbuffer_not( PHB_BITBUFFER pBitBuffer, HB_SIZE nPos ) { if( pBitBuffer->nAlloc * 8 <= nPos ) { - HB_SIZE nNewAlloc = ( ( pBitBuffer->nAlloc >> 1 ) + nPos + 8 ) / 8; + HB_SIZE nNewAlloc = ( ( pBitBuffer->nAlloc >> 1 ) + nPos + 8 ) / 8; pBitBuffer->pBuffer = ( unsigned char * ) hb_xrealloc( pBitBuffer->pBuffer, nNewAlloc ); hb_xmemset( pBitBuffer->pBuffer + pBitBuffer->nAlloc, 0, nNewAlloc - pBitBuffer->nAlloc ); pBitBuffer->nAlloc = nNewAlloc; @@ -133,7 +133,7 @@ void hb_bitbuffer_cat_int( PHB_BITBUFFER pBitBuffer, int iValue, int iLen ) if( ( pBitBuffer->nLen + iLen ) >= pBitBuffer->nAlloc * 8 ) { - int nNewAlloc = pBitBuffer->nAlloc + ( ( pBitBuffer->nAlloc >> 1 ) + iLen + 7 ) / 8; + HB_SIZE nNewAlloc = pBitBuffer->nAlloc + ( ( pBitBuffer->nAlloc >> 1 ) + iLen + 7 ) / 8; pBitBuffer->pBuffer = ( unsigned char * ) hb_xrealloc( pBitBuffer->pBuffer, nNewAlloc ); hb_xmemset( pBitBuffer->pBuffer + pBitBuffer->nAlloc, 0, nNewAlloc - pBitBuffer->nAlloc ); pBitBuffer->nAlloc = nNewAlloc; @@ -154,7 +154,7 @@ void hb_bitbuffer_cat_int_rev( PHB_BITBUFFER pBitBuffer, int iValue, int iLen ) if( ( pBitBuffer->nLen + iLen ) >= pBitBuffer->nAlloc * 8 ) { - int nNewAlloc = pBitBuffer->nAlloc + ( ( pBitBuffer->nAlloc >> 1 ) + iLen + 7 ) / 8; + HB_SIZE nNewAlloc = pBitBuffer->nAlloc + ( ( pBitBuffer->nAlloc >> 1 ) + iLen + 7 ) / 8; pBitBuffer->pBuffer = ( unsigned char * ) hb_xrealloc( pBitBuffer->pBuffer, nNewAlloc ); hb_xmemset( pBitBuffer->pBuffer + pBitBuffer->nAlloc, 0, nNewAlloc - pBitBuffer->nAlloc ); pBitBuffer->nAlloc = nNewAlloc; diff --git a/harbour/contrib/hbzebra/qrcode.c b/harbour/contrib/hbzebra/qrcode.c index 60f782c0aa..87f4d2d50b 100644 --- a/harbour/contrib/hbzebra/qrcode.c +++ b/harbour/contrib/hbzebra/qrcode.c @@ -631,7 +631,8 @@ static int _qr_cci_len( int iVersion, int iMode ) /* Character Count Indicator * static int _qr_dataencode( const char * szCode, HB_SIZE nSize, PHB_BITBUFFER pData, int iLevel ) { - int i, iVersion, iMode, iLen, iDataLen; + int i, iVersion, iMode; + HB_ISIZ iLen, iDataLen, m; HB_SIZE n; char ch; @@ -679,7 +680,7 @@ static int _qr_dataencode( const char * szCode, HB_SIZE nSize, PHB_BITBUFFER pDa return 0; /* Too large */ #ifdef DEBUG_CODE - HB_TRACE( HB_TR_ALWAYS, ("iMode:%d iLen:%d iDataLen:%d iVersion:%d", iMode, iLen, iDataLen, iVersion) ) ; + HB_TRACE( HB_TR_ALWAYS, ("iMode:%d iLen:%" HB_PFS "d iDataLen:%d iVersion:%d", iMode, iLen, iDataLen, iVersion) ) ; #endif /* Encode */ @@ -725,15 +726,15 @@ static int _qr_dataencode( const char * szCode, HB_SIZE nSize, PHB_BITBUFFER pDa hb_bitbuffer_cat_int_rev( pData, 0, 8 - ( hb_bitbuffer_len( pData ) & 7 ) ); iLen = iDataLen - hb_bitbuffer_len( pData ) / 8; - for( i = 0; i < iLen; i++ ) + for( m = 0; m < iLen; m++ ) { - hb_bitbuffer_cat_int_rev( pData, ( i & 1 ) ? 0x11 : 0xEC, 8 ); + hb_bitbuffer_cat_int_rev( pData, ( m & 1 ) ? 0x11 : 0xEC, 8 ); } #ifdef DEBUG_CODE - for( i = 0; i < iDataLen; i++ ) + for( m = 0; m < iDataLen; m++ ) { - HB_TRACE( HB_TR_ALWAYS, ("data:%3d %02X", s_rev[ * (hb_bitbuffer_buffer(pData) + i) ], s_rev[ * (hb_bitbuffer_buffer(pData) + i) ]) ); + HB_TRACE( HB_TR_ALWAYS, ("data:%3d %02X", s_rev[ *( hb_bitbuffer_buffer( pData ) + m ) ], s_rev[ *( hb_bitbuffer_buffer( pData ) + m ) ] ) ); } #endif return iVersion; @@ -872,7 +873,7 @@ static unsigned char * _qr_checksum( PHB_BITBUFFER pData, int iVersion, int iLev static void _qr_draw( PHB_BITBUFFER pBits, PHB_BITBUFFER pCWBits, int iVersion ) { int i, j, no, up, right, iLength; - unsigned char *pi, *pj; + unsigned char * pi, * pj; HB_SYMBOL_UNUSED( pCWBits ); diff --git a/harbour/contrib/rddads/ads1.c b/harbour/contrib/rddads/ads1.c index 20ca575579..a32a058898 100644 --- a/harbour/contrib/rddads/ads1.c +++ b/harbour/contrib/rddads/ads1.c @@ -2646,7 +2646,8 @@ static HB_ERRCODE adsPutValue( ADSAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pItem if( nLen > ( HB_SIZE ) pField->uiLen ) nLen = pField->uiLen; u32RetVal = AdsSetStringW( pArea->hTable, ADSFIELD( uiIndex ), - ( WCHAR * ) pwBuffer, nLen ); + ( WCHAR * ) pwBuffer, + ( UNSIGNED32 ) nLen ); hb_strfree( hString ); } else @@ -2660,7 +2661,7 @@ static HB_ERRCODE adsPutValue( ADSAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pItem if( hb_ads_bOEM ) { #if ADS_LIB_VERSION >= 600 - u32RetVal = AdsSetFieldRaw( pArea->hTable, ADSFIELD( uiIndex ), ( UNSIGNED8 * ) hb_itemGetCPtr( pItem ), nLen ); + u32RetVal = AdsSetFieldRaw( pArea->hTable, ADSFIELD( uiIndex ), ( UNSIGNED8 * ) hb_itemGetCPtr( pItem ), ( UNSIGNED32 ) nLen ); #else char * pBuffer = hb_adsOemToAnsi( hb_itemGetCPtr( pItem ), nLen ); u32RetVal = AdsSetString( pArea->hTable, ADSFIELD( uiIndex ), ( UNSIGNED8 * ) pBuffer, nLen ); @@ -2670,7 +2671,7 @@ static HB_ERRCODE adsPutValue( ADSAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pItem else #endif { - u32RetVal = AdsSetString( pArea->hTable, ADSFIELD( uiIndex ), ( UNSIGNED8 * ) hb_itemGetCPtr( pItem ), nLen ); + u32RetVal = AdsSetString( pArea->hTable, ADSFIELD( uiIndex ), ( UNSIGNED8 * ) hb_itemGetCPtr( pItem ), ( UNSIGNED32 ) nLen ); } } } @@ -2763,7 +2764,8 @@ static HB_ERRCODE adsPutValue( ADSAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pItem const HB_WCHAR * pwBuffer = hb_itemGetStrU16( pItem, HB_CDP_ENDIAN_LITTLE, &hString, &nLen ); u32RetVal = AdsSetStringW( pArea->hTable, ADSFIELD( uiIndex ), - ( WCHAR * ) pwBuffer, nLen ); + ( WCHAR * ) pwBuffer, + ( UNSIGNED32 ) nLen ); hb_strfree( hString ); } #endif diff --git a/harbour/extras/httpsrv/uhttpd.prg b/harbour/extras/httpsrv/uhttpd.prg index 5cb03357c4..aa953544ef 100644 --- a/harbour/extras/httpsrv/uhttpd.prg +++ b/harbour/extras/httpsrv/uhttpd.prg @@ -244,8 +244,6 @@ PROCEDURE Main( ... ) cGT := HB_GTVERSION() IF cGT == "NUL" lConsole := .F. - ELSE - hb_gtInfo( HB_GTI_NOTIFIERBLOCK, {| nEvent, ... | GT_notifier( nEvent, ... ) } ) ENDIF // TOCHECK: now not force case insensitive @@ -574,6 +572,11 @@ PROCEDURE Main( ... ) EXIT ENDIF #endif + + IF Inkey( , HB_INKEY_GTEVENT ) == HB_K_CLOSE + GT_notifier( HB_K_CLOSE ) + ENDIF + IF hb_mutexLock( s_hmtxBusy ) IF s_lQuitRequest hb_mutexUnlock( s_hmtxBusy ) @@ -2817,7 +2820,7 @@ STATIC FUNCTION GT_notifier( nEvent, xParams ) LOCAL nReturn := 0 DO CASE - CASE nEvent == HB_GTE_CLOSE + CASE nEvent == HB_K_CLOSE IF hb_mutexLock( s_hmtxBusy ) s_lQuitRequest := .T. nReturn := 1 diff --git a/harbour/src/rtl/hbzlib.c b/harbour/src/rtl/hbzlib.c index 6fd7d7587d..7578eeb42d 100644 --- a/harbour/src/rtl/hbzlib.c +++ b/harbour/src/rtl/hbzlib.c @@ -163,7 +163,7 @@ static int hb_gz_compress( char ** pDstPtr, HB_SIZE * pnDst, if( *pDstPtr == NULL ) { if( *pnDst == 0 ) - *pnDst = deflateBound( &stream, nSrc ); + *pnDst = deflateBound( &stream, ( uLong ) nSrc ); *pDstPtr = ( char * ) hb_xalloc( *pnDst + 1 ); if( *pDstPtr == NULL ) iResult = Z_MEM_ERROR;