Commit 8ea1c487 authored by unknown's avatar unknown

Portability fixes

parent d40ce9db
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
#define RESOLVE_VERSION "2.0" #define RESOLVE_VERSION "2.0"
#include <global.h> #include <global.h>
#include <m_ctype.h>
#include <my_sys.h>
#include <m_string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#ifndef HAVE_BROKEN_NETINET_INCLUDES #ifndef HAVE_BROKEN_NETINET_INCLUDES
...@@ -27,8 +30,6 @@ ...@@ -27,8 +30,6 @@
#endif #endif
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#include <m_ctype.h>
#include <my_sys.h>
#include <getopt.h> #include <getopt.h>
#if !defined(_AIX) && !defined(HAVE_UNIXWARE7_THREADS) && !defined(HAVE_UNIXWARE7_POSIX) && !defined(h_errno) #if !defined(_AIX) && !defined(HAVE_UNIXWARE7_THREADS) && !defined(HAVE_UNIXWARE7_POSIX) && !defined(h_errno)
......
...@@ -817,7 +817,9 @@ os_file_read( ...@@ -817,7 +817,9 @@ os_file_read(
return(TRUE); return(TRUE);
} }
#endif #endif
#ifdef __WIN__
error_handling: error_handling:
#endif
retry = os_file_handle_error(file, NULL); retry = os_file_handle_error(file, NULL);
if (retry) { if (retry) {
...@@ -906,7 +908,9 @@ os_file_write( ...@@ -906,7 +908,9 @@ os_file_write(
return(TRUE); return(TRUE);
} }
#endif #endif
#ifdef __WIN__
error_handling: error_handling:
#endif
retry = os_file_handle_error(file, name); retry = os_file_handle_error(file, name);
if (retry) { if (retry) {
...@@ -1150,6 +1154,8 @@ os_aio_get_array_and_local_segment( ...@@ -1150,6 +1154,8 @@ os_aio_get_array_and_local_segment(
/*********************************************************************** /***********************************************************************
Gets an integer value designating a specified aio array. This is used Gets an integer value designating a specified aio array. This is used
to give numbers to signals in Posix aio. */ to give numbers to signals in Posix aio. */
#if !defined(WIN_ASYNC_IO) && defined(POSIX_ASYNC_IO)
static static
ulint ulint
os_aio_get_array_no( os_aio_get_array_no(
...@@ -1203,6 +1209,7 @@ os_aio_get_array_from_no( ...@@ -1203,6 +1209,7 @@ os_aio_get_array_from_no(
return(NULL); return(NULL);
} }
} }
#endif /* if !defined(WIN_ASYNC_IO) && defined(POSIX_ASYNC_IO) */
/*********************************************************************** /***********************************************************************
Requests for a slot in the aio array. If no slot is available, waits until Requests for a slot in the aio array. If no slot is available, waits until
...@@ -1955,7 +1962,7 @@ os_aio_simulated_handle( ...@@ -1955,7 +1962,7 @@ os_aio_simulated_handle(
} }
} }
srv_io_thread_op_info[global_segment] = "doing file i/o"; srv_io_thread_op_info[global_segment] = (char*) "doing file i/o";
/* Do the i/o with ordinary, synchronous i/o functions: */ /* Do the i/o with ordinary, synchronous i/o functions: */
if (slot->type == OS_FILE_WRITE) { if (slot->type == OS_FILE_WRITE) {
...@@ -1967,7 +1974,7 @@ os_aio_simulated_handle( ...@@ -1967,7 +1974,7 @@ os_aio_simulated_handle(
} }
ut_a(ret); ut_a(ret);
srv_io_thread_op_info[global_segment] = "file i/o done"; srv_io_thread_op_info[global_segment] = (char*) "file i/o done";
/* printf("aio: %lu consecutive %lu:th segment, first offs %lu blocks\n", /* printf("aio: %lu consecutive %lu:th segment, first offs %lu blocks\n",
n_consecutive, global_segment, slot->offset n_consecutive, global_segment, slot->offset
...@@ -2024,7 +2031,7 @@ os_aio_simulated_handle( ...@@ -2024,7 +2031,7 @@ os_aio_simulated_handle(
os_mutex_exit(array->mutex); os_mutex_exit(array->mutex);
srv_io_thread_op_info[global_segment] = "waiting for i/o request"; srv_io_thread_op_info[global_segment] = (char*) "waiting for i/o request";
os_event_wait(os_aio_segment_wait_events[global_segment]); os_event_wait(os_aio_segment_wait_events[global_segment]);
......
...@@ -78,7 +78,7 @@ ut_malloc_low( ...@@ -78,7 +78,7 @@ ut_malloc_low(
fprintf(stderr, fprintf(stderr,
"InnoDB: Fatal error: cannot allocate %lu bytes of\n" "InnoDB: Fatal error: cannot allocate %lu bytes of\n"
"InnoDB: memory with malloc! Total allocated memory\n" "InnoDB: memory with malloc! Total allocated memory\n"
"InnoDB: by InnoDB %lu bytes. Operating system errno: %lu\n" "InnoDB: by InnoDB %lu bytes. Operating system errno: %d\n"
"InnoDB: Cannot continue operation!\n" "InnoDB: Cannot continue operation!\n"
"InnoDB: Check if you should increase the swap file or\n" "InnoDB: Check if you should increase the swap file or\n"
"InnoDB: ulimits of your operating system.\n", "InnoDB: ulimits of your operating system.\n",
...@@ -155,7 +155,7 @@ ut_free_all_mem(void) ...@@ -155,7 +155,7 @@ ut_free_all_mem(void)
os_fast_mutex_lock(&ut_list_mutex); os_fast_mutex_lock(&ut_list_mutex);
while (block = UT_LIST_GET_FIRST(ut_mem_block_list)) { while ((block = UT_LIST_GET_FIRST(ut_mem_block_list))) {
ut_a(block->magic_n == UT_MEM_MAGIC_N); ut_a(block->magic_n == UT_MEM_MAGIC_N);
ut_a(ut_total_allocated_memory >= block->size); ut_a(ut_total_allocated_memory >= block->size);
......
...@@ -259,8 +259,9 @@ int nisam_create(const char *name,uint keys,N_KEYDEF *keyinfo, ...@@ -259,8 +259,9 @@ int nisam_create(const char *name,uint keys,N_KEYDEF *keyinfo,
(pointer == 3 && reclength >= 256L) ? (ulong) NI_POS_ERROR : (pointer == 3 && reclength >= 256L) ? (ulong) NI_POS_ERROR :
((ulong) reclength * (1L << (pointer*8))); ((ulong) reclength * (1L << (pointer*8)));
share.base.max_key_file_length= (share.base.key_reflength == 3 ? share.base.max_key_file_length= (share.base.key_reflength == 3 ?
NI_POS_ERROR : NI_POS_ERROR :
(1L << (share.base.key_reflength*8))*512); (ulong)
(1L << (share.base.key_reflength*8))*512);
share.base.min_block_length= share.base.min_block_length=
(share.base.pack_reclength+3 < N_EXTEND_BLOCK_LENGTH && (share.base.pack_reclength+3 < N_EXTEND_BLOCK_LENGTH &&
! share.base.blobs) ? ! share.base.blobs) ?
......
...@@ -288,7 +288,7 @@ static void usage(void) ...@@ -288,7 +288,7 @@ static void usage(void)
-?, --help display this help and exit\n\ -?, --help display this help and exit\n\
-V, --version output version information and exit\n"); -V, --version output version information and exit\n");
print_defaults("my",load_default_groups); print_defaults("my",load_default_groups);
}; }
/* reads options */ /* reads options */
/* Initiates DEBUG - but no debugging here ! */ /* Initiates DEBUG - but no debugging here ! */
......
...@@ -38,8 +38,12 @@ ...@@ -38,8 +38,12 @@
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif #endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__FreeBSD__) #if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__FreeBSD__)
#include <netinet/in_systm.h>
#include <netinet/ip.h> #include <netinet/ip.h>
#if !defined(alpha_linux_port) #if !defined(alpha_linux_port)
#include <netinet/tcp.h> #include <netinet/tcp.h>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#undef GETPID /* For HPUX */ #undef GETPID /* For HPUX */
#ifdef THREAD #ifdef THREAD
#define GETPID() (log_type == 1 ? myisam_pid : (long) my_thread_id()); #define GETPID() (log_type == 1 ? (long) myisam_pid : (long) my_thread_id());
#else #else
#define GETPID() myisam_pid #define GETPID() myisam_pid
#endif #endif
......
...@@ -893,7 +893,8 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts) ...@@ -893,7 +893,8 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
DBUG_RETURN(error != HA_ERR_END_OF_FILE); DBUG_RETURN(error != HA_ERR_END_OF_FILE);
} }
static int compare_huff_elements(void *not_used, byte *a, byte *b) static int compare_huff_elements(void *not_used __attribute__((unused)),
byte *a, byte *b)
{ {
return *((my_off_t*) a) < *((my_off_t*) b) ? -1 : return *((my_off_t*) a) < *((my_off_t*) b) ? -1 :
(*((my_off_t*) a) == *((my_off_t*) b) ? 0 : 1); (*((my_off_t*) a) == *((my_off_t*) b) ? 0 : 1);
......
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
this, just remember the file name for later removal this, just remember the file name for later removal
*/ */
static my_bool cache_remove_open_tmp(IO_CACHE *cache, const char *name) static my_bool cache_remove_open_tmp(IO_CACHE *cache __attribute__((unused)),
const char *name)
{ {
#if O_TEMPORARY == 0 #if O_TEMPORARY == 0
#if !defined(CANT_DELETE_OPEN_FILES) #if !defined(CANT_DELETE_OPEN_FILES)
......
...@@ -138,7 +138,7 @@ _rl_vi_initialize_line () ...@@ -138,7 +138,7 @@ _rl_vi_initialize_line ()
{ {
register int i; register int i;
for (i = 0; i < sizeof (vi_mark_chars) / sizeof (int); i++) for (i = 0; i < (int) sizeof (vi_mark_chars) / sizeof (int); i++)
vi_mark_chars[i] = -1; vi_mark_chars[i] = -1;
} }
......
...@@ -230,7 +230,7 @@ innobase_mysql_print_thd( ...@@ -230,7 +230,7 @@ innobase_mysql_print_thd(
} }
if (thd->query) { if (thd->query) {
printf("\n%0.100s", thd->query); printf("\n%.100s", thd->query);
} }
printf("\n"); printf("\n");
......
...@@ -38,8 +38,12 @@ ...@@ -38,8 +38,12 @@
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif #endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__FreeBSD__) #if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__FreeBSD__)
#include <netinet/in_systm.h>
#include <netinet/ip.h> #include <netinet/ip.h>
#if !defined(alpha_linux_port) #if !defined(alpha_linux_port)
#include <netinet/tcp.h> #include <netinet/tcp.h>
......
...@@ -123,7 +123,7 @@ enum l1_symbols { ...@@ -123,7 +123,7 @@ enum l1_symbols {
L1_SARA_AE, L1_SARA_AE,
L1_SARA_O, L1_SARA_O,
L1_SARA_AI_MAIMUAN, L1_SARA_AI_MAIMUAN,
L1_SARA_AI_MAIMALAI, L1_SARA_AI_MAIMALAI
}; };
// level 2 symbols & order // level 2 symbols & order
...@@ -137,7 +137,7 @@ enum l2_symbols { ...@@ -137,7 +137,7 @@ enum l2_symbols {
L2_TONE1, L2_TONE1,
L2_TONE2, L2_TONE2,
L2_TONE3, L2_TONE3,
L2_TONE4, L2_TONE4
}; };
// level 3 symbols & order // level 3 symbols & order
...@@ -182,7 +182,7 @@ enum l3_symbols { ...@@ -182,7 +182,7 @@ enum l3_symbols {
L3_LESS_THAN, L3_LESS_THAN,
L3_EQUAL, L3_EQUAL,
L3_GREATER_THAN, L3_GREATER_THAN,
L3_V_LINE, L3_V_LINE
}; };
// level 4 symbols & order // level 4 symbols & order
...@@ -190,7 +190,7 @@ enum l4_symbols { ...@@ -190,7 +190,7 @@ enum l4_symbols {
L4_BLANK = TOT_LEVELS, L4_BLANK = TOT_LEVELS,
L4_MIN, L4_MIN,
L4_CAP, L4_CAP,
L4_EXT, L4_EXT
}; };
enum level_symbols { enum level_symbols {
......
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