Module: wine Branch: master Commit: ba517e57d2b9d6f2593e3f25684b0af421fb0a6b URL: http://source.winehq.org/git/wine.git/?a=commit;h=ba517e57d2b9d6f2593e3f2568...
Author: Francois Gouget fgouget@free.fr Date: Tue Feb 20 15:49:17 2007 +0100
winapi: Remove useless 'if (0)' statements.
---
tools/winapi/c_parser.pm | 28 +++++++--------------------- tools/winapi/make_parser.pm | 12 +++--------- tools/winapi/winapi_fixup_statements.pm | 4 +--- 3 files changed, 11 insertions(+), 33 deletions(-)
diff --git a/tools/winapi/c_parser.pm b/tools/winapi/c_parser.pm index 4d750e9..270334f 100644 --- a/tools/winapi/c_parser.pm +++ b/tools/winapi/c_parser.pm @@ -604,9 +604,7 @@ sub parse_c_declaration($$$$$$$$$$$$) { # Variable my $type;
- if(0) { - # Nothing - } elsif(s/^WINE_(?:DEFAULT|DECLARE)_DEBUG_CHANNEL\s*(\s*(\w+)\s*)\s*//s) { # FIXME: Wine specific kludge + if(s/^WINE_(?:DEFAULT|DECLARE)_DEBUG_CHANNEL\s*(\s*(\w+)\s*)\s*//s) { # FIXME: Wine specific kludge $self->_update_c_position($&, $line, $column); } elsif(s/^__ASM_GLOBAL_FUNC(\s*(\w+)\s*,\s*//s) { # FIXME: Wine specific kludge $self->_update_c_position($&, $line, $column); @@ -995,9 +993,7 @@ sub parse_c_file($$$$) { }
- if (0) { - # Nothing - } elsif($preprocessor =~ /^#\s*if/) { + if($preprocessor =~ /^#\s*if/) { if($preprocessor =~ /^#\s*if\s*0/) { $if0++; } elsif($if0 > 0) { @@ -1193,9 +1189,7 @@ sub parse_c_function($$$$$) { my $begin_line = $line; my $begin_column = $column + 1;
- if(0) { - # Nothing - } elsif($self->_parse_c('__declspec((?:dllexport|dllimport|naked))|INTERNETAPI|RPCRTAPI', $_, $line, $column)) { + if($self->_parse_c('__declspec((?:dllexport|dllimport|naked))|INTERNETAPI|RPCRTAPI', $_, $line, $column)) { # Nothing }
@@ -1215,9 +1209,7 @@ sub parse_c_function($$$$$) { } }
- if(0) { - # Nothing - } elsif($self->_parse_c('DECL_GLOBAL_CONSTRUCTOR', $_, $line, $column, $name)) { # FIXME: Wine specific kludge + if($self->_parse_c('DECL_GLOBAL_CONSTRUCTOR', $_, $line, $column, $name)) { # FIXME: Wine specific kludge # Nothing } elsif($self->_parse_c('WINE_EXCEPTION_FILTER(\w+)', $_, $line, $column, $name)) { # FIXME: Wine specific kludge # Nothing @@ -1259,9 +1251,7 @@ sub parse_c_function($$$$$) { }
- if (0) { - # Nothing - } elsif($self->_parse_c('__attribute__\s*(\s*(\s*(?:constructor|destructor)\s*)\s*)', $_, $line, $column)) { + if($self->_parse_c('__attribute__\s*(\s*(\s*(?:constructor|destructor)\s*)\s*)', $_, $line, $column)) { # Nothing }
@@ -1383,9 +1373,7 @@ sub parse_c_preprocessor($$$$) { return 1; }
- if(0) { - # Nothing - } elsif(/^#\s*define\s*(.*?)$/s) { + if(/^#\s*define\s*(.*?)$/s) { $self->_update_c_position($_, $line, $column); } elsif(/^#\s*else/s) { $self->_update_c_position($_, $line, $column); @@ -1783,9 +1771,7 @@ sub parse_c_type($$$$$) {
$self->_parse_c("(?:const|volatile)", $_, $line, $column);
- if(0) { - # Nothing - } elsif($self->_parse_c('ICOM_VTABLE(.*?)', $_, $line, $column, $type)) { + if($self->_parse_c('ICOM_VTABLE(.*?)', $_, $line, $column, $type)) { # Nothing } elsif($self->_parse_c('(?:enum\s+|interface\s+|struct\s+|union\s+)?(?:(?:MSVCRT|WS)(\s*\w+\s*)|\w+)\s*(*\s*)*', $_, $line, $column, $type)) diff --git a/tools/winapi/make_parser.pm b/tools/winapi/make_parser.pm index 6f7e6a4..885f77a 100644 --- a/tools/winapi/make_parser.pm +++ b/tools/winapi/make_parser.pm @@ -95,9 +95,7 @@ sub make_output($$) { $file = ""; $message = "";
- if(0) { - # Nothing - } elsif(/^*** [(.*?)] Error (\d+)$/) { + if(/^*** [(.*?)] Error (\d+)$/) { # Nothing } elsif(/^*** Error code (\d+)$/) { # Nothing @@ -294,9 +292,7 @@ sub gcc_output($$) { if(s/^warning:\s+//) { my $suppress = 0;
- if(0) { - # Nothing - } elsif(/^((?:signed |unsigned )?(?:int|long)) format, (different type|\S+) arg (arg (\d+))$/) { + if(/^((?:signed |unsigned )?(?:int|long)) format, (different type|\S+) arg (arg (\d+))$/) { my $type = $2; if($type =~ /^(?: HACCEL|HACMDRIVER|HANDLE|HBITMAP|HBRUSH|HCALL|HCURSOR|HDC|HDRVR|HDESK|HDRAWDIB @@ -451,9 +447,7 @@ sub ld_output($$) { $file = shift; local $_ = shift;
- if(0) { - # Nothing - } elsif(/^In function `(.*?)':$/) { + if(/^In function `(.*?)':$/) { $function = $1; } elsif(/^more undefined references to `(.*?)' follow$/) { # Nothing diff --git a/tools/winapi/winapi_fixup_statements.pm b/tools/winapi/winapi_fixup_statements.pm index 1b3c841..df1d811 100644 --- a/tools/winapi/winapi_fixup_statements.pm +++ b/tools/winapi/winapi_fixup_statements.pm @@ -114,9 +114,7 @@ sub fixup_user_message_2_windowsx($$) { $lparam =~ s/^(LPARAM)\s*//;
my @arguments; - if(0) { - # Nothing - } elsif($msg =~ /^WM_COMMAND$/) { + if($msg =~ /^WM_COMMAND$/) { (my $id, my $code_notify) = _parse_makelong($wparam); my $hwndctl = $lparam; @arguments = ($id, $hwndctl, $code_notify);