Commit 69174242 authored by Davi Arnaut's avatar Davi Arnaut

Fix for a few assorted compiler warnings.

client/mysql.cc:
  Remove leading whitespace.
  Remove extra text after #else directive.
client/mysqldump.c:
  Function does not take a parameter.
mysys/array.c:
  buffer is a uchar pointer.
sql/item.cc:
  Assert if it should not happen.
storage/myisam/mi_check.c:
  Cast to expected type. This is probably a bug, but it is
  casted in a similar way in another part of the code.
storage/ndb/include/mgmapi/ndb_logevent.h:
  Apply fix from cluster team.
tests/mysql_client_test.c:
  Remove extraneous slash.
parent 91d8a597
...@@ -86,7 +86,7 @@ extern "C" { ...@@ -86,7 +86,7 @@ extern "C" {
#endif #endif
#undef bcmp // Fix problem with new readline #undef bcmp // Fix problem with new readline
#if defined( __WIN__) #if defined(__WIN__)
#include <conio.h> #include <conio.h>
#elif !defined(__NETWARE__) #elif !defined(__NETWARE__)
#include <readline/readline.h> #include <readline/readline.h>
...@@ -106,7 +106,7 @@ extern "C" { ...@@ -106,7 +106,7 @@ extern "C" {
#define cmp_database(cs,A,B) strcmp((A),(B)) #define cmp_database(cs,A,B) strcmp((A),(B))
#endif #endif
#if !defined( __WIN__) && !defined(__NETWARE__) && !defined(THREAD) #if !defined(__WIN__) && !defined(__NETWARE__) && !defined(THREAD)
#define USE_POPEN #define USE_POPEN
#endif #endif
...@@ -1862,7 +1862,7 @@ static int read_and_execute(bool interactive) ...@@ -1862,7 +1862,7 @@ static int read_and_execute(bool interactive)
if (opt_outfile && glob_buffer.is_empty()) if (opt_outfile && glob_buffer.is_empty())
fflush(OUTFILE); fflush(OUTFILE);
#if defined( __WIN__) || defined(__NETWARE__) #if defined(__WIN__) || defined(__NETWARE__)
tee_fputs(prompt, stdout); tee_fputs(prompt, stdout);
#if defined(__NETWARE__) #if defined(__NETWARE__)
line=fgets(linebuffer, sizeof(linebuffer)-1, stdin); line=fgets(linebuffer, sizeof(linebuffer)-1, stdin);
...@@ -1873,7 +1873,7 @@ static int read_and_execute(bool interactive) ...@@ -1873,7 +1873,7 @@ static int read_and_execute(bool interactive)
if (p != NULL) if (p != NULL)
*p = '\0'; *p = '\0';
} }
#else defined(__WIN__) #else
if (!tmpbuf.is_alloced()) if (!tmpbuf.is_alloced())
tmpbuf.alloc(65535); tmpbuf.alloc(65535);
tmpbuf.length(0); tmpbuf.length(0);
...@@ -1899,7 +1899,7 @@ static int read_and_execute(bool interactive) ...@@ -1899,7 +1899,7 @@ static int read_and_execute(bool interactive)
if (opt_outfile) if (opt_outfile)
fputs(prompt, OUTFILE); fputs(prompt, OUTFILE);
line= readline(prompt); line= readline(prompt);
#endif /* defined( __WIN__) || defined(__NETWARE__) */ #endif /* defined(__WIN__) || defined(__NETWARE__) */
/* /*
When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS
...@@ -1947,10 +1947,10 @@ static int read_and_execute(bool interactive) ...@@ -1947,10 +1947,10 @@ static int read_and_execute(bool interactive)
} }
} }
#if defined( __WIN__) || defined(__NETWARE__) #if defined(__WIN__) || defined(__NETWARE__)
buffer.free(); buffer.free();
#endif #endif
#if defined( __WIN__) #if defined(__WIN__)
tmpbuf.free(); tmpbuf.free();
#endif #endif
...@@ -4602,7 +4602,7 @@ void tee_putc(int c, FILE *file) ...@@ -4602,7 +4602,7 @@ void tee_putc(int c, FILE *file)
putc(c, OUTFILE); putc(c, OUTFILE);
} }
#if defined( __WIN__) || defined(__NETWARE__) #if defined(__WIN__) || defined(__NETWARE__)
#include <time.h> #include <time.h>
#else #else
#include <sys/times.h> #include <sys/times.h>
...@@ -4614,7 +4614,7 @@ void tee_putc(int c, FILE *file) ...@@ -4614,7 +4614,7 @@ void tee_putc(int c, FILE *file)
static ulong start_timer(void) static ulong start_timer(void)
{ {
#if defined( __WIN__) || defined(__NETWARE__) #if defined(__WIN__) || defined(__NETWARE__)
return clock(); return clock();
#else #else
struct tms tms_tmp; struct tms tms_tmp;
......
...@@ -5008,7 +5008,7 @@ int main(int argc, char **argv) ...@@ -5008,7 +5008,7 @@ int main(int argc, char **argv)
exit_code= get_options(&argc, &argv); exit_code= get_options(&argc, &argv);
if (exit_code) if (exit_code)
{ {
free_resources(0); free_resources();
exit(exit_code); exit(exit_code);
} }
...@@ -5016,14 +5016,14 @@ int main(int argc, char **argv) ...@@ -5016,14 +5016,14 @@ int main(int argc, char **argv)
{ {
if(!(stderror_file= freopen(log_error_file, "a+", stderr))) if(!(stderror_file= freopen(log_error_file, "a+", stderr)))
{ {
free_resources(0); free_resources();
exit(EX_MYSQLERR); exit(EX_MYSQLERR);
} }
} }
if (connect_to_db(current_host, current_user, opt_password)) if (connect_to_db(current_host, current_user, opt_password))
{ {
free_resources(0); free_resources();
exit(EX_MYSQLERR); exit(EX_MYSQLERR);
} }
if (!path) if (!path)
......
...@@ -67,7 +67,7 @@ my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size, ...@@ -67,7 +67,7 @@ my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
Since the dynamic array is usable even if allocation fails here malloc Since the dynamic array is usable even if allocation fails here malloc
should not throw an error should not throw an error
*/ */
if (!(array->buffer= (char*) my_malloc_ci(element_size*init_alloc, MYF(0)))) if (!(array->buffer= (uchar*) my_malloc_ci(element_size*init_alloc, MYF(0))))
array->max_element=0; array->max_element=0;
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
} }
......
...@@ -3305,8 +3305,7 @@ Item_copy *Item_copy::create (Item *item) ...@@ -3305,8 +3305,7 @@ Item_copy *Item_copy::create (Item *item)
new Item_copy_uint (item) : new Item_copy_int (item); new Item_copy_uint (item) : new Item_copy_int (item);
case DECIMAL_RESULT: case DECIMAL_RESULT:
return new Item_copy_decimal (item); return new Item_copy_decimal (item);
default:
case ROW_RESULT:
DBUG_ASSERT (0); DBUG_ASSERT (0);
} }
/* should not happen */ /* should not happen */
......
...@@ -1549,7 +1549,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info, ...@@ -1549,7 +1549,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
if (!param->using_global_keycache) if (!param->using_global_keycache)
VOID(init_key_cache(dflt_key_cache, param->key_cache_block_size, VOID(init_key_cache(dflt_key_cache, param->key_cache_block_size,
param->use_buffers, 0, 0)); (size_t) param->use_buffers, 0, 0));
if (init_io_cache(&param->read_cache,info->dfile, if (init_io_cache(&param->read_cache,info->dfile,
(uint) param->read_buffer_length, (uint) param->read_buffer_length,
......
This diff is collapsed.
...@@ -4262,7 +4262,7 @@ static void test_fetch_date() ...@@ -4262,7 +4262,7 @@ static void test_fetch_date()
myheader("test_fetch_date"); myheader("test_fetch_date");
/* Will not work if sql_mode is NO_ZERO_DATE (implicit if TRADITIONAL) /*/ /* Will not work if sql_mode is NO_ZERO_DATE (implicit if TRADITIONAL) */
rc= mysql_query(mysql, "SET SQL_MODE=''"); rc= mysql_query(mysql, "SET SQL_MODE=''");
myquery(rc); myquery(rc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment