From 61fc83fd7dd51e9a88ac7e6264692fcf561a37f7 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 15 Nov 2014 04:00:54 +0100 Subject: Corrected an issue in the HPMHookGen when interfaces only have one member - Fixed hooks/symbols generation for the inter_quest interface - Re-enabled strict mode Signed-off-by: Haru --- tools/HPMHookGen/HPMDataCheckGen.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tools/HPMHookGen/HPMDataCheckGen.pl') diff --git a/tools/HPMHookGen/HPMDataCheckGen.pl b/tools/HPMHookGen/HPMDataCheckGen.pl index f950152d1..01728341d 100644 --- a/tools/HPMHookGen/HPMDataCheckGen.pl +++ b/tools/HPMHookGen/HPMDataCheckGen.pl @@ -20,17 +20,18 @@ my %out; foreach my $file (@files) { my $xml = new XML::Simple; - my $data = $xml->XMLin($file); - next unless $data->{compounddef}->{includes}; # means its a struct from a .c file, plugins cant access those so we don't care. - next if $data->{compounddef}->{compoundname} =~ /::/; # its a duplicate with a :: name e.g. struct script_state {<...>} ay; - my @filepath = split(/[\/\\]/, $data->{compounddef}->{location}->{file}); + my $data = $xml->XMLin($file, ForceArray => 1); + my $filekey = (keys $data->{compounddef})[0]; + next unless $data->{compounddef}->{$filekey}->{includes}; # means its a struct from a .c file, plugins cant access those so we don't care. + next if $data->{compounddef}->{$filekey}->{compoundname}->[0] =~ /::/; # its a duplicate with a :: name e.g. struct script_state {<...>} ay; + my @filepath = split(/[\/\\]/, $data->{compounddef}->{$filekey}->{location}->[0]->{file}); my $foldername = uc($filepath[-2]); my $filename = uc($filepath[-1]); $filename =~ s/-/_/g; $filename =~ s/\.[^.]*$//; my $plugintypes = 'SERVER_TYPE_UNKNOWN'; $plugintypes = 'SERVER_TYPE_ALL' if $foldername eq 'COMMON'; $plugintypes = "SERVER_TYPE_${foldername}" if $foldername =~ /^(LOGIN|CHAR|MAP)/; my $symboldata = { - name => $data->{compounddef}->{compoundname}, + name => $data->{compounddef}->{$filekey}->{compoundname}->[0], type => $plugintypes, }; my $name = "${foldername}_${filename}_H"; -- cgit v1.2.3-60-g2f50