Map primitive name → boxed wrapper QN. */
| 253 | |
| 254 | /* Map primitive name → boxed wrapper QN. */ |
| 255 | static const CBMType *box_primitive(CBMArena *a, const char *prim) { |
| 256 | if (!prim) |
| 257 | return cbm_type_unknown(); |
| 258 | static const char *map[][2] = { |
| 259 | {"boolean", "java.lang.Boolean"}, {"byte", "java.lang.Byte"}, |
| 260 | {"char", "java.lang.Character"}, {"short", "java.lang.Short"}, |
| 261 | {"int", "java.lang.Integer"}, {"long", "java.lang.Long"}, |
| 262 | {"float", "java.lang.Float"}, {"double", "java.lang.Double"}, |
| 263 | {"void", "java.lang.Void"}, |
| 264 | }; |
| 265 | for (size_t i = 0; i < sizeof(map) / sizeof(map[0]); i++) { |
| 266 | if (strcmp(prim, map[i][0]) == 0) |
| 267 | return cbm_type_named(a, map[i][1]); |
| 268 | } |
| 269 | return cbm_type_unknown(); |
| 270 | } |
| 271 | |
| 272 | /* ── Initialization ───────────────────────────────────────────────── */ |
| 273 |
nothing calls this directly
no test coverage detected