MCPcopy Create free account
hub / github.com/GJDuck/e9patch / convertInteger

Function convertInteger

src/e9patch/e9json.cpp:709–718  ·  view source on GitHub ↗

* Convert an integer. */

Source from the content-addressed store, hash-verified

707 * Convert an integer.
708 */
709static uintptr_t convertInteger(const Parser &parser, intptr_t x,
710 intptr_t min, intptr_t max, unsigned bits)
711{
712 if (x < min || x > max)
713 parse_error(parser, "failed to parse %u-bit integer; value %zd is "
714 "not within the range %zd..%zd", bits, x, min, max);
715 if (x < 0)
716 x += (max + 1);
717 return x;
718}
719
720/*
721 * Create a data template entry.

Callers 1

makeDataEntryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected