Mesa (master): mesa: const qualify, return bool for _mesa_texture_view_compatible_format()

Brian Paul brianp at kemper.freedesktop.org
Tue May 26 16:00:14 UTC 2015


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri May 22 16:42:21 2015 -0700

mesa: const qualify, return bool for _mesa_texture_view_compatible_format()

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>

---

 src/mesa/main/textureview.c |   12 ++++++------
 src/mesa/main/textureview.h |    4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/textureview.c b/src/mesa/main/textureview.c
index cd87a27..a1cbec5 100644
--- a/src/mesa/main/textureview.c
+++ b/src/mesa/main/textureview.c
@@ -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
diff --git a/src/mesa/main/textureview.h b/src/mesa/main/textureview.h
index 549a13c..596a3a8 100644
--- a/src/mesa/main/textureview.h
+++ b/src/mesa/main/textureview.h
@@ -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);
 




More information about the mesa-commit mailing list