| 165 | } |
| 166 | |
| 167 | uint8_t builtinInitializeFormat(xsMachine *the, uint8_t format) |
| 168 | { |
| 169 | xsSlot slot; |
| 170 | |
| 171 | if (xsmcGet(slot, xsArg(0), xsID_format)) { |
| 172 | if (!xsmcTest(slot)) |
| 173 | return format; |
| 174 | |
| 175 | char *fmt = xsmcToString(slot); |
| 176 | uint8_t i; |
| 177 | for (i = 0; i < kIOFormatBufferDisposable; i++) { |
| 178 | if (!c_strcmp(gFormats[i], fmt)) |
| 179 | return i + 1; |
| 180 | } |
| 181 | |
| 182 | return kIOFormatInvalid; |
| 183 | } |
| 184 | |
| 185 | return format; |
| 186 | } |
| 187 | |
| 188 | // standard converstion to signed integer but disallows undefined |
| 189 | int32_t builtinGetSignedInteger(xsMachine *the, xsSlot *slot) |
no outgoing calls
no test coverage detected