summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-02-28 02:40:15 +0100
committerHaru <haru@dotalux.com>2016-04-30 15:57:47 +0200
commit2788afc3dd5d825246f13189b14353b0f069e7e3 (patch)
treee73a69c076055e3f073ad2e2d48c2149376ff04d /tools
parent4e49441c6520b024ed5303064c38d619644df08c (diff)
downloadhercules-2788afc3dd5d825246f13189b14353b0f069e7e3.tar.gz
hercules-2788afc3dd5d825246f13189b14353b0f069e7e3.tar.bz2
hercules-2788afc3dd5d825246f13189b14353b0f069e7e3.tar.xz
hercules-2788afc3dd5d825246f13189b14353b0f069e7e3.zip
Replaced memset with braced initializers in the HPMHooking hook handlers
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/HPMHookGen/HPMHookGen.pl6
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/HPMHookGen/HPMHookGen.pl b/tools/HPMHookGen/HPMHookGen.pl
index 4dedb48c2..201a82bf8 100755
--- a/tools/HPMHookGen/HPMHookGen.pl
+++ b/tools/HPMHookGen/HPMHookGen.pl
@@ -208,7 +208,6 @@ sub parse($$) {
$lastvar = $var;
}
- my $rtmemset = 0;
my $rtinit = '';
foreach ($rt) { # Decide initialization for the return value
my $x = $_;
@@ -244,8 +243,7 @@ sub parse($$) {
} elsif ($x eq 'DBComparator' or $x eq 'DBHasher' or $x eq 'DBReleaser') { # DB function pointers
$rtinit = ' = NULL';
} elsif ($x =~ /^(?:struct|union)\s+.*$/) { # Structs and unions
- $rtinit = '';
- $rtmemset = 1;
+ $rtinit = ' = { 0 }';
} elsif ($x =~ /^float|double$/) { # Floating point variables
$rtinit = ' = 0.';
} elsif ($x =~ /^(?:(?:un)?signed\s+)?(?:char|int|long|short)$/
@@ -267,7 +265,6 @@ sub parse($$) {
vname => $variadic ? "v$name" : $name,
type => $rt,
typeinit => $rtinit,
- memset => $rtmemset,
variadic => $variadic,
args => \@args,
notes => $notes,
@@ -687,7 +684,6 @@ EOF
unless ($if->{type} eq 'void') {
$initialization = "\n\t$if->{type} retVal___$if->{typeinit};";
- $initialization .= "\n\tmemset(&retVal___, '\\0', sizeof($if->{type}));" if $if->{memset};
}
$beforeblock3 .= "\n\t\t\t$_" foreach (@{ $if->{before} });