任务单 #45689

sdl2: redraw_ibutton() return value

开放日期: 2022-09-23 13:00 最后更新: 2023-01-06 07:41

报告人:
属主:
类型:
状态:
关闭
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Fixed
文件:
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.

任务单历史 (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
评论

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
  • 属主 Update from (无) to cazfi
  • 处理结果 Update from to Accepted
2023-01-06 07:41 Updated by: cazfi
  • 状态 Update from 开启 to 关闭
  • 处理结果 Update from Accepted to Fixed

编辑

Please login to add comment to this ticket » 登录名