diff options
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/array.c | 2 | ||||
-rw-r--r-- | mysys/base64.c | 2 | ||||
-rw-r--r-- | mysys/charset.c | 2 | ||||
-rw-r--r-- | mysys/checksum.c | 2 | ||||
-rw-r--r-- | mysys/default.c | 14 | ||||
-rw-r--r-- | mysys/default_modify.c | 4 | ||||
-rw-r--r-- | mysys/hash.c | 11 | ||||
-rw-r--r-- | mysys/mf_keycache.c | 2 | ||||
-rw-r--r-- | mysys/mf_tempdir.c | 2 | ||||
-rw-r--r-- | mysys/my_append.c | 2 | ||||
-rw-r--r-- | mysys/my_compress.c | 4 | ||||
-rw-r--r-- | mysys/my_conio.c | 2 | ||||
-rw-r--r-- | mysys/my_copy.c | 2 | ||||
-rw-r--r-- | mysys/my_getwd.c | 2 | ||||
-rw-r--r-- | mysys/my_pread.c | 4 | ||||
-rw-r--r-- | mysys/my_quick.c | 4 | ||||
-rw-r--r-- | mysys/my_read.c | 2 | ||||
-rw-r--r-- | mysys/safemalloc.c | 2 | ||||
-rw-r--r-- | mysys/string.c | 8 |
19 files changed, 35 insertions, 38 deletions
diff --git a/mysys/array.c b/mysys/array.c index f11a327232c..92940717c90 100644 --- a/mysys/array.c +++ b/mysys/array.c @@ -371,7 +371,7 @@ void freeze_size(DYNAMIC_ARRAY *array) int get_index_dynamic(DYNAMIC_ARRAY *array, uchar* element) { - uint ret; + size_t ret; if (array->buffer > element) return -1; diff --git a/mysys/base64.c b/mysys/base64.c index 6157dcaa5af..f7d9c8b0d09 100644 --- a/mysys/base64.c +++ b/mysys/base64.c @@ -223,7 +223,7 @@ base64_decode(const char *src_base, size_t len, The variable 'i' is set to 'len' when padding has been read, so it does not actually reflect the number of bytes read from 'src'. */ - return i != len ? -1 : d - dst_base; + return i != len ? -1 : (uint) (d - dst_base); } diff --git a/mysys/charset.c b/mysys/charset.c index 8f47b4027ef..e61995de1d8 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -328,7 +328,7 @@ static my_bool my_read_charset_file(const char *filename, myf myflags) { uchar *buf; int fd; - uint len, tmp_len; + size_t len, tmp_len; MY_STAT stat_info; if (!my_stat(filename, &stat_info, MYF(myflags)) || diff --git a/mysys/checksum.c b/mysys/checksum.c index 4f86f6845f0..1c7c9358d53 100644 --- a/mysys/checksum.c +++ b/mysys/checksum.c @@ -36,7 +36,7 @@ ha_checksum my_checksum(ha_checksum crc, const uchar *pos, size_t length) crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8)); return crc; #else - return (ha_checksum)crc32((uint)crc, pos, length); + return (ha_checksum)crc32((uint)crc, pos, (uint)length); #endif } diff --git a/mysys/default.c b/mysys/default.c index c7e1e513e1e..1875c0cebbe 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -183,7 +183,7 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv, /* Handle --defaults-group-suffix= */ uint i; const char **extra_groups; - const uint instance_len= strlen(my_defaults_group_suffix); + const size_t instance_len= strlen(my_defaults_group_suffix); struct handle_option_ctx *ctx= (struct handle_option_ctx*) func_ctx; char *ptr; TYPELIB *group= ctx->group; @@ -195,12 +195,12 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv, for (i= 0; i < group->count; i++) { - uint len; + size_t len; extra_groups[i]= group->type_names[i]; /** copy group */ len= strlen(extra_groups[i]); - if (!(ptr= alloc_root(ctx->alloc, len+instance_len+1))) - DBUG_RETURN(2); + if (!(ptr= alloc_root(ctx->alloc, (uint) (len+instance_len+1)))) + DBUG_RETURN(2); extra_groups[i+group->count]= ptr; @@ -970,7 +970,7 @@ void print_defaults(const char *conf_file, const char **groups) static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs) { char buf[FN_REFLEN]; - uint len; + size_t len; char *p; my_bool err __attribute__((unused)); @@ -1004,14 +1004,14 @@ static size_t my_get_system_windows_directory(char *buffer, size_t size) "GetSystemWindowsDirectoryA"); if (func_ptr) - return func_ptr(buffer, size); + return func_ptr(buffer, (uint) size); /* Windows NT 4.0 Terminal Server Edition: To retrieve the shared Windows directory, call GetSystemDirectory and trim the "System32" element from the end of the returned path. */ - count= GetSystemDirectory(buffer, size); + count= GetSystemDirectory(buffer, (uint) size); if (count > 8 && stricmp(buffer+(count-8), "\\System32") == 0) { count-= 8; diff --git a/mysys/default_modify.c b/mysys/default_modify.c index 78f6105b071..88df0122da2 100644 --- a/mysys/default_modify.c +++ b/mysys/default_modify.c @@ -68,11 +68,9 @@ int modify_defaults_file(const char *file_location, const char *option, FILE *cnf_file; MY_STAT file_stat; char linebuff[BUFF_SIZE], *src_ptr, *dst_ptr, *file_buffer; - size_t opt_len= 0, optval_len= 0, sect_len; + size_t opt_len= 0, optval_len= 0, sect_len, new_opt_len, reserve_extended; uint nr_newlines= 0, buffer_size; my_bool in_section= FALSE, opt_applied= 0; - uint reserve_extended; - uint new_opt_len; int reserve_occupied= 0; DBUG_ENTER("modify_defaults_file"); diff --git a/mysys/hash.c b/mysys/hash.c index dd2d589e509..0b44782aeb5 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -157,14 +157,14 @@ my_hash_key(const HASH *hash, const uchar *record, size_t *length, /* Calculate pos according to keys */ -static uint my_hash_mask(uint hashnr, uint buffmax, uint maxlength) +static uint my_hash_mask(size_t hashnr, size_t buffmax, size_t maxlength) { if ((hashnr & (buffmax-1)) < maxlength) return (hashnr & (buffmax-1)); return (hashnr & ((buffmax >> 1) -1)); } static uint my_hash_rec_mask(const HASH *hash, HASH_LINK *pos, - uint buffmax, uint maxlength) + size_t buffmax, size_t maxlength) { size_t length; uchar *key= (uchar*) my_hash_key(hash, pos->data, &length, 0); @@ -309,8 +309,7 @@ static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key, my_bool my_hash_insert(HASH *info, const uchar *record) { int flag; - size_t idx; - uint halfbuff,hash_nr,first_index; + size_t idx,halfbuff,hash_nr,first_index; uchar *ptr_to_rec,*ptr_to_rec2; HASH_LINK *data,*empty,*gpos,*gpos2,*pos; @@ -539,8 +538,8 @@ exit: my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, size_t old_key_length) { - uint new_index,new_pos_index,blength,records,empty; - size_t idx; + uint new_index,new_pos_index,blength,records; + size_t idx,empty; HASH_LINK org_link,*data,*previous,*pos; DBUG_ENTER("my_hash_update"); diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 7cbd35580f1..397a3332740 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -2404,7 +2404,7 @@ static void read_block(KEY_CACHE *keycache, BLOCK_LINK *block, uint read_length, uint min_length, my_bool primary) { - uint got_length; + size_t got_length; /* On entry cache_lock is locked */ diff --git a/mysys/mf_tempdir.c b/mysys/mf_tempdir.c index d6492c90965..f41bbab946f 100644 --- a/mysys/mf_tempdir.c +++ b/mysys/mf_tempdir.c @@ -47,7 +47,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist) } do { - uint length; + size_t length; end=strcend(pathlist, DELIM); strmake(buff, pathlist, (uint) (end-pathlist)); length= cleanup_dirname(buff, buff); diff --git a/mysys/my_append.c b/mysys/my_append.c index 35881a959d5..d8789f95d95 100644 --- a/mysys/my_append.c +++ b/mysys/my_append.c @@ -36,7 +36,7 @@ struct utimbuf { int my_append(const char *from, const char *to, myf MyFlags) { - uint Count; + size_t Count; File from_file,to_file; uchar buff[IO_SIZE]; DBUG_ENTER("my_append"); diff --git a/mysys/my_compress.c b/mysys/my_compress.c index 0d076e77c35..a3d9d56915e 100644 --- a/mysys/my_compress.c +++ b/mysys/my_compress.c @@ -67,7 +67,7 @@ uchar *my_compress_alloc(const uchar *packet, size_t *len, size_t *complen) if (!(compbuf= (uchar *) my_malloc(*complen, MYF(MY_WME)))) return 0; /* Not enough memory */ - tmp_complen= *complen; + tmp_complen= (uint) *complen; res= compress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, (uLong) *len); *complen= tmp_complen; @@ -118,7 +118,7 @@ my_bool my_uncompress(uchar *packet, size_t len, size_t *complen) if (!compbuf) DBUG_RETURN(1); /* Not enough memory */ - tmp_complen= *complen; + tmp_complen= (uint) *complen; error= uncompress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, (uLong) len); *complen= tmp_complen; diff --git a/mysys/my_conio.c b/mysys/my_conio.c index b78966446ee..5dbd31193a9 100644 --- a/mysys/my_conio.c +++ b/mysys/my_conio.c @@ -172,7 +172,7 @@ char* my_cgets(char *buffer, size_t clen, size_t* plen) do { clen= min(clen, (size_t) csbi.dwSize.X*csbi.dwSize.Y); - if (!ReadConsole((HANDLE)my_coninpfh, (LPVOID)buffer, clen - 1, &plen_res, + if (!ReadConsole((HANDLE)my_coninpfh, (LPVOID)buffer, (DWORD) clen - 1, &plen_res, NULL)) { result= NULL; diff --git a/mysys/my_copy.c b/mysys/my_copy.c index cd741b1eb52..5679d13d39d 100644 --- a/mysys/my_copy.c +++ b/mysys/my_copy.c @@ -50,7 +50,7 @@ struct utimbuf { int my_copy(const char *from, const char *to, myf MyFlags) { - uint Count; + size_t Count; my_bool new_file_stat= 0; /* 1 if we could stat "to" */ int create_flag; File from_file,to_file; diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c index cbfebcf2374..e0c5b94b53e 100644 --- a/mysys/my_getwd.c +++ b/mysys/my_getwd.c @@ -55,7 +55,7 @@ int my_getwd(char * buf, size_t size, myf MyFlags) else { #if defined(HAVE_GETCWD) - if (!getcwd(buf,size-2) && MyFlags & MY_WME) + if (!getcwd(buf,(uint) (size-2)) && MyFlags & MY_WME) { my_errno=errno; my_error(EE_GETWD,MYF(ME_BELL+ME_WAITTANG),errno); diff --git a/mysys/my_pread.c b/mysys/my_pread.c index 156862ec414..3f62f150c91 100644 --- a/mysys/my_pread.c +++ b/mysys/my_pread.c @@ -59,7 +59,7 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset, pthread_mutex_lock(&my_file_info[Filedes].mutex); readbytes= (uint) -1; error= (lseek(Filedes, offset, MY_SEEK_SET) == (my_off_t) -1 || - (readbytes= read(Filedes, Buffer, Count)) != Count); + (readbytes= read(Filedes, Buffer, (uint) Count)) != Count); pthread_mutex_unlock(&my_file_info[Filedes].mutex); #else if ((error= ((readbytes= pread(Filedes, Buffer, Count, offset)) != Count))) @@ -136,7 +136,7 @@ size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count, writenbytes= (size_t) -1; pthread_mutex_lock(&my_file_info[Filedes].mutex); error= (lseek(Filedes, offset, MY_SEEK_SET) != (my_off_t) -1 && - (writenbytes = write(Filedes, Buffer, Count)) == Count); + (writenbytes = write(Filedes, Buffer, (uint) Count)) == Count); pthread_mutex_unlock(&my_file_info[Filedes].mutex); if (error) break; diff --git a/mysys/my_quick.c b/mysys/my_quick.c index c19fe08572d..0ba20a5bdee 100644 --- a/mysys/my_quick.c +++ b/mysys/my_quick.c @@ -23,7 +23,7 @@ size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags) { size_t readbytes; - if ((readbytes = read(Filedes, Buffer, Count)) != Count) + if ((readbytes = read(Filedes, Buffer, (uint) Count)) != Count) { #ifndef DBUG_OFF if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR) @@ -50,7 +50,7 @@ size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count) #ifndef DBUG_OFF writtenbytes = #endif - (size_t) write(Filedes,Buffer,Count)) != Count) + (size_t) write(Filedes,Buffer, (uint) Count)) != Count) { #ifndef DBUG_OFF if ((writtenbytes == 0 || writtenbytes == (size_t) -1) && errno == EINTR) diff --git a/mysys/my_read.c b/mysys/my_read.c index f3e8a4b300e..0c302d5b227 100644 --- a/mysys/my_read.c +++ b/mysys/my_read.c @@ -44,7 +44,7 @@ size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags) for (;;) { errno= 0; /* Linux doesn't reset this */ - if ((readbytes= read(Filedes, Buffer, Count)) != Count) + if ((readbytes= read(Filedes, Buffer, (uint) Count)) != Count) { my_errno= errno ? errno : -1; DBUG_PRINT("warning",("Read only %d bytes off %lu from %d, errno: %d", diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index c484f1d4c54..36d07b475e9 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -174,7 +174,7 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags) data[size + 3]= MAGICEND3; irem->filename= (char *) filename; irem->linenum= lineno; - irem->datasize= size; + irem->datasize= (uint32) size; irem->prev= NULL; /* Add this remember structure to the linked list */ diff --git a/mysys/string.c b/mysys/string.c index b234a589406..10a72b8a295 100644 --- a/mysys/string.c +++ b/mysys/string.c @@ -25,7 +25,7 @@ my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, size_t init_alloc, size_t alloc_increment) { - uint length; + size_t length; DBUG_ENTER("init_dynamic_string"); if (!alloc_increment) @@ -100,7 +100,7 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, char *new_ptr; if (str->length+length >= str->max_length) { - uint new_length=(str->length+length+str->alloc_increment)/ + size_t new_length=(str->length+length+str->alloc_increment)/ str->alloc_increment; new_length*=str->alloc_increment; if (!(new_ptr=(char*) my_realloc(str->str,new_length,MYF(MY_WME)))) @@ -160,12 +160,12 @@ my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...) /* Search for quote in each string and replace with escaped quote */ while(*(next_pos= strcend(cur_pos, quote_str[0])) != '\0') { - ret&= dynstr_append_mem(str, cur_pos, next_pos - cur_pos); + ret&= dynstr_append_mem(str, cur_pos, (uint) (next_pos - cur_pos)); ret&= dynstr_append_mem(str ,"\\", 1); ret&= dynstr_append_mem(str, quote_str, quote_len); cur_pos= next_pos + 1; } - ret&= dynstr_append_mem(str, cur_pos, next_pos - cur_pos); + ret&= dynstr_append_mem(str, cur_pos, (uint) (next_pos - cur_pos)); append= va_arg(dirty_text, char *); } va_end(dirty_text); |