[cogl/wip/hadess/automake-1.16] Add a default fallback case



commit 5c9adb9f39037ddd6a73c312d1c2631d05ad3b23
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Jun 4 12:18:46 2020 +0100

    Add a default fallback case
    
    To avoid using uninitialized variables.

 cogl/driver/gl/cogl-attribute-gl.c           | 2 ++
 cogl/driver/gl/cogl-pipeline-fragend-fixed.c | 3 +++
 cogl/driver/gl/cogl-util-gl.c                | 5 +++++
 3 files changed, 10 insertions(+)
---
diff --git a/cogl/driver/gl/cogl-attribute-gl.c b/cogl/driver/gl/cogl-attribute-gl.c
index 438b0ff9..00f36825 100644
--- a/cogl/driver/gl/cogl-attribute-gl.c
+++ b/cogl/driver/gl/cogl-attribute-gl.c
@@ -82,6 +82,8 @@ toggle_builtin_attribute_enabled_cb (int bit_num, void *user_data)
       case COGL_ATTRIBUTE_NAME_ID_NORMAL_ARRAY:
         cap = GL_NORMAL_ARRAY;
         break;
+      default:
+        return FALSE;
       }
     if (enabled)
       GE (context, glEnableClientState (cap));
diff --git a/cogl/driver/gl/cogl-pipeline-fragend-fixed.c b/cogl/driver/gl/cogl-pipeline-fragend-fixed.c
index d19430ef..1f6c37bf 100644
--- a/cogl/driver/gl/cogl-pipeline-fragend-fixed.c
+++ b/cogl/driver/gl/cogl-pipeline-fragend-fixed.c
@@ -207,6 +207,9 @@ _cogl_pipeline_fragend_fixed_add_layer (CoglPipeline *pipeline,
         case COGL_TEXTURE_TYPE_RECTANGLE:
           gl_target = GL_TEXTURE_RECTANGLE_ARB;
           break;
+
+        default:
+          return FALSE;
         }
 
       _cogl_set_active_texture_unit (unit_index);
diff --git a/cogl/driver/gl/cogl-util-gl.c b/cogl/driver/gl/cogl-util-gl.c
index 2cbd2e45..28c81d2e 100644
--- a/cogl/driver/gl/cogl-util-gl.c
+++ b/cogl/driver/gl/cogl-util-gl.c
@@ -139,6 +139,11 @@ _cogl_gl_util_get_texture_target_string (CoglTextureType texture_type,
       target_string = "2DRect";
       tex_coord_swizzle = "st";
       break;
+
+    default:
+      target_string = NULL;
+      tex_coord_swizzle = NULL;
+      break;
     }
 
   if (target_string_out)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]