On Sat, 21 Jun 2003 15:52:17 -0700, Glenn Linderman <[EMAIL PROTECTED]>
wrote:

>          // #### add (or create) the tooltip
>          if(perlcs.szTip != NULL) {
>                       if(perlcs.hvParent != NULL) {
>                               if(perlcs.hTooltip == NULL) {
>                                       SV** t;
>                                       t = hv_fetch_mg(NOTXSCALL perlcs.hvParent, 
> "-tooltip", 8, 0);
>                                       if(t != NULL) {
>---->                                          perlcs.hTooltip = (HWND) SvIV(*t);
>                                       }
>                               }
>                               if(perlcs.hTooltip == NULL) {
>#ifdef PERLWIN32GUI_STRONGDEBUG
>                                   printf("XS(Create): creating -tooltip...\n");
>#endif
>                                       perlcs.hTooltip = CreateTooltip(NOTXSCALL 
> perlcs.hvParent);
>                               }
>                       }
>
>The line that I've marked with ----> (line 641 of the released gui.xs)
>produces a warning, text below:
>
>Use of uninitialized value in subroutine entry at
>C:/Perl/site/lib/Win32/GUI.pm line 524
>
>The referenced line is a call to Win32::GUI::Create.
>
>It seems like maybe the first -tip option defined in a subwindow results
>in this warning.  So it would appear that dereferencing  SvIV(*t)  is
>what produces the warning.  I don't (yet) speak XS well enough to say
>anything more about what the bug might be, such that the warning is
>generated.

I'm not sure if this is a bug or not, but you are seeing the warning
message because $hvParent{-tooltip} exists, but is undefined.  I have no
idea if this is a situation that can occur, or if this indicates a bug
elsewhere.  If this is a valid situation then you can get rid of the
warning by changing

    if(t != NULL)

to

    if (t && SvOK(*t))

This is a safe change, as hTooltip is already NULL, and SvIV(*t) would
return 0 anyways if *t is undefined.

Cheers,
-Jan

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to