Skip to content

Commit

Permalink
fixed compile warning on gcc 4.8 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joungkyun committed May 20, 2016
1 parent 7fc7223 commit 58f64a2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ $Id$
Fri, May 20 2016 JoungKyun.Kim <http://oops.org>
- remove --with-mysql-plugins-dir option
- add --with-mysql-config option
- fixed compile warning on gcc 4.8 (#3)

Thu, May 19 2016 JoungKyun.Kim <http://oops.org>
- fixed HAVE_LOG2 redefining warning on mariadb 10.1
Expand Down
2 changes: 1 addition & 1 deletion src/my_aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ int my_aes256_decrypt(const char *source, int source_length, char *dest,
Size of buffer required to store encrypted data
*/

int my_aes256_get_size(int source_length)
unsigned long my_aes256_get_size(int source_length)
{
DEBUG_SUB_FUNCTION_IN;
DEBUG_SUB_FUNCTION_OUT;
Expand Down
2 changes: 1 addition & 1 deletion src/my_aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int my_aes256_decrypt(const char *source, int source_length, char *dest,
returns - size of buffer required to store encrypted data
*/

int my_aes256_get_size(int source_length);
unsigned long my_aes256_get_size(int source_length);

C_MODE_END

Expand Down
9 changes: 5 additions & 4 deletions src/mysql_aes256.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ extern "C" {

#include <mysql_aes256_config.h>
#include <mysql_aes256.h>
#include <my_aes.h>

#ifdef HAVE_DLOPEN

Expand Down Expand Up @@ -201,7 +202,7 @@ EXPORT_API char * aes256_encrypt (
EXPORT_API my_bool aes256_decrypt_init (UDF_INIT * initid, UDF_ARGS * args, char * message)
{
DEBUG_FUNCTION_IN;
int blocks, i;
int i;

if ( args->arg_count != 2 ) {
sprintf (
Expand All @@ -226,7 +227,7 @@ EXPORT_API my_bool aes256_decrypt_init (UDF_INIT * initid, UDF_ARGS * args, char
" - %dst Argument:\n"
" - type : %d\n"
" - data : %s\n"
" - length : %d\n",
" - length : %ld\n",
i + 1, args->arg_type[i], args->args[i], args->lengths[i]
);

Expand All @@ -252,7 +253,7 @@ EXPORT_API my_bool aes256_decrypt_init (UDF_INIT * initid, UDF_ARGS * args, char
if ( (args->lengths[0] / AES256_BLOCK_SIZE) == 0 ) {
sprintf (
message,
"CIPHERTEXT(%d) is longer than AES BLOCKSIZE(%d) (udf: %s)",
"CIPHERTEXT(%ld) is longer than AES BLOCKSIZE(%d) (udf: %s)",
args->lengths[0], AES256_BLOCK_SIZE, __FUNCTION__
);
return false;
Expand Down Expand Up @@ -294,7 +295,7 @@ EXPORT_API char * aes256_decrypt (
" - 1st Argument:\n"
" + type : %d\n"
" + data : %s\n"
" + length : %d\n",
" + length : %ld\n",
args->arg_type[0], args->args[0], args->lengths[0]
);
}
Expand Down

0 comments on commit 58f64a2

Please sign in to comment.