diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-04-30 19:55:01 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-05-01 02:55:29 +0000 |
commit | 8b5a50e2b0107707bd30c89e6797e2c98f1e89a9 (patch) | |
tree | caf59ae9a5c0420fb9c8f47e657753735e28d1df /tools/process-x11-xcb.pl | |
parent | 510777cf78488981db12cb98267599aca9866783 (diff) |
Fix some cases where we're shifting a signed 1 left.
Shift 1U instead, to make sure it's unsigned; the result of, for
example, the result of shifting a signed value left is undefined if the
value times 2^{shift count} doesn't fit in the *signed* type of the
shifted value. That means, in particular, that the result of shifting 1
left by {number of bits in an int - 1} is undefined. (In *practice*,
it'll probably be -2^32, with the bit you want set, but that's not
guaranteed, and GCC 5.1 seems not to like it.)
This fixes the *other* generator for the X11 header files; we manually
fix the file in question, because life's too short to spend very much of
it trying to debug Perl issues that cause a
Can't use string ("1") as a HASH ref while "strict refs" in use at
../../tools/process-x11-xcb.pl line 675.
at ../../tools/process-x11-xcb.pl line 1859
at ../../tools/process-x11-xcb.pl line 1859
failure.
Change-Id: I3dd46025b2ae461e63034b36ab11cdbc9380b696
Reviewed-on: https://code.wireshark.org/review/8263
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tools/process-x11-xcb.pl')
-rwxr-xr-x | tools/process-x11-xcb.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/process-x11-xcb.pl b/tools/process-x11-xcb.pl index bb0d4f2c5a..83b36d1c5e 100755 --- a/tools/process-x11-xcb.pl +++ b/tools/process-x11-xcb.pl @@ -888,7 +888,7 @@ sub dissect_element($$$$$;$$) for my $foo (keys %{$enum{$enum_name{$enum_ref}}{rbit}}) { say "'$foo'"; } die ("Field '$field' not found in '$enum_ref'"); } - push @test , "($switchon & (1 << $bit))"; + push @test , "($switchon & (1U << $bit))"; } else { my $val = $enum{$enum_name{$enum_ref}}{rvalue}{$field}; if (! defined($val)) { |