Skip to content

Commit 4cff617

Browse files
author
Konstantin Osipov
committed
Backport of:
---------------------------------------------------------------------- [email protected], 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.
1 parent 26cd9ab commit 4cff617

File tree

117 files changed

+835
-845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+835
-845
lines changed

client/mysqladmin.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ int main(int argc,char *argv[])
325325
if (tty_password)
326326
opt_password = get_tty_password(NullS);
327327

328-
VOID(signal(SIGINT,endprog)); /* Here if abort */
329-
VOID(signal(SIGTERM,endprog)); /* Here if abort */
328+
(void) signal(SIGINT,endprog); /* Here if abort */
329+
(void) signal(SIGTERM,endprog); /* Here if abort */
330330

331331
if (opt_compress)
332332
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);

client/mysqldump.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,7 @@ static uint dump_events_for_db(char *db)
20012001
mysql_free_result(event_list_res);
20022002

20032003
if (lock_tables)
2004-
VOID(mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES"));
2004+
(void) mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES");
20052005
DBUG_RETURN(0);
20062006
}
20072007

@@ -2204,7 +2204,7 @@ static uint dump_routines_for_db(char *db)
22042204
DBUG_RETURN(1);
22052205

22062206
if (lock_tables)
2207-
VOID(mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES"));
2207+
(void) mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES");
22082208
DBUG_RETURN(0);
22092209
}
22102210

@@ -4086,7 +4086,7 @@ static int dump_all_tables_in_db(char *database)
40864086
check_io(md_result_file);
40874087
}
40884088
if (lock_tables)
4089-
VOID(mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES"));
4089+
(void) mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES");
40904090
if (flush_privileges && using_mysql_db == 0)
40914091
{
40924092
fprintf(md_result_file,"\n--\n-- Flush Grant Tables \n--\n");
@@ -4160,7 +4160,7 @@ static my_bool dump_all_views_in_db(char *database)
41604160
check_io(md_result_file);
41614161
}
41624162
if (lock_tables)
4163-
VOID(mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES"));
4163+
(void) mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES");
41644164
return 0;
41654165
} /* dump_all_tables_in_db */
41664166

@@ -4332,7 +4332,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
43324332
check_io(md_result_file);
43334333
}
43344334
if (lock_tables)
4335-
VOID(mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES"));
4335+
(void) mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES");
43364336
DBUG_RETURN(0);
43374337
} /* dump_selected_tables */
43384338

client/mysqlimport.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,8 @@ int main(int argc, char **argv)
610610
pthread_attr_setdetachstate(&attr,
611611
PTHREAD_CREATE_DETACHED);
612612

613-
VOID(pthread_mutex_init(&counter_mutex, NULL));
614-
VOID(pthread_cond_init(&count_threshhold, NULL));
613+
pthread_mutex_init(&counter_mutex, NULL);
614+
pthread_cond_init(&count_threshhold, NULL);
615615

616616
for (counter= 0; *argv != NULL; argv++) /* Loop through tables */
617617
{
@@ -650,8 +650,8 @@ int main(int argc, char **argv)
650650
pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime);
651651
}
652652
pthread_mutex_unlock(&counter_mutex);
653-
VOID(pthread_mutex_destroy(&counter_mutex));
654-
VOID(pthread_cond_destroy(&count_threshhold));
653+
pthread_mutex_destroy(&counter_mutex);
654+
pthread_cond_destroy(&count_threshhold);
655655
pthread_attr_destroy(&attr);
656656
}
657657
else

client/mysqlslap.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,10 @@ int main(int argc, char **argv)
352352
}
353353
}
354354

355-
VOID(pthread_mutex_init(&counter_mutex, NULL));
356-
VOID(pthread_cond_init(&count_threshhold, NULL));
357-
VOID(pthread_mutex_init(&sleeper_mutex, NULL));
358-
VOID(pthread_cond_init(&sleep_threshhold, NULL));
355+
pthread_mutex_init(&counter_mutex, NULL);
356+
pthread_cond_init(&count_threshhold, NULL);
357+
pthread_mutex_init(&sleeper_mutex, NULL);
358+
pthread_cond_init(&sleep_threshhold, NULL);
359359

