Skip to content

Commit

Permalink
2024-01-28 12:50 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
Browse files Browse the repository at this point in the history
  * contrib/hbfimage/core.c
    * use FreeImage_Rotate() instead of FreeImage_RotateClassic() in new
      FreeImage versions which do not support this function

  * contrib/hbsqlit3/core.c
    * added missing casting reported as bug in C++ mode

  * contrib/hbssl/hbssl.h
  * contrib/hbssl/rsa.c
    * added HB_SSL_CONST_BYTE() macro to pacify unconst warnings
      in old SSL versions

  * src/rdd/wacore.c
    * inlined macro to pacify still returning false warning
  • Loading branch information
druzus committed Jan 28, 2024
1 parent 8405632 commit ae62f2e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
16 changes: 16 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@
Entries may not always be in chronological/commit order.
See license at the end of file. */

2024-01-28 12:50 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbfimage/core.c
* use FreeImage_Rotate() instead of FreeImage_RotateClassic() in new
FreeImage versions which do not support this function

* contrib/hbsqlit3/core.c
* added missing casting reported as bug in C++ mode

* contrib/hbssl/hbssl.h
* contrib/hbssl/rsa.c
* added HB_SSL_CONST_BYTE() macro to pacify unconst warnings
in old SSL versions

* src/rdd/wacore.c
* inlined macro to pacify still returning false warning

2023-12-08 23:17 UTC+0100 Phil Krylov (phil a t krylov.eu)
* contrib/sddsqlt3/core.c
! Fixed a different signedness compare warning.
Expand Down
4 changes: 4 additions & 0 deletions contrib/hbfimage/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,11 @@ HB_FUNC( FI_ROTATECLASSIC )
FIBITMAP * dib = hb_FIBITMAP_par( 1 );
double angle = hb_parnd( 2 );

#if FREEIMAGE_MAJOR_VERSION > 3 || ( FREEIMAGE_MAJOR_VERSION >= 3 && FREEIMAGE_MINOR_VERSION >= 18 )
hb_FIBITMAP_ret( FreeImage_Rotate( dib, angle, NULL ), HB_TRUE );
#else
hb_FIBITMAP_ret( FreeImage_RotateClassic( dib, angle ), HB_TRUE );
#endif
}
else
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
Expand Down
4 changes: 2 additions & 2 deletions contrib/hbsqlit3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,7 @@ static int trace_handler( unsigned uType, void *cbTraceHandler, void * p, void *
{
case SQLITE_TRACE_STMT:
hb_vmPushPointer( p );
hb_vmPushString( x, strlen( x ) );
hb_vmPushString( ( const char * ) x, strlen( ( char * ) x ) );
hb_vmSend( 3 );
break;
case SQLITE_TRACE_PROFILE:
Expand All @@ -1849,7 +1849,7 @@ static int trace_handler( unsigned uType, void *cbTraceHandler, void * p, void *
HB_SQLITE3 * hbsqlite3 = ( HB_SQLITE3 * ) hb_xgrabz( sizeof( HB_SQLITE3 ) );
HB_SYMBOL_UNUSED( x );

hbsqlite3->db = p;
hbsqlite3->db = ( sqlite3 * ) p;
hb_sqlite3_itemPut( pItem, hbsqlite3, HB_SQLITE3_DB );
hb_vmPush( pItem );
hb_vmSend( 2 );
Expand Down
4 changes: 3 additions & 1 deletion contrib/hbssl/hbssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@
declarations in OpenSSL prior 0.9.8 */
#if OPENSSL_VERSION_NUMBER < 0x0090800fL
#define HB_SSL_CONST
#define HB_SSL_CONST_BYTE( x ) ( ( unsigned char * ) ( x ) )
#else
#define HB_SSL_CONST const
#define HB_SSL_CONST const
#define HB_SSL_CONST_BYTE( x ) ( ( const unsigned char * ) ( x ) )
#endif

HB_EXTERN_BEGIN
Expand Down
8 changes: 4 additions & 4 deletions contrib/hbssl/rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ HB_FUNC( RSA_PUBLIC_ENCRYPT )

buffer = ( unsigned char * ) hb_xgrab( RSA_size( rsa ) + 1 );

ret = RSA_public_encrypt( flen, HB_UNCONST( from ), buffer, rsa, padding );
ret = RSA_public_encrypt( flen, HB_SSL_CONST_BYTE( from ), buffer, rsa, padding );
if( ret > 0 )
{
if( ! hb_storclen_buffer( ( char * ) buffer, ret, 3 ) )
Expand Down Expand Up @@ -146,7 +146,7 @@ HB_FUNC( RSA_PRIVATE_DECRYPT )

buffer = ( unsigned char * ) hb_xgrab( RSA_size( rsa ) + 1 );

ret = RSA_private_decrypt( flen, HB_UNCONST( from ), buffer, rsa, padding );
ret = RSA_private_decrypt( flen, HB_SSL_CONST_BYTE( from ), buffer, rsa, padding );
if( ret > 0 )
{
buffer = ( unsigned char * ) hb_xrealloc( buffer, ret + 1 );
Expand Down Expand Up @@ -179,7 +179,7 @@ HB_FUNC( RSA_PRIVATE_ENCRYPT )

buffer = ( unsigned char * ) hb_xgrab( RSA_size( rsa ) + 1 );

ret = RSA_private_encrypt( flen, HB_UNCONST( from ), buffer, rsa, padding );
ret = RSA_private_encrypt( flen, HB_SSL_CONST_BYTE( from ), buffer, rsa, padding );
if( ret > 0 )
{
if( ! hb_storclen_buffer( ( char * ) buffer, ret, 3 ) )
Expand Down Expand Up @@ -211,7 +211,7 @@ HB_FUNC( RSA_PUBLIC_DECRYPT )

buffer = ( unsigned char * ) hb_xgrab( RSA_size( rsa ) + 1 );

ret = RSA_public_decrypt( flen, HB_UNCONST( from ), buffer, rsa, padding );
ret = RSA_public_decrypt( flen, HB_SSL_CONST_BYTE( from ), buffer, rsa, padding );
if( ret > 0 )
{
buffer = ( unsigned char * ) hb_xrealloc( buffer, ret + 1 );
Expand Down
3 changes: 2 additions & 1 deletion src/rdd/wacore.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ void hb_rddCloseAll( void )
hb_xfree( pRddInfo->waNums );
pRddInfo->waList = NULL;
pRddInfo->waNums = NULL;
HB_SET_WA( 1 );
pRddInfo->uiCurrArea = 1;
pRddInfo->pCurrArea = NULL;
}
}

Expand Down

0 comments on commit ae62f2e

Please sign in to comment.