Commit a318302
Fix CodeQL findings: drop dead branches and redundant guards
Seven trivial fixes for findings CodeQL surfaced in src/:
- main.cpp: drop "if (jpg)" before free() (free(NULL) is a no-op)
- main.cpp: drop empty if-block whose only content was a comment
- main.cpp: drop "if (boostHap > 0)" guard — boostHap inits to 2 and
is only ever reassigned upward
- face.cpp: drop "if (pileCount > 0)" guard inside drawCleaningButton —
the function already early-returns on pileCount == 0
- face.cpp: drop unreachable ": 70" branch in drawActivityCrossGame —
row is clamped to [0,5] above, so "row <= 5" is always true
- face.cpp: rename inner buf[12] to playsBuf to stop shadowing the
outer buf[40] in drawActivityGameOver
- face.cpp: drop unused friendlyCell local in drawMediaSelectScreen
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 1c0cec5 commit a318302
2 files changed
Lines changed: 16 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
220 | 218 | | |
221 | 219 | | |
222 | 220 | | |
| |||
3304 | 3302 | | |
3305 | 3303 | | |
3306 | 3304 | | |
3307 | | - | |
| 3305 | + | |
3308 | 3306 | | |
3309 | 3307 | | |
3310 | 3308 | | |
| |||
3447 | 3445 | | |
3448 | 3446 | | |
3449 | 3447 | | |
3450 | | - | |
3451 | | - | |
| 3448 | + | |
| 3449 | + | |
3452 | 3450 | | |
3453 | 3451 | | |
3454 | 3452 | | |
3455 | | - | |
| 3453 | + | |
3456 | 3454 | | |
3457 | 3455 | | |
3458 | 3456 | | |
| |||
7574 | 7572 | | |
7575 | 7573 | | |
7576 | 7574 | | |
7577 | | - | |
7578 | 7575 | | |
7579 | 7576 | | |
7580 | 7577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1177 | 1177 | | |
1178 | 1178 | | |
1179 | 1179 | | |
1180 | | - | |
1181 | | - | |
1182 | | - | |
1183 | | - | |
1184 | | - | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
1185 | 1183 | | |
1186 | 1184 | | |
1187 | 1185 | | |
| |||
3335 | 3333 | | |
3336 | 3334 | | |
3337 | 3335 | | |
3338 | | - | |
| 3336 | + | |
3339 | 3337 | | |
3340 | 3338 | | |
3341 | 3339 | | |
| |||
6220 | 6218 | | |
6221 | 6219 | | |
6222 | 6220 | | |
6223 | | - | |
6224 | | - | |
6225 | | - | |
| 6221 | + | |
6226 | 6222 | | |
6227 | 6223 | | |
6228 | 6224 | | |
| |||
0 commit comments