Mesa (master): mesa: Document that _mesa_enum_to_string() returns non-null (v2)

Chad Versace chadversary at kemper.freedesktop.org
Fri Aug 12 16:15:20 UTC 2016


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

Author: Chad Versace <chad at kiwitree.net>
Date:   Thu Aug 11 08:28:57 2016 -0700

mesa: Document that _mesa_enum_to_string() returns non-null (v2)

It always returns non-null, even if the number is an invalid enum.

Cc: Haixia Shi <hshi at chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Change-Id: I26e8843c96130be972e66f48a49e362442e1bf97

---

 src/mapi/glapi/gen/gl_enums.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py
index 62cc1b3..2eb9e16 100644
--- a/src/mapi/glapi/gen/gl_enums.py
+++ b/src/mapi/glapi/gen/gl_enums.py
@@ -83,7 +83,12 @@ static int compar_nr( const int *a, enum_elt *b )
 
 static char token_tmp[20];
 
-const char *_mesa_enum_to_string( int nr )
+/**
+ * This function always returns a string. If the number is a valid enum, it
+ * returns the enum name. Otherwise, it returns a numeric string.
+ */
+const char *
+_mesa_enum_to_string(int nr)
 {
    enum_elt *elt;
 




More information about the mesa-commit mailing list