From 98c94b01e5c802209a665299c15573eea2be0276 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Fri, 23 Sep 2022 11:51:16 +0200 Subject: [PATCH] Some more standard comformance --- src/common/font.c | 5 +- .../displayserver/linux/displayserver_linux.c | 2 +- src/detection/gpu/gpu_linux.c | 10 ++-- src/logo/image/im6.c | 2 +- src/logo/image/im7.c | 2 +- src/modules/opencl.c | 6 +-- src/modules/opengl.c | 52 +++++++++---------- 7 files changed, 41 insertions(+), 38 deletions(-) diff --git a/src/common/font.c b/src/common/font.c index c48f77221..d789d466f 100644 --- a/src/common/font.c +++ b/src/common/font.c @@ -208,7 +208,10 @@ void ffFontInitWithSpace(FFfont* font, const char* rawName) { const char* pspace = strrchr(rawName, ' '); if(pspace == NULL) - return ffFontInitCopy(font, rawName); + { + ffFontInitCopy(font, rawName); + return; + } fontInit(font); diff --git a/src/detection/displayserver/linux/displayserver_linux.c b/src/detection/displayserver/linux/displayserver_linux.c index 68812cec2..3f6fd04eb 100644 --- a/src/detection/displayserver/linux/displayserver_linux.c +++ b/src/detection/displayserver/linux/displayserver_linux.c @@ -34,7 +34,7 @@ static void parseDRM(FFDisplayServerResult* result) resolution->height = 0; resolution->refreshRate = 0; - int scanned = fscanf(modeFile, "%ix%i", &resolution->width, &resolution->height); + int scanned = fscanf(modeFile, "%ux%u", &resolution->width, &resolution->height); if(scanned < 2 || resolution->width == 0 || resolution->height == 0) --result->resolutions.length; diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index 1845c1f88..a9d773d90 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -17,13 +17,13 @@ typedef struct PCIData { struct pci_access* access; - FF_LIBRARY_SYMBOL(pci_fill_info); - FF_LIBRARY_SYMBOL(pci_read_byte); - FF_LIBRARY_SYMBOL(pci_lookup_name); - FF_LIBRARY_SYMBOL(pci_get_param); + FF_LIBRARY_SYMBOL(pci_fill_info) + FF_LIBRARY_SYMBOL(pci_read_byte) + FF_LIBRARY_SYMBOL(pci_lookup_name) + FF_LIBRARY_SYMBOL(pci_get_param) #if PCI_LIB_VERSION >= 0x030800 - FF_LIBRARY_SYMBOL(pci_get_string_property); + FF_LIBRARY_SYMBOL(pci_get_string_property) #endif } PCIData; diff --git a/src/logo/image/im6.c b/src/logo/image/im6.c index 10e0e8b7d..f6cbf2de0 100644 --- a/src/logo/image/im6.c +++ b/src/logo/image/im6.c @@ -5,7 +5,7 @@ #include -static FF_LIBRARY_SYMBOL(ResizeImage); +static FF_LIBRARY_SYMBOL(ResizeImage) static void* logoResize(const void* image, size_t width, size_t height, void* exceptionInfo) { diff --git a/src/logo/image/im7.c b/src/logo/image/im7.c index 8cd87a216..db4043465 100644 --- a/src/logo/image/im7.c +++ b/src/logo/image/im7.c @@ -5,7 +5,7 @@ #include -static FF_LIBRARY_SYMBOL(ResizeImage); +static FF_LIBRARY_SYMBOL(ResizeImage) static void* logoResize(const void* image, size_t width, size_t height, void* exceptionInfo) { diff --git a/src/modules/opencl.c b/src/modules/opencl.c index dbe478e0d..7f2ce1acb 100644 --- a/src/modules/opencl.c +++ b/src/modules/opencl.c @@ -18,9 +18,9 @@ typedef struct OpenCLData { - FF_LIBRARY_SYMBOL(clGetPlatformIDs); - FF_LIBRARY_SYMBOL(clGetDeviceIDs); - FF_LIBRARY_SYMBOL(clGetDeviceInfo); + FF_LIBRARY_SYMBOL(clGetPlatformIDs) + FF_LIBRARY_SYMBOL(clGetDeviceIDs) + FF_LIBRARY_SYMBOL(clGetDeviceInfo) } OpenCLData; static const char* openCLHandelData(FFinstance* instance, OpenCLData* data) diff --git a/src/modules/opengl.c b/src/modules/opengl.c index 8afff3583..78d0b4846 100644 --- a/src/modules/opengl.c +++ b/src/modules/opengl.c @@ -24,7 +24,7 @@ typedef struct GLData { - FF_LIBRARY_SYMBOL(glGetString); + FF_LIBRARY_SYMBOL(glGetString) } GLData; static const char* glHandlePrint(FFinstance* instance, const GLData* data) @@ -64,17 +64,17 @@ typedef struct EGLData { GLData glData; - FF_LIBRARY_SYMBOL(eglGetProcAddress); - FF_LIBRARY_SYMBOL(eglGetDisplay); - FF_LIBRARY_SYMBOL(eglInitialize); - FF_LIBRARY_SYMBOL(eglBindAPI); - FF_LIBRARY_SYMBOL(eglGetConfigs); - FF_LIBRARY_SYMBOL(eglCreatePbufferSurface); - FF_LIBRARY_SYMBOL(eglCreateContext); - FF_LIBRARY_SYMBOL(eglMakeCurrent); - FF_LIBRARY_SYMBOL(eglDestroyContext); - FF_LIBRARY_SYMBOL(eglDestroySurface); - FF_LIBRARY_SYMBOL(eglTerminate); + FF_LIBRARY_SYMBOL(eglGetProcAddress) + FF_LIBRARY_SYMBOL(eglGetDisplay) + FF_LIBRARY_SYMBOL(eglInitialize) + FF_LIBRARY_SYMBOL(eglBindAPI) + FF_LIBRARY_SYMBOL(eglGetConfigs) + FF_LIBRARY_SYMBOL(eglCreatePbufferSurface) + FF_LIBRARY_SYMBOL(eglCreateContext) + FF_LIBRARY_SYMBOL(eglMakeCurrent) + FF_LIBRARY_SYMBOL(eglDestroyContext) + FF_LIBRARY_SYMBOL(eglDestroySurface) + FF_LIBRARY_SYMBOL(eglTerminate) EGLDisplay display; EGLConfig config; @@ -175,17 +175,17 @@ typedef struct GLXData { GLData glData; - FF_LIBRARY_SYMBOL(glXGetProcAddress); - FF_LIBRARY_SYMBOL(XOpenDisplay); - FF_LIBRARY_SYMBOL(glXChooseVisual); + FF_LIBRARY_SYMBOL(glXGetProcAddress) + FF_LIBRARY_SYMBOL(XOpenDisplay) + FF_LIBRARY_SYMBOL(glXChooseVisual) FF_LIBRARY_SYMBOL(XCreatePixmap); - FF_LIBRARY_SYMBOL(glXCreateGLXPixmap); - FF_LIBRARY_SYMBOL(glXCreateContext); - FF_LIBRARY_SYMBOL(glXMakeCurrent); - FF_LIBRARY_SYMBOL(glXDestroyContext); - FF_LIBRARY_SYMBOL(glXDestroyGLXPixmap); - FF_LIBRARY_SYMBOL(XFreePixmap); - FF_LIBRARY_SYMBOL(XCloseDisplay); + FF_LIBRARY_SYMBOL(glXCreateGLXPixmap) + FF_LIBRARY_SYMBOL(glXCreateContext) + FF_LIBRARY_SYMBOL(glXMakeCurrent) + FF_LIBRARY_SYMBOL(glXDestroyContext) + FF_LIBRARY_SYMBOL(glXDestroyGLXPixmap) + FF_LIBRARY_SYMBOL(XFreePixmap) + FF_LIBRARY_SYMBOL(XCloseDisplay) Display* display; XVisualInfo* visualInfo; @@ -290,10 +290,10 @@ typedef struct OSMesaData { GLData glData; - FF_LIBRARY_SYMBOL(OSMesaGetProcAddress); - FF_LIBRARY_SYMBOL(OSMesaCreateContext); - FF_LIBRARY_SYMBOL(OSMesaMakeCurrent); - FF_LIBRARY_SYMBOL(OSMesaDestroyContext); + FF_LIBRARY_SYMBOL(OSMesaGetProcAddress) + FF_LIBRARY_SYMBOL(OSMesaCreateContext) + FF_LIBRARY_SYMBOL(OSMesaMakeCurrent) + FF_LIBRARY_SYMBOL(OSMesaDestroyContext) OSMesaContext context; } OSMesaData;