From 83ea189d81287dd0b60ef9e7e3ae8d39e3bcb022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 13 Jan 2023 15:46:29 +0800 Subject: [PATCH] GPU: simplify code --- src/modules/gpu.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/modules/gpu.c b/src/modules/gpu.c index a2daad515..6c673df36 100644 --- a/src/modules/gpu.c +++ b/src/modules/gpu.c @@ -37,13 +37,13 @@ static void printGPUResult(FFinstance* instance, uint8_t index, const FFGPUResul } else { - FFstrbuf type; + const char* type; if(gpu->type == FF_GPU_TYPE_INTEGRATED) - ffStrbufInitS(&type, "Integrated"); + type = "Integrated"; else if(gpu->type == FF_GPU_TYPE_DISCRETE) - ffStrbufInitS(&type, "Discrete"); + type = "Discrete"; else - ffStrbufInitS(&type, "Unknown"); + type = "Unknown"; ffPrintFormat(instance, FF_GPU_MODULE_NAME, index, &instance->config.gpu, FF_GPU_NUM_FORMAT_ARGS, (FFformatarg[]){ {FF_FORMAT_ARG_TYPE_STRBUF, &gpu->vendor}, @@ -51,10 +51,8 @@ static void printGPUResult(FFinstance* instance, uint8_t index, const FFGPUResul {FF_FORMAT_ARG_TYPE_STRBUF, &gpu->driver}, {FF_FORMAT_ARG_TYPE_DOUBLE, &gpu->temperature}, {FF_FORMAT_ARG_TYPE_INT, &gpu->coreCount}, - {FF_FORMAT_ARG_TYPE_STRBUF, &type}, + {FF_FORMAT_ARG_TYPE_STRING, type}, }); - - ffStrbufDestroy(&type); } }