diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-11-24 16:54:59 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-11-24 16:54:59 +0300 |
commit | 9a9e8d2311c9d2bbe8bd31165e916da36e0ffb31 (patch) | |
tree | 887f74eb880e4d9ff8b76ff93b221f7e6ec7fbe8 /mysys | |
parent | e46eaca0f548c1e24e51e601c594f1a4169e077e (diff) | |
download | mariadb-git-9a9e8d2311c9d2bbe8bd31165e916da36e0ffb31.tar.gz |
Backport of:
----------------------------------------------------------------------
ChangeSet@1.2571, 2008-04-08 12:30:06+02:00, vvaintroub@wva. +122 -0
Bug#32082 : definition of VOID in my_global.h conflicts with Windows
SDK headers
VOID macro is now removed. Its usage is replaced with void cast.
In some cases, where cast does not make much sense (pthread_*, printf,
hash_delete, my_seek), cast is ommited.
client/mysqladmin.cc:
Bug#32082 : remove VOID macro
client/mysqldump.c:
Bug#32082 : remove VOID macro
client/mysqlimport.c:
Bug#32082 : remove VOID macro
client/mysqlslap.c:
Bug#32082 : remove VOID macro
client/mysqltest.cc:
Bug#32082 : remove VOID macro
client/sql_string.cc:
Bug#32082 : remove VOID macro
extra/comp_err.c:
Bug#32082 : remove VOID macro
extra/replace.c:
Bug#32082 : remove VOID macro
include/my_alarm.h:
Bug#32082 : remove VOID macro
include/my_global.h:
Bug#32082 : remove VOID macro
libmysql/libmysql.c:
Bug#32082 : remove VOID macro
mysys/errors.c:
Bug#32082 : remove VOID macro
mysys/hash.c:
Bug#32082 : remove VOID macro
mysys/mf_iocache2.c:
Bug#32082 : remove VOID macro
mysys/mf_loadpath.c:
Bug#32082 : remove VOID macro
mysys/mf_path.c:
Bug#32082 : remove VOID macro
mysys/my_append.c:
Bug#32082 : remove VOID macro
mysys/my_clock.c:
Bug#32082 : remove VOID macro
mysys/my_copy.c:
Bug#32082 : remove VOID macro
mysys/my_fstream.c:
Bug#32082 : remove VOID macro
mysys/my_getwd.c:
Bug#32082 : remove VOID macro
mysys/my_lib.c:
Bug#32082 : remove VOID macro
mysys/my_lockmem.c:
Bug#32082 : remove VOID macro
mysys/my_pthread.c:
Bug#32082 : remove VOID macro
mysys/my_redel.c:
Bug#32082 : remove VOID macro
mysys/stacktrace.c:
Bug#32082 : remove VOID macro
mysys/thr_alarm.c:
Bug#32082 : remove VOID macro
mysys/thr_lock.c:
Bug#32082 : remove VOID macro
sql/derror.cc:
Bug#32082 : remove VOID macro
sql/des_key_file.cc:
Bug#32082 : remove VOID macro
sql/discover.cc:
Bug#32082 : remove VOID macro
sql/field.cc:
Bug#32082 : remove VOID macro
sql/filesort.cc:
Bug#32082 : remove VOID macro
sql/ha_ndbcluster.cc:
Bug#32082 : remove VOID macro
sql/ha_partition.cc:
Bug#32082 : remove VOID macro
sql/handler.cc:
Bug#32082 : remove VOID macro
sql/hostname.cc:
Bug#32082 : remove VOID macro
sql/init.cc:
Bug#32082 : remove VOID macro
sql/item.cc:
Bug#32082 : remove VOID macro
sql/item_cmpfunc.cc:
Bug#32082 : remove VOID macro
sql/item_strfunc.cc:
Bug#32082 : remove VOID macro
sql/lock.cc:
Bug#32082 : remove VOID macro
sql/log.cc:
Bug#32082 : remove VOID macro
sql/log_event.cc:
Bug#32082 : remove VOID macro
sql/mysqld.cc:
Bug#32082 : remove VOID macro
sql/opt_range.h:
Bug#32082 : remove VOID macro
sql/protocol.cc:
Bug#32082 : remove VOID macro
sql/records.cc:
Bug#32082 : remove VOID macro
sql/sp_head.cc:
Bug#32082 : remove VOID macro
sql/sp_pcontext.cc:
Bug#32082 : remove VOID macro
sql/sql_acl.cc:
Bug#32082 : remove VOID macro
sql/sql_base.cc:
Bug#32082 : remove VOID macro
sql/sql_cache.cc:
Bug#32082 : remove VOID macro
sql/sql_connect.cc:
Bug#32082 : remove VOID macro
sql/sql_db.cc:
Bug#32082 : remove VOID macro
sql/sql_delete.cc:
Bug#32082 : remove VOID macro
sql/sql_handler.cc:
Bug#32082 : remove VOID macro
sql/sql_insert.cc:
Bug#32082 : remove VOID macro
sql/sql_map.cc:
Bug#32082 : remove VOID macro
sql/sql_parse.cc:
Bug#32082 : remove VOID macro
sql/sql_select.cc:
Bug#32082 : remove VOID macro
sql/sql_servers.cc:
Bug#32082 : remove VOID macro
sql/sql_show.cc:
Bug#32082 : remove VOID macro
sql/sql_string.cc:
Bug#32082 : remove VOID macro
sql/sql_table.cc:
Bug#32082 : remove VOID macro
sql/sql_test.cc:
Bug#32082 : remove VOID macro
sql/sql_trigger.cc:
Bug#32082 : remove VOID macro
sql/sql_update.cc:
Bug#32082 : remove VOID macro
sql/sql_view.cc:
Bug#32082 : remove VOID macro
sql/table.cc:
Bug#32082 : remove VOID macro
sql/tztime.cc:
Bug#32082 : remove VOID macro
sql/udf_example.c:
Bug#32082 : remove VOID macro
sql/uniques.cc:
Bug#32082 : remove VOID macro
sql/unireg.cc:
Bug#32082 : remove VOID macro
storage/archive/ha_archive.cc:
Bug#32082 : remove VOID macro
storage/blackhole/ha_blackhole.cc:
Bug#32082 : remove VOID macro
storage/csv/ha_tina.cc:
Bug#32082 : remove VOID macro
storage/csv/transparent_file.cc:
Bug#32082 : remove VOID macro
storage/example/ha_example.cc:
Bug#32082 : remove VOID macro
storage/federated/ha_federated.cc:
Bug#32082 : remove VOID macro
storage/heap/hp_clear.c:
Bug#32082 : remove VOID macro
storage/heap/hp_create.c:
Bug#32082 : remove VOID macro
storage/heap/hp_test1.c:
Bug#32082 : remove VOID macro
storage/heap/hp_test2.c:
Bug#32082 : remove VOID macro
storage/innobase/handler/ha_innodb.cc:
Bug#32082 : remove VOID macro
storage/myisam/ft_eval.c:
Bug#32082 : remove VOID macro
storage/myisam/ha_myisam.cc:
Bug#32082 : remove VOID macro
storage/myisam/mi_changed.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_check.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_close.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_create.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_dbug.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_delete.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_delete_all.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_dynrec.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_info.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_locking.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_log.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_open.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_packrec.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_panic.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_rsame.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_statrec.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_test1.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_test2.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_test3.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_update.c:
Bug#32082 : remove VOID macro
storage/myisam/mi_write.c:
Bug#32082 : remove VOID macro
storage/myisam/myisamchk.c:
Bug#32082 : remove VOID macro
storage/myisam/myisamlog.c:
Bug#32082 : remove VOID macro
storage/myisam/myisampack.c:
Bug#32082 : remove VOID macro
storage/myisam/sort.c:
Bug#32082 : remove VOID macro
storage/myisammrg/myrg_close.c:
Bug#32082 : remove VOID macro
storage/myisammrg/myrg_create.c:
Bug#32082 : remove VOID macro
storage/myisammrg/myrg_open.c:
Bug#32082 : remove VOID macro
strings/str_test.c:
Bug#32082 : remove VOID macro
tests/thread_test.c:
Bug#32082 : remove VOID macro
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/errors.c | 2 | ||||
-rw-r--r-- | mysys/hash.c | 2 | ||||
-rw-r--r-- | mysys/mf_iocache2.c | 4 | ||||
-rw-r--r-- | mysys/mf_loadpath.c | 8 | ||||
-rw-r--r-- | mysys/mf_path.c | 6 | ||||
-rw-r--r-- | mysys/my_append.c | 4 | ||||
-rw-r--r-- | mysys/my_clock.c | 2 | ||||
-rw-r--r-- | mysys/my_copy.c | 8 | ||||
-rw-r--r-- | mysys/my_fstream.c | 4 | ||||
-rw-r--r-- | mysys/my_getwd.c | 2 | ||||
-rw-r--r-- | mysys/my_lib.c | 22 | ||||
-rw-r--r-- | mysys/my_lockmem.c | 4 | ||||
-rw-r--r-- | mysys/my_pthread.c | 5 | ||||
-rw-r--r-- | mysys/my_redel.c | 6 | ||||
-rw-r--r-- | mysys/stacktrace.c | 3 | ||||
-rw-r--r-- | mysys/thr_alarm.c | 16 | ||||
-rw-r--r-- | mysys/thr_lock.c | 18 |
17 files changed, 57 insertions, 59 deletions
diff --git a/mysys/errors.c b/mysys/errors.c index 4000c5c4e52..37d33374fe1 100644 --- a/mysys/errors.c +++ b/mysys/errors.c @@ -104,7 +104,7 @@ void wait_for_free_space(const char *filename, int errors) MYF(ME_BELL | ME_NOREFRESH), MY_WAIT_FOR_USER_TO_FIX_PANIC, MY_WAIT_GIVE_USER_A_MESSAGE * MY_WAIT_FOR_USER_TO_FIX_PANIC ); - VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC)); + (void) sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC); } const char **get_global_errmsgs() diff --git a/mysys/hash.c b/mysys/hash.c index 9c1957bf0aa..6996b045d1c 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -541,7 +541,7 @@ my_bool my_hash_delete(HASH *hash, uchar *record) pos->next=empty_index; exit: - VOID(pop_dynamic(&hash->array)); + (void) pop_dynamic(&hash->array); if (hash->free) (*hash->free)((uchar*) record); DBUG_RETURN(0); diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index c54c7d13548..705a3fc46ec 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -135,7 +135,7 @@ void my_b_seek(IO_CACHE *info,my_off_t pos) b) see if there is a better way to make it work */ if (info->type == SEQ_READ_APPEND) - VOID(flush_io_cache(info)); + (void) flush_io_cache(info); offset=(pos - info->pos_in_file); @@ -163,7 +163,7 @@ void my_b_seek(IO_CACHE *info,my_off_t pos) info->write_pos = info->write_buffer + offset; DBUG_VOID_RETURN; } - VOID(flush_io_cache(info)); + (void) flush_io_cache(info); /* Correct buffer end so that we write in increments of IO_SIZE */ info->write_end=(info->write_buffer+info->buffer_length- (pos & (IO_SIZE-1))); diff --git a/mysys/mf_loadpath.c b/mysys/mf_loadpath.c index 48a69207839..fbf6f7f5d57 100644 --- a/mysys/mf_loadpath.c +++ b/mysys/mf_loadpath.c @@ -34,7 +34,7 @@ char * my_load_path(char * to, const char *path, if ((path[0] == FN_HOMELIB && path[1] == FN_LIBCHAR) || test_if_hard_path(path)) - VOID(strmov(buff,path)); + (void) strmov(buff,path); else if ((is_cur=(path[0] == FN_CURLIB && path[1] == FN_LIBCHAR)) || (is_prefix(path,FN_PARENTDIR)) || ! own_path_prefix) @@ -42,12 +42,12 @@ char * my_load_path(char * to, const char *path, if (is_cur) is_cur=2; /* Remove current dir */ if (! my_getwd(buff,(uint) (FN_REFLEN-strlen(path)+is_cur),MYF(0))) - VOID(strcat(buff,path+is_cur)); + (void) strcat(buff,path+is_cur); else - VOID(strmov(buff,path)); /* Return org file name */ + (void) strmov(buff,path); /* Return org file name */ } else - VOID(strxmov(buff,own_path_prefix,path,NullS)); + (void) strxmov(buff,own_path_prefix,path,NullS); strmov(to,buff); DBUG_PRINT("exit",("to: %s",to)); DBUG_RETURN(to); diff --git a/mysys/mf_path.c b/mysys/mf_path.c index 73e73cb7f76..d51cac732f5 100644 --- a/mysys/mf_path.c +++ b/mysys/mf_path.c @@ -42,7 +42,7 @@ char * my_path(char * to, const char *progname, ((prog=getenv("_")) != 0 && dirname_part(to, prog, &to_length)))) { - VOID(intern_filename(to,to)); + (void) intern_filename(to,to); if (!test_if_hard_path(to)) { if (!my_getwd(curr_dir,FN_REFLEN,MYF(0))) @@ -60,11 +60,11 @@ char * my_path(char * to, const char *progname, end= (char*) "/my/"; #endif } - VOID(intern_filename(to,end)); + (void) intern_filename(to,end); to=strend(to); if (to != start && to[-1] != FN_LIBCHAR) *to++ = FN_LIBCHAR; - VOID(strmov(to,own_pathname_part)); + (void) strmov(to,own_pathname_part); } DBUG_PRINT("exit",("to: '%s'",start)); DBUG_RETURN(start); diff --git a/mysys/my_append.c b/mysys/my_append.c index d8789f95d95..1ef3905b6f5 100644 --- a/mysys/my_append.c +++ b/mysys/my_append.c @@ -58,7 +58,7 @@ int my_append(const char *from, const char *to, myf MyFlags) } } err: - if (from_file >= 0) VOID(my_close(from_file,MyFlags)); - if (to_file >= 0) VOID(my_close(to_file,MyFlags)); + if (from_file >= 0) (void) my_close(from_file,MyFlags); + if (to_file >= 0) (void) my_close(to_file,MyFlags); DBUG_RETURN(-1); } diff --git a/mysys/my_clock.c b/mysys/my_clock.c index adc755028d5..d17f26ed316 100644 --- a/mysys/my_clock.c +++ b/mysys/my_clock.c @@ -24,7 +24,7 @@ long my_clock(void) { #if !defined(__WIN__) && !defined(__NETWARE__) struct tms tmsbuf; - VOID(times(&tmsbuf)); + (void) times(&tmsbuf); return (tmsbuf.tms_utime + tmsbuf.tms_stime); #else return clock(); diff --git a/mysys/my_copy.c b/mysys/my_copy.c index 418e2b6f8a2..d38507c111a 100644 --- a/mysys/my_copy.c +++ b/mysys/my_copy.c @@ -112,19 +112,19 @@ int my_copy(const char *from, const char *to, myf MyFlags) struct utimbuf timep; timep.actime = stat_buff.st_atime; timep.modtime = stat_buff.st_mtime; - VOID(utime((char*) to, &timep)); /* last accessed and modified times */ + (void) utime((char*) to, &timep); /* last accessed and modified times */ } #endif DBUG_RETURN(0); } err: - if (from_file >= 0) VOID(my_close(from_file,MyFlags)); + if (from_file >= 0) (void) my_close(from_file,MyFlags); if (to_file >= 0) { - VOID(my_close(to_file, MyFlags)); + (void) my_close(to_file, MyFlags); /* attempt to delete the to-file we've partially written */ - VOID(my_delete(to, MyFlags)); + (void) my_delete(to, MyFlags); } DBUG_RETURN(-1); } /* my_copy */ diff --git a/mysys/my_fstream.c b/mysys/my_fstream.c index 2059e1a9f18..0c7e4ef7aa3 100644 --- a/mysys/my_fstream.c +++ b/mysys/my_fstream.c @@ -119,7 +119,7 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags) #ifdef EINTR if (errno == EINTR) { - VOID(my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0))); + (void) my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0)); continue; } #endif @@ -133,7 +133,7 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags) { wait_for_free_space("[stream]", errors); errors++; - VOID(my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0))); + (void) my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0)); continue; } #endif diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c index e0c5b94b53e..6ef8d571492 100644 --- a/mysys/my_getwd.c +++ b/mysys/my_getwd.c @@ -51,7 +51,7 @@ int my_getwd(char * buf, size_t size, myf MyFlags) (long) buf, (uint) size, MyFlags)); if (curr_dir[0]) /* Current pos is saved here */ - VOID(strmake(buf,&curr_dir[0],size-1)); + (void) strmake(buf,&curr_dir[0],size-1); else { #if defined(HAVE_GETCWD) diff --git a/mysys/my_lib.c b/mysys/my_lib.c index 033f8789b49..dcc1263f383 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -159,8 +159,8 @@ MY_DIR *my_dir(const char *path, myf MyFlags) goto error; bzero(finfo.mystat, sizeof(MY_STAT)); - VOID(strmov(tmp_file,dp->d_name)); - VOID(my_stat(tmp_path, finfo.mystat, MyFlags)); + (void) strmov(tmp_file,dp->d_name); + (void) my_stat(tmp_path, finfo.mystat, MyFlags); if (!(finfo.mystat->st_mode & MY_S_IREAD)) continue; } @@ -266,7 +266,7 @@ char * directory_file_name (char * dst, const char *src) /* what about when we have logical_name:???? */ if (src[slen] == FN_DEVCHAR) { /* Xlate logical name and see what we get */ - VOID(strmov(dst,src)); + (void) strmov(dst,src); dst[slen] = 0; /* remove colon */ if (!(src = getenv (dst))) return dst; /* Can't translate */ @@ -282,13 +282,13 @@ char * directory_file_name (char * dst, const char *src) slen = strlen (src) - 1; if (src[slen] != FN_C_AFTER_DIR && src[slen] != FN_C_AFTER_DIR_2) { /* no recursion here! */ - VOID(strmov(dst, src)); + (void) strmov(dst, src); return(dst); } } else { /* not a directory spec */ - VOID(strmov(dst, src)); + (void) strmov(dst, src); return(dst); } } @@ -296,13 +296,13 @@ char * directory_file_name (char * dst, const char *src) bracket = src[slen]; /* End char */ if (!(ptr = strchr (src, bracket - 2))) { /* no opening bracket */ - VOID(strmov (dst, src)); + (void) strmov (dst, src); return dst; } if (!(rptr = strrchr (src, '.'))) rptr = ptr; slen = rptr - src; - VOID(strmake (dst, src, slen)); + (void) strmake (dst, src, slen); if (*rptr == '.') { /* Put bracket and add */ @@ -323,7 +323,7 @@ char * directory_file_name (char * dst, const char *src) && (ptr[rlen] == FN_C_AFTER_DIR || ptr[rlen] == FN_C_AFTER_DIR_2) && ptr[rlen - 1] == '.') { - VOID(strmov(esa,ptr)); + (void) strmov(esa,ptr); esa[rlen - 1] = FN_C_AFTER_DIR; esa[rlen] = '\0'; return (directory_file_name (dst, esa)); @@ -331,13 +331,13 @@ char * directory_file_name (char * dst, const char *src) else dst[slen - 1] = ':'; } - VOID(strmov(dst+slen,"[000000]")); + (void) strmov(dst+slen,"[000000]"); slen += 8; } - VOID(strmov(strmov(dst+slen,rptr+1)-1,".DIR.1")); + (void) strmov(strmov(dst+slen,rptr+1)-1,".DIR.1"); return dst; } - VOID(strmov(dst, src)); + (void) strmov(dst, src); if (dst[slen] == '/' && slen > 1) dst[slen] = 0; return dst; diff --git a/mysys/my_lockmem.c b/mysys/my_lockmem.c index b96331cd3cf..f2c6d52a382 100644 --- a/mysys/my_lockmem.c +++ b/mysys/my_lockmem.c @@ -59,7 +59,7 @@ uchar *my_malloc_lock(uint size,myf MyFlags) /* Add block in a list for munlock */ if (!(element=(struct st_mem_list*) my_malloc(sizeof(*element),MyFlags))) { - VOID(munlock((uchar*) ptr,size)); + (void) munlock((uchar*) ptr,size); free(ptr); DBUG_RETURN(0); } @@ -85,7 +85,7 @@ void my_free_lock(uchar *ptr,myf Myflags __attribute__((unused))) element=(struct st_mem_list*) list->data; if (ptr == element->page) { /* Found locked mem */ - VOID(munlock((uchar*) ptr,element->size)); + (void) munlock((uchar*) ptr,element->size); mem_list=list_delete(mem_list,list); break; } diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index ee839e5567e..fd1798ab203 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -30,6 +30,7 @@ #endif uint thd_lib_detected= 0; + /* To allow use of pthread_getspecific with two arguments */ #ifdef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC @@ -267,7 +268,7 @@ void sigwait_handle_sig(int sig) { pthread_mutex_lock(&LOCK_sigwait); sigaddset(&pending_set, sig); - VOID(pthread_cond_signal(&COND_sigwait)); /* inform sigwait() about signal */ + pthread_cond_signal(&COND_sigwait); /* inform sigwait() about signal */ pthread_mutex_unlock(&LOCK_sigwait); } @@ -350,7 +351,7 @@ int sigwait(sigset_t *setp, int *sigp) return 0; } } - VOID(pthread_cond_wait(&COND_sigwait,&LOCK_sigwait)); + pthread_cond_wait(&COND_sigwait,&LOCK_sigwait); } return 0; } diff --git a/mysys/my_redel.c b/mysys/my_redel.c index 6521253f949..77040870048 100644 --- a/mysys/my_redel.c +++ b/mysys/my_redel.c @@ -89,7 +89,7 @@ int my_copystat(const char *from, const char *to, int MyFlags) } if ((statbuf.st_mode & S_IFMT) != S_IFREG) return 1; - VOID(chmod(to, statbuf.st_mode & 07777)); /* Copy modes */ + (void) chmod(to, statbuf.st_mode & 07777); /* Copy modes */ #if !defined(__WIN__) && !defined(__NETWARE__) if (statbuf.st_nlink > 1 && MyFlags & MY_LINK_WARNING) @@ -107,7 +107,7 @@ int my_copystat(const char *from, const char *to, int MyFlags) struct utimbuf timep; timep.actime = statbuf.st_atime; timep.modtime = statbuf.st_mtime; - VOID(utime((char*) to, &timep));/* Update last accessed and modified times */ + (void) utime((char*) to, &timep);/* Update last accessed and modified times */ } #else if (MyFlags & MY_COPYTIME) @@ -115,7 +115,7 @@ int my_copystat(const char *from, const char *to, int MyFlags) time_t time[2]; time[0]= statbuf.st_atime; time[1]= statbuf.st_mtime; - VOID(utime((char*) to, time));/* Update last accessed and modified times */ + (void) utime((char*) to, time);/* Update last accessed and modified times */ } #endif #endif diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 66a361b5421..0b9e6eefcce 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -13,9 +13,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Workaround for Bug#32082: VOID redefinition on Win results in compile errors*/ -#define DONT_DEFINE_VOID 1 - #include <my_global.h> #include <my_stacktrace.h> diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index ead598c025a..9ab862fa755 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -772,7 +772,7 @@ static void *test_thread(void *arg) break; continue; } - VOID(getchar()); /* Somebody was playing */ + (void) getchar(); /* Somebody was playing */ } } } @@ -784,7 +784,7 @@ static void *test_thread(void *arg) } pthread_mutex_lock(&LOCK_thread_count); thread_count--; - VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */ + pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */ pthread_mutex_unlock(&LOCK_thread_count); free((uchar*) arg); return 0; @@ -813,7 +813,7 @@ static void *signal_hand(void *arg __attribute__((unused))) pthread_detach_this_thread(); init_thr_alarm(10); /* Setup alarm handler */ pthread_mutex_lock(&LOCK_thread_count); /* Required by bsdi */ - VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */ + pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */ pthread_mutex_unlock(&LOCK_thread_count); sigemptyset(&set); /* Catch all signals */ @@ -904,7 +904,7 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) #ifdef NOT_USED sigemptyset(&set); sigaddset(&set, thr_client_alarm); - VOID(pthread_sigmask(SIG_UNBLOCK, &set, (sigset_t*) 0)); + pthread_sigmask(SIG_UNBLOCK, &set, (sigset_t*) 0); #endif pthread_attr_init(&thr_attr); @@ -913,10 +913,10 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) pthread_attr_setstacksize(&thr_attr,65536L); /* Start signal thread and wait for it to start */ - VOID(pthread_mutex_lock(&LOCK_thread_count)); + pthread_mutex_lock(&LOCK_thread_count); pthread_create(&tid,&thr_attr,signal_hand,NULL); - VOID(pthread_cond_wait(&COND_thread_count,&LOCK_thread_count)); - VOID(pthread_mutex_unlock(&LOCK_thread_count)); + pthread_cond_wait(&COND_thread_count,&LOCK_thread_count); + pthread_mutex_unlock(&LOCK_thread_count); DBUG_PRINT("info",("signal thread created")); thr_setconcurrency(3); @@ -944,7 +944,7 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) alarm_info.next_alarm_time); while (thread_count) { - VOID(pthread_cond_wait(&COND_thread_count,&LOCK_thread_count)); + pthread_cond_wait(&COND_thread_count,&LOCK_thread_count); if (thread_count == 1) { printf("Calling end_thr_alarm. This should cancel the last thread\n"); diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 4bb818b1b30..1d724de641c 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -316,7 +316,7 @@ void thr_lock_init(THR_LOCK *lock) { DBUG_ENTER("thr_lock_init"); bzero((char*) lock,sizeof(*lock)); - VOID(pthread_mutex_init(&lock->mutex,MY_MUTEX_INIT_FAST)); + pthread_mutex_init(&lock->mutex,MY_MUTEX_INIT_FAST); lock->read.last= &lock->read.data; lock->read_wait.last= &lock->read_wait.data; lock->write_wait.last= &lock->write_wait.data; @@ -522,7 +522,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner, data->cond=0; /* safety */ data->type=lock_type; data->owner= owner; /* Must be reset ! */ - VOID(pthread_mutex_lock(&lock->mutex)); + pthread_mutex_lock(&lock->mutex); DBUG_PRINT("lock",("data: 0x%lx thread: 0x%lx lock: 0x%lx type: %d", (long) data, data->owner->info->thread_id, (long) lock, (int) lock_type)); @@ -794,7 +794,7 @@ static inline void free_all_read_locks(THR_LOCK *lock, data->owner->info->thread_id)); /* purecov: end */ data->cond=0; /* Mark thread free */ - VOID(pthread_cond_signal(cond)); + pthread_cond_signal(cond); } while ((data=data->next)); *lock->read_wait.last=0; if (!lock->read_wait.data) @@ -904,7 +904,7 @@ static void wake_up_waiters(THR_LOCK *lock) { pthread_cond_t *cond=data->cond; data->cond=0; /* Mark thread free */ - VOID(pthread_cond_signal(cond)); /* Start waiting thread */ + pthread_cond_signal(cond); /* Start waiting thread */ } if (data->type != TL_WRITE_ALLOW_WRITE || !lock->write_wait.data || @@ -955,7 +955,7 @@ static void wake_up_waiters(THR_LOCK *lock) lock->write.last= &data->next; data->next=0; /* Only one write lock */ data->cond=0; /* Mark thread free */ - VOID(pthread_cond_signal(cond)); /* Start waiting thread */ + pthread_cond_signal(cond); /* Start waiting thread */ } while (lock_type == TL_WRITE_ALLOW_WRITE && (data=lock->write_wait.data) && data->type == TL_WRITE_ALLOW_WRITE); @@ -1526,7 +1526,7 @@ void thr_print_locks(void) list= list_rest(list)) { THR_LOCK *lock=(THR_LOCK*) list->data; - VOID(pthread_mutex_lock(&lock->mutex)); + pthread_mutex_lock(&lock->mutex); printf("lock: 0x%lx:",(ulong) lock); if ((lock->write_wait.data || lock->read_wait.data) && (! lock->read.data && ! lock->write.data)) @@ -1544,7 +1544,7 @@ void thr_print_locks(void) thr_print_lock("write_wait",&lock->write_wait); thr_print_lock("read",&lock->read); thr_print_lock("read_wait",&lock->read_wait); - VOID(pthread_mutex_unlock(&lock->mutex)); + pthread_mutex_unlock(&lock->mutex); puts(""); } fflush(stdout); @@ -1684,7 +1684,7 @@ static void *test_thread(void *arg) thr_print_locks(); pthread_mutex_lock(&LOCK_thread_count); thread_count--; - VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */ + pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */ pthread_mutex_unlock(&LOCK_thread_count); free((uchar*) arg); return 0; @@ -1745,7 +1745,7 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) } #endif #ifdef HAVE_THR_SETCONCURRENCY - VOID(thr_setconcurrency(2)); + (void) thr_setconcurrency(2); #endif for (i=0 ; i < (int) array_elements(lock_counts) ; i++) { |