removed ffStrbufIsEmpty

This commit is contained in:
Linus Dierheimer
2021-03-23 19:48:52 +01:00
parent a0af3b0eb6
commit f61ffdb149
25 changed files with 91 additions and 93 deletions
+15 -16
View File
@@ -6,10 +6,10 @@
static int getCurrentRate(FFinstance* instance, Display* display)
{
void* xrandr;
if(!ffStrbufIsEmpty(&instance->config.libXrandr))
xrandr = dlopen(instance->config.libXrandr.chars, RTLD_LAZY);
else
if(instance->config.libXrandr.length == 0)
xrandr = dlopen("libXrandr.so", RTLD_LAZY);
else
xrandr = dlopen(instance->config.libXrandr.chars, RTLD_LAZY);
if(xrandr == NULL)
return 0;
@@ -44,10 +44,10 @@ void ffPrintResolution(FFinstance* instance)
return;
void* x11;
if(!ffStrbufIsEmpty(&instance->config.libX11))
x11 = dlopen(instance->config.libX11.chars, RTLD_LAZY);
else
if(instance->config.libX11.length == 0)
x11 = dlopen("libX11.so", RTLD_LAZY);
else
x11 = dlopen(instance->config.libX11.chars, RTLD_LAZY);
if(x11 == NULL)
{
ffPrintError(instance, "Resolution", "dlopen(\"libX11.so\", RTLD_LAZY) == NULL");
@@ -76,22 +76,21 @@ void ffPrintResolution(FFinstance* instance)
FF_STRBUF_CREATE(resolution);
if(!ffStrbufIsEmpty(&instance->config.resolutionFormat))
{
ffParseFormatString(&resolution, &instance->config.resolutionFormat, 3,
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, &screen->width},
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, &screen->height},
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, &currentRate}
);
}
else
if(instance->config.resolutionFormat.length == 0)
{
ffStrbufAppendF(&resolution, "%ix%i", screen->width, screen->height);
if(currentRate > 0)
ffStrbufAppendF(&resolution, " @ %iHz", currentRate);
}
else
{
ffParseFormatString(&resolution, &instance->config.resolutionFormat, 3,
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, &screen->width},
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, &screen->height},
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, &currentRate}
);
}
ffPrintAndSaveCachedValue(instance, "Resolution", &resolution);
ffStrbufDestroy(&resolution);