MCPcopy Create free account
hub / github.com/TASEmulators/fceux / hex2int

Function hex2int

src/lua-engine.cpp:3744–3752  ·  view source on GitHub ↗

Helper for a simple hex parser

Source from the content-addressed store, hash-verified

3742
3743// Helper for a simple hex parser
3744static int hex2int(lua_State *L, char c) {
3745 if (c >= '0' && c <= '9')
3746 return c-'0';
3747 if (c >= 'a' && c <= 'f')
3748 return c - 'a' + 10;
3749 if (c >= 'A' && c <= 'F')
3750 return c - 'A' + 10;
3751 return luaL_error(L, "invalid hex in colour");
3752}
3753
3754static const struct ColorMapping
3755{

Callers 1

str2colourFunction · 0.85

Calls 1

luaL_errorFunction · 0.85

Tested by

no test coverage detected