360360
/* Main iterations loop */
361361
eptr= engine_options;
@@ -386,10 +386,10 @@ int main(int argc, char **argv)
386386

387387
} while (eptr ? (eptr= eptr->next) : 0);
388388

389-
VOID(pthread_mutex_destroy(&counter_mutex));
390-
VOID(pthread_cond_destroy(&count_threshhold));
391-
VOID(pthread_mutex_destroy(&sleeper_mutex));
392-
VOID(pthread_cond_destroy(&sleep_threshhold));
389+
pthread_mutex_destroy(&counter_mutex);
390+
pthread_cond_destroy(&count_threshhold);
391+
pthread_mutex_destroy(&sleeper_mutex);
392+
pthread_cond_destroy(&sleep_threshhold);
393393

394394
if (!opt_only_print)
395395
mysql_close(&mysql); /* Close & free connection */

client/mysqltest.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -696,12 +696,12 @@ pthread_handler_t send_one_query(void *arg)
696696
struct st_connection *cn= (struct st_connection*)arg;
697697

698698
mysql_thread_init();
699-
VOID(mysql_send_query(&cn->mysql, cn->cur_query, cn->cur_query_len));
699+
(void) mysql_send_query(&cn->mysql, cn->cur_query, cn->cur_query_len);
700700

701701
mysql_thread_end();
702702
pthread_mutex_lock(&cn->mutex);
703703
cn->query_done= 1;
704-
VOID(pthread_cond_signal(&cn->cond));
704+
pthread_cond_signal(&cn->cond);
705705
pthread_mutex_unlock(&cn->mutex);
706706
pthread_exit(0);
707707
return 0;
@@ -9063,7 +9063,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
90639063
free_sets(&sets);
90649064
DBUG_RETURN(0);
90659065
}
9066-
VOID(make_new_set(&sets)); /* Set starting set */
9066+
(void) make_new_set(&sets); /* Set starting set */
90679067
make_sets_invisible(&sets); /* Hide previus sets */
90689068
used_sets=-1;
90699069
word_states=make_new_set(&sets); /* Start of new word */
@@ -9534,7 +9534,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
95349534
pa->flag[pa->typelib.count]=0; /* Reset flag */
95359535
pa->typelib.type_names[pa->typelib.count++]= (char*) pa->str+pa->length;
95369536
pa->typelib.type_names[pa->typelib.count]= NullS; /* Put end-mark */
9537-
VOID(strmov((char*) pa->str+pa->length,name));
9537+
(void) strmov((char*) pa->str+pa->length,name);
95389538
pa->length+=length;
95399539
DBUG_RETURN(0);
95409540
} /* insert_pointer_name */

client/sql_string.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ bool String::set(double num,uint decimals, CHARSET_INFO *cs)
130130
int decpt,sign;
131131
char *pos,*to;
132132

133-
VOID(fconvert(num,(int) decimals,&decpt,&sign,buff+1));
133+
(void) fconvert(num,(int) decimals,&decpt,&sign,buff+1);
134134
if (!my_isdigit(&my_charset_latin1, buff[1]))
135135
{ // Nan or Inf
136136
pos=buff+1;

extra/comp_err.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,11 +1039,11 @@ static char *parse_text_line(char *pos)
10391039
switch (*++pos) {
10401040
case '\\':
10411041
case '"':
1042-
VOID(strmov(pos - 1, pos));
1042+
(void) strmov(pos - 1, pos);
10431043
break;
10441044
case 'n':
10451045
pos[-1]= '\n';
1046-
VOID(strmov(pos, pos + 1));
1046+
(void) strmov(pos, pos + 1);
10471047
break;
10481048
default:
10491049
if (*pos >= '0' && *pos < '8')
@@ -1053,10 +1053,10 @@ static char *parse_text_line(char *pos)
10531053
nr= nr * 8 + (*(pos++) - '0');
10541054
pos -= i;
10551055
pos[-1]= nr;
1056-
VOID(strmov(pos, pos + i));
1056+
(void) strmov(pos, pos + i);
10571057
}
10581058
else if (*pos)
1059-
VOID(strmov(pos - 1, pos)); /* Remove '\' */
1059+
(void) strmov(pos - 1, pos); /* Remove '\' */
10601060
}
10611061
}
10621062
else

