Commit d37d161
committed
tasks/translation: delete unreachable BMP request-side branch
http_translate() opened with
bool TRANSLATE_USE_BMP = false;
as a local variable that was never assigned anywhere else in the tree,
then branched on it:
if (TRANSLATE_USE_BMP) {
/* build a BMP blob in memory, base64 it, send */
} else {
/* PNG encode via rpng_save_image_bgr24_string */
}
The if-branch has been unreachable since the variable was introduced.
The else-branch is the one that has actually been running in
production for every translation-service request. Delete the dead
branch, lift the surviving PNG encode out of the pointless else,
localise the 'pitch' temporary into the one block that uses it,
and drop the now-unused 'TRANSLATE_USE_BMP' declaration.
The include of <formats/rbmp.h> was pulled in solely for the
form_bmp_header call inside the dead branch; nothing else in this
file uses the rbmp API (the response-side BMP parsing at line 411
does raw byte-offset reads of the BMP header, not rbmp API calls),
so drop that include too.
Keeps the variable name 'bmp_buffer' / 'bmp64_buffer' / 'bmp64_len'
as-is - they are historical misnomers (the buffer holds PNG bytes,
not BMP) but renaming them is pure churn and would conflict with
other patches in flight.
No behaviour change: only the live branch was reachable before, and
it is what remains.
Note: the response-side PNG path in handle_translation_response has
its own copy-elimination opportunity (a per-pixel strip-alpha loop
that could be folded into the scaler pass), but the scaler does not
currently support ARGB8888 -> RGB565 as either a direct pixconv or
via the full-pipeline path (see libretro-common/gfx/scaler/scaler.c
lines 150-167 and 239-263), so replacing the intermediate BGR24
buffer would break the RGB565-core code path. That refactor needs
either a new conv_argb8888_rgb565 entry in the scaler or a two-pass
approach and is deferred to a separate commit.1 parent 1759e1b commit d37d161
1 file changed
Lines changed: 9 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
1200 | 1199 | | |
1201 | 1200 | | |
1202 | 1201 | | |
1203 | | - | |
1204 | 1202 | | |
1205 | 1203 | | |
1206 | 1204 | | |
1207 | 1205 | | |
1208 | 1206 | | |
1209 | 1207 | | |
1210 | | - | |
1211 | 1208 | | |
1212 | 1209 | | |
1213 | 1210 | | |
| |||
1218 | 1215 | | |
1219 | 1216 | | |
1220 | 1217 | | |
1221 | | - | |
1222 | | - | |
1223 | | - | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
1239 | 1225 | | |
1240 | | - | |
| 1226 | + | |
1241 | 1227 | | |
1242 | | - | |
| 1228 | + | |
1243 | 1229 | | |
1244 | 1230 | | |
1245 | 1231 | | |
| |||
0 commit comments