From: Chad Versace Date: Thu, 11 Aug 2016 15:28:57 +0000 (-0700) Subject: mesa: Document that _mesa_enum_to_string() returns non-null (v2) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd93cbc8945e182ab3130eeeb074fae798e5d4af;p=mesa.git 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 Reviewed-by: Ian Romanick Change-Id: I26e8843c96130be972e66f48a49e362442e1bf97 --- diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py index 62cc1b36300..2eb9e1642cc 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;