From 85da8956e62cf5a1e3ed78cb18110e3888822d09 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Wed, 26 May 2010 16:12:23 +0200 Subject: Bug #53445 Build with -Wall and fix warnings that it generates Add -Wall to gcc/g++ Fix most warnings reported in dbg and opt mode. cmd-line-utils/libedit/filecomplete.c: Remove unused auto variables. configure.cmake: Add -Wall to gcc. extra/comp_err.c: Cast to correct type. extra/perror.c: Fix segfault (but warnings about deprecated features remain) extra/yassl/taocrypt/include/runtime.hpp: Comparing two literals was reported as undefined behaviour. include/my_global.h: Add a template for aligning character buffers. mysys/lf_alloc-pin.c: Initialize pointer. sql/mysqld.cc: Use UNINIT_VAR rather than LINT_INIT. sql/partition_info.cc: Use UNINIT_VAR rather than LINT_INIT. sql/rpl_handler.cc: Use char[] rather than unsigned long[] array for placement buffer. sql/spatial.cc: Use char[] rather than unsigned void*[] array for placement buffer. sql/spatial.h: Use char[] rather than unsigned void*[] array for placement buffer. sql/sql_partition.cc: Initialize auto variable. sql/sql_table.cc: Initialize auto variables. Add parens around assignment within if() sql/sys_vars.cc: Use UNINIT_VAR. storage/innobase/os/os0file.c: Init first slot in auto variable. storage/myisam/mi_create.c: Use UNINIT_VAR rather than LINT_INIT. storage/myisam/mi_open.c: Remove (wrong) casting. storage/myisam/mi_page.c: Remove (wrong) casting. storage/myisam/mi_search.c: Cast to uchar* rather than char*. strings/ctype-ucs2.c: Use UNINIT_VAR rather than LINT_INIT. Add (uchar*) casting. --- sql/spatial.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'sql/spatial.h') diff --git a/sql/spatial.h b/sql/spatial.h index a4bce47d0e5..aabbb7a1b97 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -267,14 +267,7 @@ public: virtual int geometry_n(uint32 num, String *result) const { return -1; } public: - static Geometry *create_by_typeid(Geometry_buffer *buffer, int type_id) - { - Class_info *ci; - if (!(ci= find_class((int) type_id))) - return NULL; - (*ci->m_create_func)((void *)buffer); - return my_reinterpret_cast(Geometry *)(buffer); - } + static Geometry *create_by_typeid(Geometry_buffer *buffer, int type_id); static Geometry *construct(Geometry_buffer *buffer, const char *data, uint32 data_len); @@ -532,10 +525,9 @@ public: const Class_info *get_class_info() const; }; -const int geometry_buffer_size= sizeof(Gis_point); struct Geometry_buffer { - void *arr[(geometry_buffer_size - 1)/sizeof(void *) + 1]; + Aligned_char_array buf; }; #endif /*HAVE_SPATAIAL*/ -- cgit v1.2.1