Mesa (master): mesa: change assert to unreachable in two format functions

Matt Turner mattst88 at kemper.freedesktop.org
Wed Jan 21 21:16:23 UTC 2015


Module: Mesa
Branch: master
Commit: 76086d7120152ebced634875889612d0c40a37bb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=76086d7120152ebced634875889612d0c40a37bb

Author: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de>
Date:   Mon Jan 19 21:51:38 2015 +0100

mesa: change assert to unreachable in two format functions

This fixes two problems reported by osc:
I: Program returns random data in a function
E: Mesa no-return-in-nonvoid-function ../../src/mesa/main/format_utils.c:180
E: Mesa no-return-in-nonvoid-function ../../src/mesa/main/glformats.c:2714

Reviewed-by: Matt Turner <mattst88 at gmail.com>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de>

---

 src/mesa/main/format_utils.c |    2 +-
 src/mesa/main/glformats.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
index eb650a2..4b44bef 100644
--- a/src/mesa/main/format_utils.c
+++ b/src/mesa/main/format_utils.c
@@ -175,7 +175,7 @@ _mesa_compute_rgba2base2rgba_component_mapping(GLenum baseFormat, uint8_t *map)
          return needRebase;
       }
    default:
-      assert(!"Unexpected base format");
+      unreachable("Unexpected base format");
    }
 }
 
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 06f9aaf..ff15383 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -2712,5 +2712,5 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)
     * matches the GL format/type provided. We may need to add a new Mesa
     * format in that case.
     */
-   assert(!"Unsupported format");
+   unreachable("Unsupported format");
 }




More information about the mesa-commit mailing list