[Freeciv-tickets] [freeciv] #45689: sdl2: redraw_ibutton() return value

Zurück zum Archiv-Index
OSDN Ticket System norep****@osdn*****
Tue Nov 29 07:24:37 JST 2022


#45689: sdl2: redraw_ibutton() return value

  Open Date: 2022-09-23 07:00
Last Update: 2022-11-29 00:24

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/45689
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45689

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-11-29 00:24 Updated by: cazfi
 * Milestone Update from (None) to 3.0.6

Comment:

Reply To cazfi
As any non-zero alphablit() return value is considered an error, above can even result in 10 - 10 = 0, like there was no error at all from redraw_ibutton()
That makes this an actual bug, not just a thing to clean up.


---------------------------------------------------------------------
Ticket Status:

      Reporter: cazfi
         Owner: (None)
          Type: Bugs
        Status: Open
      Priority: 5 - Medium
     MileStone: 3.0.6
     Component: SDL2-client
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

redraw_ibutton() header says: "function return (-1) if there are no Icon nor Text. Else return 0."
In reality there's also a return like this:
ret = alphablit(pIcon, NULL, pIButton->dst->surface, &dest, 255);
if (ret) {
FREESURFACE(pText);
return ret - 10;
}
I guess that should return just '-1'. As any non-zero alphablit() return value is considered an error, above can even result in 10 - 10 = 0, like there was no error at all from redraw_ibutton()
Further, there's another alphablit() call where the success is not checked at all.

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/45689
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45689



More information about the Freeciv-tickets mailing list
Zurück zum Archiv-Index