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

Function getNumber

src/conddebug.cpp:167–183  ·  view source on GitHub ↗

Reads a hexadecimal number from str

Source from the content-addressed store, hash-verified

165
166// Reads a hexadecimal number from str
167static int getNumber(unsigned int* number, const char** str)
168{
169// char buffer[5];
170
171 if (sscanf(*str, "%X", number) == EOF || *number > 0xFFFF)
172 {
173 return 0;
174 }
175
176// Older, inferior version which doesn't work with leading zeros
177// sprintf(buffer, "%X", *number);
178// *str += strlen(buffer);
179 while (ishex(**str)) (*str)++;
180 scan(str);
181
182 return 1;
183}
184
185static Condition* Connect(const char** str);
186

Callers 1

PrimitiveFunction · 0.85

Calls 2

ishexFunction · 0.85
scanFunction · 0.85

Tested by

no test coverage detected