Commit a0e44ec1 authored by Davi Arnaut's avatar Davi Arnaut

Fix for a few assorted compiler warnings.

parent edb71b0c
......@@ -86,7 +86,7 @@ extern "C" {
#endif
#undef bcmp // Fix problem with new readline
#if defined( __WIN__)
#if defined(__WIN__)
#include <conio.h>
#elif !defined(__NETWARE__)
#include <readline/readline.h>
......@@ -106,7 +106,7 @@ extern "C" {
#define cmp_database(cs,A,B) strcmp((A),(B))
#endif
#if !defined( __WIN__) && !defined(__NETWARE__) && !defined(THREAD)
#if !defined(__WIN__) && !defined(__NETWARE__) && !defined(THREAD)
#define USE_POPEN
#endif
......@@ -1862,7 +1862,7 @@ static int read_and_execute(bool interactive)
if (opt_outfile && glob_buffer.is_empty())
fflush(OUTFILE);
#if defined( __WIN__) || defined(__NETWARE__)
#if defined(__WIN__) || defined(__NETWARE__)
tee_fputs(prompt, stdout);
#if defined(__NETWARE__)
line=fgets(linebuffer, sizeof(linebuffer)-1, stdin);
......@@ -1873,7 +1873,7 @@ static int read_and_execute(bool interactive)
if (p != NULL)
*p = '\0';
}
#else defined(__WIN__)
#else
if (!tmpbuf.is_alloced())
tmpbuf.alloc(65535);
tmpbuf.length(0);
......@@ -1899,7 +1899,7 @@ static int read_and_execute(bool interactive)
if (opt_outfile)
fputs(prompt, OUTFILE);
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
......@@ -1947,10 +1947,10 @@ static int read_and_execute(bool interactive)
}
}
#if defined( __WIN__) || defined(__NETWARE__)
#if defined(__WIN__) || defined(__NETWARE__)
buffer.free();
#endif
#if defined( __WIN__)
#if defined(__WIN__)
tmpbuf.free();
#endif
......@@ -4602,7 +4602,7 @@ void tee_putc(int c, FILE *file)
putc(c, OUTFILE);
}
#if defined( __WIN__) || defined(__NETWARE__)
#if defined(__WIN__) || defined(__NETWARE__)
#include <time.h>
#else
#include <sys/times.h>
......@@ -4614,7 +4614,7 @@ void tee_putc(int c, FILE *file)
static ulong start_timer(void)
{
#if defined( __WIN__) || defined(__NETWARE__)
#if defined(__WIN__) || defined(__NETWARE__)
return clock();
#else
struct tms tms_tmp;
......
......@@ -5008,7 +5008,7 @@ int main(int argc, char **argv)
exit_code= get_options(&argc, &argv);
if (exit_code)
{
free_resources(0);
free_resources();
exit(exit_code);
}
......@@ -5016,14 +5016,14 @@ int main(int argc, char **argv)
{
if(!(stderror_file= freopen(log_error_file, "a+", stderr)))
{
free_resources(0);
free_resources();
exit(EX_MYSQLERR);
}
}
if (connect_to_db(current_host, current_user, opt_password))
{
free_resources(0);
free_resources();
exit(EX_MYSQLERR);
}
if (!path)
......
......@@ -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
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;
DBUG_RETURN(FALSE);
}
......
......@@ -3305,8 +3305,7 @@ Item_copy *Item_copy::create (Item *item)
new Item_copy_uint (item) : new Item_copy_int (item);
case DECIMAL_RESULT:
return new Item_copy_decimal (item);
case ROW_RESULT:
default:
DBUG_ASSERT (0);
}
/* should not happen */
......
......@@ -1549,7 +1549,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
if (!param->using_global_keycache)
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,
(uint) param->read_buffer_length,
......
This diff is collapsed.
......@@ -4262,7 +4262,7 @@ static void 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=''");
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