[PATCH v2 1/2] winapi_test: Do not multiply type size when it is undefined, in _refresh().
Signed-off-by: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr> --- 'Use of uninitialized value $type_size in multiplication (*) at tools/winapi/c_type.pm line 244.' --- tools/winapi/c_type.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/winapi/c_type.pm b/tools/winapi/c_type.pm index b00cf81..c6aeb6a 100644 --- a/tools/winapi/c_type.pm +++ b/tools/winapi/c_type.pm @@ -239,8 +239,14 @@ sub _refresh($) } else { - print STDERR "$type_name -> type_size=undef, count=$count\n" if (!defined $type_size); - $type_size *= int($count); + if (!defined $type_size) + { + print STDERR "$type_name -> type_size=undef, count=$count\n"; + } + else + { + $type_size *= int($count); + } } } if ($bitfield_size != 0) -- 2.10.0.windows.1
On Tue, 14 Apr 2020, Serge Gautherie wrote:
Signed-off-by: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr> --- 'Use of uninitialized value $type_size in multiplication (*) at tools/winapi/c_type.pm line 244.'
Which file triggers this error? Is it in the Wine source? I'm getting errors when I run winapi_check but not there.
} else { - print STDERR "$type_name -> type_size=undef, count=$count\n" if (!defined $type_size); - $type_size *= int($count); + if (!defined $type_size) + { + print STDERR "$type_name -> type_size=undef, count=$count\n"; + } + else + { + $type_size *= int($count); + }
-- Francois Gouget <fgouget(a)free.fr> http://fgouget.free.fr/ The nice thing about meditation is that it makes doing nothing quite respectable -- Paul Dean
On 14/04/2020 12:41, Francois Gouget wrote:
On Tue, 14 Apr 2020, Serge Gautherie wrote:
'Use of uninitialized value $type_size in multiplication (*) at tools/winapi/c_type.pm line 244.'
Which file triggers this error? Is it in the Wine source? I'm getting errors when I run winapi_check but not there.
I am working on 'winapi_test' script (and related files) only, so far. (See my recent private emails.) I have not looked at why this 'undef' case is triggered (yet), as the case/fix seems obvious. --
Signed-off-by: Francois Gouget <fgouget(a)free.fr> So this happens whenever winapi_test runs into a union or struct which contains a field which is itself a union or struct. One of the first cases is struct _XMM_SAVE_AREA32 which contains fields of type M128A which is a struct (with a DECLSPEC_ALIGN directive too). There are others but surprisingly few. -- Francois Gouget <fgouget(a)free.fr> http://fgouget.free.fr/ "Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it ;)" -- Linus Torvalds
participants (2)
-
Francois Gouget -
Serge Gautherie