extra/replace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
311311
pa->flag[pa->typelib.count]=0; /* Reset flag */
312312
pa->typelib.type_names[pa->typelib.count++]= (char*) (pa->str+pa->length);
313313
pa->typelib.type_names[pa->typelib.count]= NullS; /* Put end-mark */
314-
VOID(strmov((char*) pa->str + pa->length, name));
314+
(void) strmov((char*) pa->str + pa->length, name);
315315
pa->length+=length;
316316
DBUG_RETURN(0);
317317
} /* insert_pointer_name */
@@ -433,7 +433,7 @@ static REPLACE *init_replace(char * *from, char * *to,uint count,
433433
free_sets(&sets);
434434
DBUG_RETURN(0);
435435
}
436-
VOID(make_new_set(&sets)); /* Set starting set */
436+
(void) make_new_set(&sets); /* Set starting set */
437437
make_sets_invisible(&sets); /* Hide previus sets */
438438
used_sets=-1;
439439
word_states=make_new_set(&sets); /* Start of new word */

include/my_alarm.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ extern ulong my_time_to_wait_for_lock;
3333
#define ALARM_INIT my_have_got_alarm=0 ; \
3434
alarm_old=(uint) alarm(MY_HOW_OFTEN_TO_ALARM); \
3535
alarm_signal=signal(SIGALRM,my_set_alarm_variable);
36-
#define ALARM_END VOID(signal(SIGALRM,alarm_signal)); \
37-
VOID(alarm(alarm_old));
36+
#define ALARM_END (void) signal(SIGALRM,alarm_signal); \
37+
(void) alarm(alarm_old);
3838
#define ALARM_TEST my_have_got_alarm
3939
#ifdef DONT_REMEMBER_SIGNAL
40-
#define ALARM_REINIT VOID(alarm(MY_HOW_OFTEN_TO_ALARM)); \
41-
VOID(signal(SIGALRM,my_set_alarm_variable));\
40+
#define ALARM_REINIT (void) alarm(MY_HOW_OFTEN_TO_ALARM); \
41+
(void) signal(SIGALRM,my_set_alarm_variable);\
4242
my_have_got_alarm=0;
4343
#else
44-
#define ALARM_REINIT VOID(alarm((uint) MY_HOW_OFTEN_TO_ALARM)); \
44+
#define ALARM_REINIT (void) alarm((uint) MY_HOW_OFTEN_TO_ALARM); \
4545
my_have_got_alarm=0;
4646
#endif /* DONT_REMEMBER_SIGNAL */
4747
#else

include/my_global.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -542,17 +542,6 @@ extern "C" int madvise(void *addr, size_t len, int behav);
542542
#define DONT_REMEMBER_SIGNAL
543543
#endif
544544

545-
/* Define void to stop lint from generating "null effekt" comments */
546-
#ifndef DONT_DEFINE_VOID
547-
#ifdef _lint
548-
int __void__;
549-
#define VOID(X) (__void__ = (int) (X))
550-
#else
551-
#undef VOID
552-
#define VOID(X) (X)
553-
#endif
554-
#endif /* DONT_DEFINE_VOID */
555-
556545
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
557546
#define LINT_INIT(var) var=0 /* No uninitialize-warning */
558547
#else

0 commit comments

Comments
 (0)