summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Elstner <daniel.kitta@gmail.com>2009-09-11 02:51:35 +0200
committerDaniel Elstner <daniel.kitta@gmail.com>2009-09-11 03:08:27 +0200
commitea3d93146ea1259652fcb3b443279d31b8e1b008 (patch)
tree1f18fa9d83a1d748cad0e570f77b13ae1da38278
parentd7f026e8a9893c5446e1f90fa32962273252106d (diff)
downloadglibmm-ea3d93146ea1259652fcb3b443279d31b8e1b008.tar.gz
Slightly clean up gross Perl code in gmmproc.in
* tools/gmmproc.in: Try not to abuse Perl too much, and get rid of the 'no warnings' hammer.
-rw-r--r--ChangeLog7
-rw-r--r--tools/gmmproc.in51
2 files changed, 29 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index a1310264..d1e0aa2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-11 Daniel Elstner <danielk@openismus.com>
+
+ Slightly clean up gross Perl code in gmmproc.in
+
+ * tools/gmmproc.in: Try not to abuse Perl too much, and get rid of
+ the 'no warnings' hammer.
+
2009-09-10 Daniel Elstner <danielk@openismus.com>
Allow the C documentation to be overridden
diff --git a/tools/gmmproc.in b/tools/gmmproc.in
index d33e25b0..9b735bd6 100644
--- a/tools/gmmproc.in
+++ b/tools/gmmproc.in
@@ -93,61 +93,54 @@ $objOutputter->output_temp_g1($$objWrapParser{module}); # e.g. "gtk"
# Execute m4 to get *.g2 file:
{
my $exitcode = $objOutputter->make_g2_from_g1();
- if ($exitcode != 0)
+ if ($exitcode)
{
- if (!$main::debug)
- {
- $objOutputter->remove_temp_files();
- }
+ $objOutputter->remove_temp_files() unless ($main::debug);
+
print STDERR "m4 failed with exit code $exitcode. Aborting...\n";
- exit ($exitcode);
+ exit($exitcode);
}
}
# Section out the resulting output
$objOutputter->write_sections_to_files();
-
-# Remove temp files.
-if (!$main::debug)
-{
- $objOutputter->remove_temp_files();
-}
+$objOutputter->remove_temp_files() unless ($main::debug);
#Warn about any unwrapped function/signals:
if ($main::unwrapped)
{
my @unwrapped = GtkDefs::get_unwrapped();
+ @unwrapped = grep { exists $$_{entity_type} } @unwrapped;
+
if (@unwrapped)
{
- no warnings;
+ my @methods = grep { $$_{entity_type} eq 'method' and $$_{c_name} !~ m/^_/s } @unwrapped;
+ my @signals = grep { $$_{entity_type} eq 'signal' } @unwrapped;
+ my @properties = grep { $$_{entity_type} eq 'property' } @unwrapped;
- my @methods =
- grep {$$_{entity_type} eq "method" & $$_{c_name}!~/^_/ } @unwrapped;
- my @signals =
- grep {$$_{entity_type} eq "signal"} @unwrapped;
- my @properties =
- grep {$$_{entity_type} eq "property"} @unwrapped;
+ local $, = "\ngmmproc: ";
+ local $\ = "\n";
if (@methods)
- {
- print "Unwrapped functions:\n";
- map { print " $$_{c_name}\n"} @methods;
+ {
+ print STDERR ('gmmproc: Unwrapped functions:',
+ map($$_{c_name}, @methods));
}
if (@properties)
- {
- print "Unwrapped properties:\n";
- map { print " $$_{class}::$$_{name}\n"} @properties;
+ {
+ print STDERR ('gmmproc: Unwrapped properties:',
+ map($$_{class} . '::' . $$_{name}, @properties));
}
if (@signals)
{
- print "Unwrapped signals:\n";
- map { print " $$_{class}::$$_{name}\n"} @signals;
+ print STDERR ('gmmproc: Unwrapped signals:',
+ map($$_{class} . '::' . $$_{name}, @signals));
}
}
}
# end of program
-exit();
+exit;
####################################################################
@@ -174,7 +167,7 @@ sub print_usage()
Note: This will read srcdir/name.{hg,ccg} file and generates destdir/name.cc
';
- exit (1);
+ exit(1);
}
# void parse_command_line_args()