using strbuf for loading/saving cached values

This commit is contained in:
Linus Dierheimer
2021-03-21 20:42:07 +01:00
parent c783bb9d97
commit 2004544528
11 changed files with 53 additions and 46 deletions
+1 -1
View File
@@ -50,6 +50,6 @@ void ffPrintCPU(FFinstance* instance)
);
}
ffPrintAndSaveCachedValue(instance, "CPU", cpu.chars);
ffPrintAndSaveCachedValue(instance, "CPU", &cpu);
ffStrbufDestroy(&cpu);
}
+1 -1
View File
@@ -39,7 +39,7 @@ static void handleGPU(FFinstance* instance, struct pci_access* pacc, struct pci_
);
}
ffPrintAndSaveCachedValue(instance, key, gpu.chars);
ffPrintAndSaveCachedValue(instance, key, &gpu);
ffStrbufDestroy(&gpu);
}
+1 -1
View File
@@ -45,7 +45,7 @@ void ffPrintHost(FFinstance* instance)
ffStrbufSetF(&host, "%s %s", name.chars, version.chars);
}
ffPrintAndSaveCachedValue(instance, "Host", host.chars);
ffPrintAndSaveCachedValue(instance, "Host", &host);
ffStrbufDestroy(&host);
ffStrbufDestroy(&family);
+1 -1
View File
@@ -55,6 +55,6 @@ void ffPrintLocale(FFinstance* instance)
}
ffPrintAndSaveCachedValue(instance, "Locale", locale.chars);
ffPrintAndSaveCachedValue(instance, "Locale", &locale);
ffStrbufDestroy(&locale);
}
+1 -1
View File
@@ -29,6 +29,6 @@ void ffPrintOS(FFinstance* instance)
ffStrbufSetF(&os, "%s %s", name, instance->state.utsname.machine);
}
ffPrintAndSaveCachedValue(instance, "OS", os.chars);
ffPrintAndSaveCachedValue(instance, "OS", &os);
ffStrbufDestroy(&os);
}
+1 -1
View File
@@ -95,6 +95,6 @@ void ffPrintResolution(FFinstance* instance)
ffStrbufAppendF(&resolution, " @ %iHz", currentRate);
}
ffPrintAndSaveCachedValue(instance, "Resolution", resolution.chars);
ffPrintAndSaveCachedValue(instance, "Resolution", &resolution);
ffStrbufDestroy(&resolution);
}
+1 -1
View File
@@ -43,6 +43,6 @@ void ffPrintShell(FFinstance* instance)
ffStrbufSetS(&shell, shellName);
}
ffPrintAndSaveCachedValue(instance, "Shell", shell.chars);
ffPrintAndSaveCachedValue(instance, "Shell", &shell);
ffStrbufDestroy(&shell);
}