diff options
| author | dec05eba <dec05eba@protonmail.com> | 2026-07-19 19:27:55 +0200 |
|---|---|---|
| committer | dec05eba <dec05eba@protonmail.com> | 2026-07-19 19:27:55 +0200 |
| commit | 2891f2b637058d7fcf4651059cd88dc03e62e68c (patch) | |
| tree | 383cc4a84c4a56afaf3e07c6dfa45f33ac4d1184 /src | |
| parent | 1d1daa9488eeaa0e46dc3296939b34e9dc22ee41 (diff) | |
Remove goto
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/utils.c b/src/utils.c index b808b22..31853e2 100644 --- a/src/utils.c +++ b/src/utils.c @@ -358,7 +358,6 @@ bool drm_monitor_get_display_server_data(const gsr_window *window, const gsr_mon bool gl_get_gpu_info(gsr_egl *egl, gsr_gpu_info *info) { const char *software_renderers[] = { "llvmpipe", "SWR", "softpipe", NULL }; - bool supported = true; const char *gl_vendor = (const char*)egl->glGetString(GL_VENDOR); const char *gl_renderer = (const char*)egl->glGetString(GL_RENDERER); @@ -367,16 +366,14 @@ bool gl_get_gpu_info(gsr_egl *egl, gsr_gpu_info *info) { if(!gl_vendor) { fprintf(stderr, "gsr error: failed to get gpu vendor\n"); - supported = false; - goto end; + return false; } if(gl_renderer) { for(int i = 0; software_renderers[i]; ++i) { if(strstr(gl_renderer, software_renderers[i])) { fprintf(stderr, "gsr error: your opengl environment is not properly setup. It's using %s (software rendering) for opengl instead of your graphics card. Please make sure your graphics driver is properly installed\n", software_renderers[i]); - supported = false; - goto end; + return false; } } } @@ -393,8 +390,7 @@ bool gl_get_gpu_info(gsr_egl *egl, gsr_gpu_info *info) { info->vendor = GSR_GPU_VENDOR_BROADCOM; else { fprintf(stderr, "gsr error: unknown gpu vendor: %s\n", gl_vendor); - supported = false; - goto end; + return false; } if(gl_renderer) { @@ -403,8 +399,7 @@ bool gl_get_gpu_info(gsr_egl *egl, gsr_gpu_info *info) { info->is_steam_deck = strstr(gl_renderer, "vangogh") != NULL; } - end: - return supported; + return true; } bool try_card_has_valid_plane(const char *card_path) { |
