mesa: const qualify, return bool for _mesa_texture_view_compatible_format()
authorBrian Paul <brianp@vmware.com>
Fri, 22 May 2015 23:42:21 +0000 (16:42 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 26 May 2015 15:58:09 +0000 (09:58 -0600)
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/main/textureview.c
src/mesa/main/textureview.h

index cd87a27d2dbd762f53b998b796655d2c6fcfe576..a1cbec5b365067fb2b7f7c4212c3ea1f4f422e7a 100644 (file)
@@ -167,7 +167,7 @@ static const struct internal_format_class_info s3tc_compatible_internal_formats[
  * \return VIEW_CLASS if internalformat found in table, false otherwise.
  */
 static GLenum
-lookup_view_class(struct gl_context *ctx, GLenum internalformat)
+lookup_view_class(const struct gl_context *ctx, GLenum internalformat)
 {
    GLuint i;
 
@@ -320,8 +320,8 @@ target_valid(struct gl_context *ctx, GLenum origTarget, GLenum newTarget)
  * If an error is found, record it with _mesa_error()
  * \return false if any error, true otherwise.
  */
-GLboolean
-_mesa_texture_view_compatible_format(struct gl_context *ctx,
+bool
+_mesa_texture_view_compatible_format(const struct gl_context *ctx,
                                      GLenum origInternalFormat,
                                      GLenum newInternalFormat)
 {
@@ -334,14 +334,14 @@ _mesa_texture_view_compatible_format(struct gl_context *ctx,
     * or an INVALID_OPERATION error is generated.
     */
    if (origInternalFormat == newInternalFormat)
-      return GL_TRUE;
+      return true;
 
    origViewClass = lookup_view_class(ctx, origInternalFormat);
    newViewClass = lookup_view_class(ctx, newInternalFormat);
    if ((origViewClass == newViewClass) && origViewClass != false)
-      return GL_TRUE;
+      return true;
 
-   return GL_FALSE;
+   return false;
 }
 /**
  * Helper function for TexStorage and teximagemultisample to set immutable
index 549a13cd809fda8d0326c4e6a27b6d1d834b36d0..596a3a8dbbe793cfbe84ba8ce27891216fbc6201 100644 (file)
@@ -29,8 +29,8 @@
 #ifndef TEXTUREVIEW_H
 #define TEXTUREVIEW_H
 
-GLboolean
-_mesa_texture_view_compatible_format(struct gl_context *ctx,
+bool
+_mesa_texture_view_compatible_format(const struct gl_context *ctx,
                                      GLenum origInternalFormat,
                                      GLenum newInternalFormat);