MCPcopy Create free account
hub / github.com/JHRobotics/softgpu / version_parse

Function version_parse

windrv.c:274–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274void version_parse(const char *version_str, version_t *out)
275{
276 int group = 0;
277 const char *ptr;
278 int junk = 0;
279
280 memset(out, 0, sizeof(version_t));
281
282 for(ptr = version_str; *ptr != '\0'; ptr++)
283 {
284 switch(*ptr)
285 {
286 case '0': case '1': case '2': case '3': case '4':
287 case '5': case '6': case '7': case '8': case '9':
288 {
289 int *num = &junk;
290 switch(group)
291 {
292 case 0:
293 num = &(out->major);
294 break;
295 case 1:
296 num = &(out->minor);
297 break;
298 case 2:
299 num = &(out->patch);
300 break;
301 case 3:
302 num = &(out->build);
303 break;
304 }
305 *num = ((*num)*10) + ((*ptr) - '0');
306 break;
307 }
308 case '.':
309 case ',':
310 group++;
311 break;
312 }
313 }
314}
315
316/*
317 * v1 < v2 => negative

Callers 2

softgpu_sysinfoFunction · 0.85
version_winFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected