Tíquete #45689

sdl2: redraw_ibutton() return value

: 2022-09-23 13:00 Última Atualização: 2023-01-06 07:41

Relator:
Dono:
Tipo:
Estado:
Fechado
Componente:
Marcos:
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
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 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
Comentário

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
  • Dono Update from (Nenhum) to cazfi
  • Resolução Update from Nenhum to Accepted
2023-01-06 07:41 Updated by: cazfi
  • Estado Update from Aberto to Fechado
  • Resolução Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Login