MCPcopy Create free account
hub / github.com/csmith-project/csmith / str2longlong

Method str2longlong

src/StringUtils.cpp:197–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197INT64
198StringUtils::str2longlong(const std::string &s)
199{
200 INT64 i = 0;
201 size_t j;
202 if (s.find("0x")==0) {
203 for (j=2; j<s.length(); j++) {
204 int v = 0;
205 if (s[j] >= '0' && s[j] <= '9') {
206 v = s[j] - '0';
207 } else if (s[j] >= 'A' && s[j] <= 'F') {
208 v = 10 + s[j] - 'A';
209 } else {
210 break;
211 }
212 i = i * 16 + v;
213 }
214 }
215 else {
216 stringstream ss(s);
217 ss >> i;
218 }
219 return i;
220}
221
222std::string
223StringUtils::longlong2str(INT64 i)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected