Mesa (master): mesa: fix truncated value warning

Dylan Noblesmith nobled at kemper.freedesktop.org
Fri Apr 13 14:30:14 UTC 2012


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

Author: Dylan Noblesmith <nobled at dreamwidth.org>
Date:   Sun Apr  1 18:59:28 2012 +0000

mesa: fix truncated value warning

Silences a clang warning:

format_pack.c:2546:30: warning: implicit conversion from 'int' to
'GLubyte' (aka 'unsigned char') changes value from 65535 to 255
[-Wconstant-conversion]
               d[i] = d[i] ? 0xffff : 0x0;
                           ~ ^~~~~~

Reviewed-by: Brian Paul <brianp at vmware.com>

---

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

diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c
index ff08ac5..7f0bda1 100644
--- a/src/mesa/main/format_pack.c
+++ b/src/mesa/main/format_pack.c
@@ -2605,7 +2605,7 @@ _mesa_pack_colormask(gl_format format, const GLubyte colorMask[4], void *dst)
          if (bits == 8) {
             GLubyte *d = (GLubyte *) dst;
             for (i = 0; i < bytes; i++) {
-               d[i] = d[i] ? 0xffff : 0x0;
+               d[i] = d[i] ? 0xff : 0x0;
             }
          }
          else if (bits == 16) {




More information about the mesa-commit mailing list