mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-09-20 01:06:15 +02:00
Fix various bugs and excessive stack usage that crept in the conversion
Mon Mar 25 17:51:05 2002 Owen Taylor <otaylor@redhat.com> * glib-mkenums.in (parse_entries): Fix various bugs and excessive stack usage that crept in the conversion from gtk-mkenums. (#74431)
This commit is contained in:
parent
a95ec87a93
commit
648204c8bc
@ -1,3 +1,9 @@
|
|||||||
|
Mon Mar 25 17:51:05 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* glib-mkenums.in (parse_entries): Fix various bugs and
|
||||||
|
excessive stack usage that crept in the conversion from
|
||||||
|
gtk-mkenums. (#74431)
|
||||||
|
|
||||||
Mon Mar 25 17:25:57 2002 Owen Taylor <otaylor@redhat.com>
|
Mon Mar 25 17:25:57 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtype.c (g_type_free_instance): Wrap setting freed instance
|
* gtype.c (g_type_free_instance): Wrap setting freed instance
|
||||||
|
@ -30,24 +30,23 @@ sub parse_entries {
|
|||||||
my $looking_for_name = 0;
|
my $looking_for_name = 0;
|
||||||
|
|
||||||
while (<$file>) {
|
while (<$file>) {
|
||||||
|
# read lines until we have no open comments
|
||||||
# read lines until comment end is matched
|
while (m@/\*([^*]|\*(?!/))*$@) {
|
||||||
while (m@/\*([^*]|\*[^/*])*\**$@x) {
|
|
||||||
my $new;
|
my $new;
|
||||||
defined ($new = <>) || die "Unmatched comment in $ARGV";
|
defined ($new = <$file>) || die "Unmatched comment in $ARGV";
|
||||||
$_ .= $new;
|
$_ .= $new;
|
||||||
}
|
}
|
||||||
# strip comments w/o options
|
# strip comments w/o options
|
||||||
s@/\*[^<]([^*]|\*[^/*])*\**\*/@@gx;
|
s@/\*(?!<)
|
||||||
|
([^*]+|\*(?!/))*
|
||||||
|
\*/@@gx;
|
||||||
|
|
||||||
# strip newlines
|
# strip newlines
|
||||||
s/\n//;
|
s@\n@ @;
|
||||||
|
|
||||||
# skip empty lines
|
# skip empty lines
|
||||||
next if m@^\s*$@;
|
next if m@^\s*$@;
|
||||||
|
|
||||||
# print STDERR "xxx $_\n";
|
|
||||||
|
|
||||||
if ($looking_for_name) {
|
if ($looking_for_name) {
|
||||||
if (/^\s*(\w+)/) {
|
if (/^\s*(\w+)/) {
|
||||||
$enumname = $1;
|
$enumname = $1;
|
||||||
@ -60,15 +59,6 @@ sub parse_entries {
|
|||||||
my $file= "../$1";
|
my $file= "../$1";
|
||||||
open NEWFILE, $file or die "Cannot open include file $file: $!\n";
|
open NEWFILE, $file or die "Cannot open include file $file: $!\n";
|
||||||
|
|
||||||
# read lines until comment end is matched
|
|
||||||
while (m@/\*([^*]|\*[^/*])*\**$@x) {
|
|
||||||
my $new;
|
|
||||||
defined ($new = <>) || die "Unmatched comment in $file_name";
|
|
||||||
$_ .= $new;
|
|
||||||
}
|
|
||||||
# strip comments w/o options
|
|
||||||
s@/\*[^<]([^*]|\*[^/*])*\**\*/@@gx;
|
|
||||||
|
|
||||||
if (parse_entries (\*NEWFILE, $NEWFILE)) {
|
if (parse_entries (\*NEWFILE, $NEWFILE)) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
@ -100,8 +90,6 @@ sub parse_entries {
|
|||||||
@x) {
|
@x) {
|
||||||
my ($name, $value, $options) = ($1,$2,$3);
|
my ($name, $value, $options) = ($1,$2,$3);
|
||||||
|
|
||||||
# print STDERR "xxx \"$name\" \"$value\" \"$otions\"\n";
|
|
||||||
|
|
||||||
if (!defined $flags && defined $value && $value =~ /<</) {
|
if (!defined $flags && defined $value && $value =~ /<</) {
|
||||||
$seenbitshift = 1;
|
$seenbitshift = 1;
|
||||||
}
|
}
|
||||||
@ -212,16 +200,16 @@ while (<>) {
|
|||||||
$firstenum = 1; # Flag to print filename at next enum
|
$firstenum = 1; # Flag to print filename at next enum
|
||||||
}
|
}
|
||||||
|
|
||||||
# read lines until comment end is matched
|
# read lines until we have no open comments
|
||||||
while (m@/\*([^*]|\*[^/*])*\**$@x) {
|
while (m@/\*([^*]|\*(?!/))*$@) {
|
||||||
my $new;
|
my $new;
|
||||||
defined ($new = <>) || die "Unmatched comment in $ARGV";
|
defined ($new = <>) || die "Unmatched comment in $ARGV";
|
||||||
$_ .= $new;
|
$_ .= $new;
|
||||||
}
|
}
|
||||||
# strip comments w/o options
|
# strip comments w/o options
|
||||||
s@/\*[^<]([^*]|\*[^/*])*\**\*/@@gx;
|
s@/\*(?!<)
|
||||||
|
([^*]+|\*(?!/))*
|
||||||
# print STDERR "xxx $_\n";
|
\*/@@gx;
|
||||||
|
|
||||||
if (m@^\s*typedef\s+enum\s*
|
if (m@^\s*typedef\s+enum\s*
|
||||||
({)?\s*
|
({)?\s*
|
||||||
|
Loading…
Reference in New Issue
Block a user