Ticket #45689

sdl2: redraw_ibutton() return value

Eröffnet am: 2022-09-23 13:00 Letztes Update: 2023-01-06 07:41

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
2

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-Verlauf (3/6 Historien)

2022-09-23 13:00 Aktualisiert von: cazfi
  • New Ticket "sdl2: redraw_ibutton() return value" created
2022-11-29 07:24 Aktualisiert von: cazfi
Kommentar

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.

2022-12-31 10:31 Aktualisiert von: cazfi
  • Verantwortlicher Update from (Keine) to cazfi
  • Lösung Update from Keine to Accepted
2023-01-06 07:41 Aktualisiert von: cazfi
  • Status Update from Offen to Geschlossen
  • Lösung Update from Accepted to Gefixt

Bearbeiten

Please login to add comment to this ticket » Anmelden