summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/myisam/mi_create.c4
-rw-r--r--storage/myisam/mi_log.c5
-rw-r--r--storage/myisam/mi_open.c4
-rw-r--r--storage/myisam/mi_static.c8
-rw-r--r--storage/myisam/mi_test2.c2
-rw-r--r--storage/myisam/myisamdef.h20
-rw-r--r--storage/myisam/myisampack.c3
-rw-r--r--storage/myisam/sort.c129
8 files changed, 80 insertions, 95 deletions
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index c415264cd98..4a91c2d939b 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -19,12 +19,8 @@
#include "sp_defs.h"
#include <my_bit.h>
-#if defined(MSDOS) || defined(__WIN__)
#ifdef __WIN__
#include <fcntl.h>
-#else
-#include <process.h> /* Prototype for getpid */
-#endif
#endif
#include <m_ctype.h>
diff --git a/storage/myisam/mi_log.c b/storage/myisam/mi_log.c
index 54498393f15..8de9e190d4a 100644
--- a/storage/myisam/mi_log.c
+++ b/storage/myisam/mi_log.c
@@ -19,11 +19,8 @@
*/
#include "myisamdef.h"
-#if defined(MSDOS) || defined(__WIN__)
+#ifdef __WIN__
#include <fcntl.h>
-#ifndef __WIN__
-#include <process.h>
-#endif
#endif
#ifdef VMS
#include <processes.h>
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index 014cf1c5a2c..0a7ab397523 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -20,12 +20,8 @@
#include "rt_index.h"
#include <m_ctype.h>
-#if defined(MSDOS) || defined(__WIN__)
#ifdef __WIN__
#include <fcntl.h>
-#else
-#include <process.h> /* Prototype for getpid */
-#endif
#endif
#ifdef VMS
#include "static.c"
diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c
index 81d063a58fd..baa01a507eb 100644
--- a/storage/myisam/mi_static.c
+++ b/storage/myisam/mi_static.c
@@ -23,9 +23,9 @@
#endif
LIST *myisam_open_list=0;
-uchar NEAR myisam_file_magic[]=
+uchar myisam_file_magic[]=
{ (uchar) 254, (uchar) 254,'\007', '\001', };
-uchar NEAR myisam_pack_file_magic[]=
+uchar myisam_pack_file_magic[]=
{ (uchar) 254, (uchar) 254,'\010', '\002', };
char * myisam_log_filename=(char*) "myisam.log";
File myisam_log_file= -1;
@@ -55,7 +55,7 @@ int (*myisam_test_invalid_symlink)(const char *filename)= always_valid;
Position is , == , >= , <= , > , <
*/
-uint NEAR myisam_read_vec[]=
+uint myisam_read_vec[]=
{
SEARCH_FIND, SEARCH_FIND | SEARCH_BIGGER, SEARCH_FIND | SEARCH_SMALLER,
SEARCH_NO_FIND | SEARCH_BIGGER, SEARCH_NO_FIND | SEARCH_SMALLER,
@@ -63,7 +63,7 @@ uint NEAR myisam_read_vec[]=
MBR_CONTAIN, MBR_INTERSECT, MBR_WITHIN, MBR_DISJOINT, MBR_EQUAL
};
-uint NEAR myisam_readnext_vec[]=
+uint myisam_readnext_vec[]=
{
SEARCH_BIGGER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER,
SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_SMALLER
diff --git a/storage/myisam/mi_test2.c b/storage/myisam/mi_test2.c
index 60b16d5549e..94936ab84ae 100644
--- a/storage/myisam/mi_test2.c
+++ b/storage/myisam/mi_test2.c
@@ -28,7 +28,7 @@
#define STANDARD_LENGTH 37
#define MYISAM_KEYS 6
#define MAX_PARTS 4
-#if !defined(MSDOS) && !defined(labs)
+#if !defined(labs)
#define labs(a) abs(a)
#endif
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index d88ebdf5f12..130a96bc9e0 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -347,11 +347,11 @@ typedef struct st_mi_sort_param
int (*key_read)(struct st_mi_sort_param *,void *);
int (*key_write)(struct st_mi_sort_param *, const void *);
void (*lock_in_memory)(MI_CHECK *);
- NEAR int (*write_keys)(struct st_mi_sort_param *, register uchar **,
- uint , struct st_buffpek *, IO_CACHE *);
- NEAR uint (*read_to_buffer)(IO_CACHE *,struct st_buffpek *, uint);
- NEAR int (*write_key)(struct st_mi_sort_param *, IO_CACHE *,uchar *,
- uint, uint);
+ int (*write_keys)(struct st_mi_sort_param *, register uchar **,
+ uint , struct st_buffpek *, IO_CACHE *);
+ uint (*read_to_buffer)(IO_CACHE *,struct st_buffpek *, uint);
+ int (*write_key)(struct st_mi_sort_param *, IO_CACHE *,uchar *,
+ uint, uint);
} MI_SORT_PARAM;
/* Some defines used by isam-funktions */
@@ -475,8 +475,8 @@ extern mysql_mutex_t THR_LOCK_myisam;
/* Some extern variables */
extern LIST *myisam_open_list;
-extern uchar NEAR myisam_file_magic[],NEAR myisam_pack_file_magic[];
-extern uint NEAR myisam_read_vec[],NEAR myisam_readnext_vec[];
+extern uchar myisam_file_magic[], myisam_pack_file_magic[];
+extern uint myisam_read_vec[], myisam_readnext_vec[];
extern uint myisam_quick_table_bits;
extern File myisam_log_file;
extern ulong myisam_pid;
@@ -774,9 +774,9 @@ void _mi_report_crashed(MI_INFO *file, const char *message,
/* Functions needed by mi_check */
volatile int *killed_ptr(MI_CHECK *param);
-void mi_check_print_error _VARARGS((MI_CHECK *param, const char *fmt,...));
-void mi_check_print_warning _VARARGS((MI_CHECK *param, const char *fmt,...));
-void mi_check_print_info _VARARGS((MI_CHECK *param, const char *fmt,...));
+void mi_check_print_error(MI_CHECK *param, const char *fmt,...);
+void mi_check_print_warning(MI_CHECK *param, const char *fmt,...);
+void mi_check_print_info(MI_CHECK *param, const char *fmt,...);
int flush_pending_blocks(MI_SORT_PARAM *param);
int sort_ft_buf_flush(MI_SORT_PARAM *sort_param);
int thr_write_keys(MI_SORT_PARAM *sort_param);
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index 9f25a6bc112..4cd305fdc69 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -23,9 +23,6 @@
#include <queues.h>
#include <my_tree.h>
#include "mysys_err.h"
-#ifdef MSDOS
-#include <io.h>
-#endif
#ifndef __GNU_LIBRARY__
#define __GNU_LIBRARY__ /* Skip warnings in getopt.h */
#endif
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index a824de8c9fb..9532b9f0474 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -19,7 +19,7 @@
*/
#include "fulltext.h"
-#if defined(MSDOS) || defined(__WIN__)
+#if defined(__WIN__)
#include <fcntl.h>
#else
#include <stddef.h>
@@ -41,46 +41,46 @@
Pointers of functions for store and read keys from temp file
*/
-extern void print_error _VARARGS((const char *fmt,...));
+extern void print_error(const char *fmt,...);
/* Functions defined in this file */
-static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info,uint keys,
- uchar **sort_keys,
- DYNAMIC_ARRAY *buffpek,int *maxbuffer,
- IO_CACHE *tempfile,
- IO_CACHE *tempfile_for_exceptions);
-static int NEAR_F write_keys(MI_SORT_PARAM *info,uchar **sort_keys,
- uint count, BUFFPEK *buffpek,IO_CACHE *tempfile);
-static int NEAR_F write_key(MI_SORT_PARAM *info, uchar *key,
- IO_CACHE *tempfile);
-static int NEAR_F write_index(MI_SORT_PARAM *info,uchar * *sort_keys,
- uint count);
-static int NEAR_F merge_many_buff(MI_SORT_PARAM *info,uint keys,
- uchar * *sort_keys,
- BUFFPEK *buffpek,int *maxbuffer,
- IO_CACHE *t_file);
-static uint NEAR_F read_to_buffer(IO_CACHE *fromfile,BUFFPEK *buffpek,
- uint sort_length);
-static int NEAR_F merge_buffers(MI_SORT_PARAM *info,uint keys,
- IO_CACHE *from_file, IO_CACHE *to_file,
- uchar * *sort_keys, BUFFPEK *lastbuff,
- BUFFPEK *Fb, BUFFPEK *Tb);
-static int NEAR_F merge_index(MI_SORT_PARAM *,uint,uchar **,BUFFPEK *, int,
- IO_CACHE *);
+static ha_rows find_all_keys(MI_SORT_PARAM *info,uint keys,
+ uchar **sort_keys,
+ DYNAMIC_ARRAY *buffpek,int *maxbuffer,
+ IO_CACHE *tempfile,
+ IO_CACHE *tempfile_for_exceptions);
+static int write_keys(MI_SORT_PARAM *info,uchar **sort_keys,
+ uint count, BUFFPEK *buffpek,IO_CACHE *tempfile);
+static int write_key(MI_SORT_PARAM *info, uchar *key,
+ IO_CACHE *tempfile);
+static int write_index(MI_SORT_PARAM *info,uchar * *sort_keys,
+ uint count);
+static int merge_many_buff(MI_SORT_PARAM *info,uint keys,
+ uchar * *sort_keys,
+ BUFFPEK *buffpek,int *maxbuffer,
+ IO_CACHE *t_file);
+static uint read_to_buffer(IO_CACHE *fromfile,BUFFPEK *buffpek,
+ uint sort_length);
+static int merge_buffers(MI_SORT_PARAM *info,uint keys,
+ IO_CACHE *from_file, IO_CACHE *to_file,
+ uchar * *sort_keys, BUFFPEK *lastbuff,
+ BUFFPEK *Fb, BUFFPEK *Tb);
+static int merge_index(MI_SORT_PARAM *,uint,uchar **,BUFFPEK *, int,
+ IO_CACHE *);
static int flush_ft_buf(MI_SORT_PARAM *info);
-static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info,uchar **sort_keys,
- uint count, BUFFPEK *buffpek,
- IO_CACHE *tempfile);
-static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile,BUFFPEK *buffpek,
- uint sort_length);
-static int NEAR_F write_merge_key(MI_SORT_PARAM *info, IO_CACHE *to_file,
- uchar *key, uint sort_length, uint count);
-static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info,
- IO_CACHE *to_file,
- uchar* key, uint sort_length,
- uint count);
+static int write_keys_varlen(MI_SORT_PARAM *info,uchar **sort_keys,
+ uint count, BUFFPEK *buffpek,
+ IO_CACHE *tempfile);
+static uint read_to_buffer_varlen(IO_CACHE *fromfile,BUFFPEK *buffpek,
+ uint sort_length);
+static int write_merge_key(MI_SORT_PARAM *info, IO_CACHE *to_file,
+ uchar *key, uint sort_length, uint count);
+static int write_merge_key_varlen(MI_SORT_PARAM *info,
+ IO_CACHE *to_file,
+ uchar* key, uint sort_length,
+ uint count);
static inline int
my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs);
@@ -253,10 +253,10 @@ err:
/* Search after all keys and place them in a temp. file */
-static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys,
- uchar **sort_keys, DYNAMIC_ARRAY *buffpek,
- int *maxbuffer, IO_CACHE *tempfile,
- IO_CACHE *tempfile_for_exceptions)
+static ha_rows find_all_keys(MI_SORT_PARAM *info, uint keys,
+ uchar **sort_keys, DYNAMIC_ARRAY *buffpek,
+ int *maxbuffer, IO_CACHE *tempfile,
+ IO_CACHE *tempfile_for_exceptions)
{
int error;
uint idx;
@@ -641,8 +641,8 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
/* Write all keys in memory to file for later merge */
-static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
- uint count, BUFFPEK *buffpek, IO_CACHE *tempfile)
+static int write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
+ uint count, BUFFPEK *buffpek, IO_CACHE *tempfile)
{
uchar **end;
uint sort_length=info->key_length;
@@ -682,10 +682,10 @@ my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs)
}
-static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info,
- register uchar **sort_keys,
- uint count, BUFFPEK *buffpek,
- IO_CACHE *tempfile)
+static int write_keys_varlen(MI_SORT_PARAM *info,
+ register uchar **sort_keys,
+ uint count, BUFFPEK *buffpek,
+ IO_CACHE *tempfile)
{
uchar **end;
int err;
@@ -709,8 +709,7 @@ static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info,
} /* write_keys_varlen */
-static int NEAR_F write_key(MI_SORT_PARAM *info, uchar *key,
- IO_CACHE *tempfile)
+static int write_key(MI_SORT_PARAM *info, uchar *key, IO_CACHE *tempfile)
{
uint key_length=info->real_key_length;
DBUG_ENTER("write_key");
@@ -729,8 +728,8 @@ static int NEAR_F write_key(MI_SORT_PARAM *info, uchar *key,
/* Write index */
-static int NEAR_F write_index(MI_SORT_PARAM *info, register uchar **sort_keys,
- register uint count)
+static int write_index(MI_SORT_PARAM *info, register uchar **sort_keys,
+ register uint count)
{
DBUG_ENTER("write_index");
@@ -747,9 +746,9 @@ static int NEAR_F write_index(MI_SORT_PARAM *info, register uchar **sort_keys,
/* Merge buffers to make < MERGEBUFF2 buffers */
-static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys,
- uchar **sort_keys, BUFFPEK *buffpek,
- int *maxbuffer, IO_CACHE *t_file)
+static int merge_many_buff(MI_SORT_PARAM *info, uint keys,
+ uchar **sort_keys, BUFFPEK *buffpek,
+ int *maxbuffer, IO_CACHE *t_file)
{
register int i;
IO_CACHE t_file2, *from_file, *to_file, *temp;
@@ -810,8 +809,8 @@ cleanup:
-1 Error
*/
-static uint NEAR_F read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
- uint sort_length)
+static uint read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
+ uint sort_length)
{
register uint count;
uint length;
@@ -830,8 +829,8 @@ static uint NEAR_F read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
return (count*sort_length);
} /* read_to_buffer */
-static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile, BUFFPEK *buffpek,
- uint sort_length)
+static uint read_to_buffer_varlen(IO_CACHE *fromfile, BUFFPEK *buffpek,
+ uint sort_length)
{
register uint count;
uint16 length_of_key = 0;
@@ -862,9 +861,9 @@ static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile, BUFFPEK *buffpek,
} /* read_to_buffer_varlen */
-static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info,
- IO_CACHE *to_file, uchar* key,
- uint sort_length, uint count)
+static int write_merge_key_varlen(MI_SORT_PARAM *info,
+ IO_CACHE *to_file, uchar* key,
+ uint sort_length, uint count)
{
uint idx;
uchar *bufs = key;
@@ -880,9 +879,9 @@ static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info,
}
-static int NEAR_F write_merge_key(MI_SORT_PARAM *info __attribute__((unused)),
- IO_CACHE *to_file, uchar *key,
- uint sort_length, uint count)
+static int write_merge_key(MI_SORT_PARAM *info __attribute__((unused)),
+ IO_CACHE *to_file, uchar *key,
+ uint sort_length, uint count)
{
return my_b_write(to_file, key, (size_t) sort_length*count);
}
@@ -892,7 +891,7 @@ static int NEAR_F write_merge_key(MI_SORT_PARAM *info __attribute__((unused)),
If to_file == 0 then use info->key_write
*/
-static int NEAR_F
+static int
merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
IO_CACHE *to_file, uchar **sort_keys, BUFFPEK *lastbuff,
BUFFPEK *Fb, BUFFPEK *Tb)
@@ -1035,7 +1034,7 @@ err:
/* Do a merge to output-file (save only positions) */
-static int NEAR_F
+static int
merge_index(MI_SORT_PARAM *info, uint keys, uchar **sort_keys,
BUFFPEK *buffpek, int maxbuffer, IO_CACHE *tempfile)
{