Ticket #45689

sdl2: redraw_ibutton() return value

Date d'ouverture: 2022-09-23 13:00 Dernière mise à jour: 2023-01-06 07:41

Rapporteur:
Propriétaire:
Type:
État:
Atteints
Composant:
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Fixed
Fichier:
2

Détails

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 History (3/6 Histories)

2022-09-23 13:00 Updated by: cazfi
  • New Ticket "sdl2: redraw_ibutton() return value" created
2022-11-29 07:24 Updated by: cazfi
Commentaire

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 Updated by: cazfi
  • Propriétaire Update from (Aucun) to cazfi
  • Résolution Update from Aucun to Accepted
2023-01-06 07:41 Updated by: cazfi
  • État Update from Ouvert to Atteints
  • Résolution Update from Accepted to Fixed

Modifier

Please login to add comment to this ticket » Connexion