v1cont / yad

Yet Another Dialog
GNU General Public License v3.0
687 stars 57 forks source link

Loop that can be broken #92

Closed shlyakpavel closed 4 years ago

shlyakpavel commented 4 years ago

https://github.com/v1cont/yad/blob/c78baef50bd9fe6c58e923438e9cab90b0e82baf/src/list.c#L574 PVS studio static analysis tool has got a warning here:

V712 Be advised that compiler may delete this cycle or make it infinity. Use volatile variable(s) or synchronization primitives to avoid this. See details at https://www.viva64.com/en/w/v712/

shlyakpavel commented 4 years ago

The same here https://github.com/v1cont/yad/blob/c78baef50bd9fe6c58e923438e9cab90b0e82baf/src/main.c#L597

shlyakpavel commented 4 years ago

And here https://github.com/v1cont/yad/blob/c78baef50bd9fe6c58e923438e9cab90b0e82baf/src/progress.c#L57

shlyakpavel commented 4 years ago

And here https://github.com/v1cont/yad/blob/c78baef50bd9fe6c58e923438e9cab90b0e82baf/src/text.c#L273

v1cont commented 4 years ago

maybe they are right. empty loops is not a good style, so i corrected this

shlyakpavel commented 4 years ago

Thanks