Commit 465673a3 authored by Rico Schüller's avatar Rico Schüller Committed by Alexandre Julliard

opengl32: Fix some style issues.

parent 3c08b95b
...@@ -210,9 +210,8 @@ sub ConvertType($) ...@@ -210,9 +210,8 @@ sub ConvertType($)
); );
foreach my $org (reverse sort keys %hash) { foreach my $org (reverse sort keys %hash) {
if ($type =~ /$org/) { if ($type =~ /^(.*)$org(.*)$/) {
my ($before, $after) = ($type =~ /^(.*)$org(.*)$/); return "$1$hash{$org}$2";
return "$before$hash{$org}$after";
} }
} }
return $type; return $type;
...@@ -229,9 +228,8 @@ sub ConvertVarName($) ...@@ -229,9 +228,8 @@ sub ConvertVarName($)
"far" => "farParam" ); "far" => "farParam" );
foreach my $org (keys %hash) { foreach my $org (keys %hash) {
if ($type =~ /$org/) { if ($type =~ /^(.*)$org(.*)$/) {
my ($before, $after) = ($type =~ /^(.*)$org(.*)$/); return "$1$hash{$org}$2";
return "$before$hash{$org}$after";
} }
} }
return $type; return $type;
...@@ -255,14 +253,12 @@ sub GenerateThunk($$$$) ...@@ -255,14 +253,12 @@ sub GenerateThunk($$$$)
# If for opengl_norm.c, generate a nice heading otherwise Patrik won't be happy :-) # If for opengl_norm.c, generate a nice heading otherwise Patrik won't be happy :-)
# Patrik says: Well I would be even happier if a (OPENGL32.@) was added as well. Done. :-) # Patrik says: Well I would be even happier if a (OPENGL32.@) was added as well. Done. :-)
if ($comment eq 1) { if ($comment eq 1) {
$ret = "$ret/***********************************************************************\n"; $ret .= "/***********************************************************************\n";
$ret = "$ret * $name (OPENGL32.\@)\n"; $ret .= " * $name (OPENGL32.\@)\n";
$ret = "$ret */\n"; $ret .= " */\n";
} }
$ret = $ret . ConvertType($func_ref->[0]) . " WINAPI $name( "; $ret .= ConvertType($func_ref->[0]) . " WINAPI $name( ";
for (my $i = 0; $i < @{$func_ref->[1]}; $i++) { for (my $i = 0; $i < @{$func_ref->[1]}; $i++) {
## Quick debug code :-)
## print $func_ref->[1]->[$i]->[1] . "\n";
my $type = $func_ref->[1]->[$i]->[0]; my $type = $func_ref->[1]->[$i]->[0];
my $name = ConvertVarName($func_ref->[1]->[$i]->[1]); my $name = ConvertVarName($func_ref->[1]->[$i]->[1]);
$ret .= ConvertType($type) . " $name"; $ret .= ConvertType($type) . " $name";
...@@ -298,14 +294,14 @@ sub GenerateThunk($$$$) ...@@ -298,14 +294,14 @@ sub GenerateThunk($$$$)
$ret .= ") {\n"; $ret .= ") {\n";
$ret .= " const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;\n"; $ret .= " const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;\n";
if ($func_ref->[0] ne "void" && $gen_thread_safe) { if ($func_ref->[0] ne "void" && $gen_thread_safe) {
$ret = "$ret " . ConvertType($func_ref->[0]) . " ret_value;\n"; $ret .= " " . ConvertType($func_ref->[0]) . " ret_value;\n";
} }
if ($gen_traces) { if ($gen_traces) {
$ret = "$ret TRACE(\"($trace_arg)\\n\""; $ret .= " TRACE(\"($trace_arg)\\n\"";
if ($trace_arg ne "") { if ($trace_arg ne "") {
$ret .= ", $trace_call_arg"; $ret .= ", $trace_call_arg";
} }
$ret = "$ret);\n"; $ret .= ");\n";
} }
if ($gen_thread_safe) { if ($gen_thread_safe) {
$ret .= " ENTER_GL();\n"; $ret .= " ENTER_GL();\n";
...@@ -326,7 +322,7 @@ sub GenerateThunk($$$$) ...@@ -326,7 +322,7 @@ sub GenerateThunk($$$$)
} }
$ret .= "funcs->$prefix.p_$name( $call_arg);\n"; $ret .= "funcs->$prefix.p_$name( $call_arg);\n";
} }
$ret = "$ret}\n"; $ret .= "}\n";
# Return this string.... # Return this string....
return $ret; return $ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment