Separate cpu detection and printing logic

This commit is contained in:
Linus Dierheimer
2022-09-04 22:20:12 +02:00
parent a4e0275263
commit ea60fd0a0d
14 changed files with 246 additions and 235 deletions
+10
View File
@@ -3,6 +3,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <inttypes.h>
static char* CHAR_NULL_PTR = "";
@@ -553,6 +554,15 @@ double ffStrbufToDouble(const FFstrbuf* strbuf)
return value;
}
uint16_t ffStrbufToUInt16(const FFstrbuf* strbuf, uint16_t defaultValue)
{
uint16_t value;
if(sscanf(strbuf->chars, "%"SCNu16, &value) != 1)
return defaultValue;
return value;
}
void ffStrbufDestroy(FFstrbuf* strbuf)
{
free(strbuf->chars);
+1
View File
@@ -99,6 +99,7 @@ void ffStrbufWriteTo(const FFstrbuf* strbuf, FILE* file);
void ffStrbufPutTo(const FFstrbuf* strbuf, FILE* file);
double ffStrbufToDouble(const FFstrbuf* strbuf);
uint16_t ffStrbufToUInt16(const FFstrbuf* strbuf, uint16_t defaultValue);
void ffStrbufDestroy(FFstrbuf* strbuf);