<div dir="ltr"><div><div>ping?<br><br></div><div>This patch put away the compiler warning:<br></div>"comparison of constant -1 with expression of type 'gl_buffer_index' is always false"<br></div><br><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-28 19:31 GMT+02:00 Francesco Ansanelli <span dir="ltr"><<a href="mailto:francians@gmail.com" target="_blank">francians@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
src/mesa/main/buffers.c | 10 +++++-----<br>
1 file changed, 5 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c<br>
index e8aedde..3ff6061 100644<br>
--- a/src/mesa/main/buffers.c<br>
+++ b/src/mesa/main/buffers.c<br>
@@ -170,7 +170,7 @@ draw_buffer_enum_to_bitmask(const struct gl_context *ctx, GLenum buffer)<br>
* Helper routine used by glReadBuffer.<br>
* Given a GLenum naming a color buffer, return the index of the corresponding<br>
* renderbuffer (a BUFFER_* value).<br>
- * return -1 for an invalid buffer.<br>
+ * return ~0 for an invalid buffer.<br>
*/<br>
static gl_buffer_index<br>
read_buffer_enum_to_index(GLenum buffer)<br>
@@ -197,7 +197,7 @@ read_buffer_enum_to_index(GLenum buffer)<br>
case GL_AUX1:<br>
case GL_AUX2:<br>
case GL_AUX3:<br>
- return BUFFER_COUNT; /* invalid, but not -1 */<br>
+ return BUFFER_COUNT; /* invalid, but not ~0 */<br>
case GL_COLOR_ATTACHMENT0_EXT:<br>
return BUFFER_COLOR0;<br>
case GL_COLOR_ATTACHMENT1_EXT:<br>
@@ -219,7 +219,7 @@ read_buffer_enum_to_index(GLenum buffer)<br>
if (buffer >= GL_COLOR_ATTACHMENT8 && buffer <= GL_COLOR_ATTACHMENT31)<br>
return BUFFER_COUNT;<br>
/* error */<br>
- return -1;<br>
+ return ~0;<br>
}<br>
}<br>
<br>
@@ -722,11 +722,11 @@ read_buffer(struct gl_context *ctx, struct gl_framebuffer *fb,<br>
else {<br>
/* general case / window-system framebuffer */<br>
if (_mesa_is_gles3(ctx) && !is_legal_es3_readbuffer_enum(buffer))<br>
- srcBuffer = -1;<br>
+ srcBuffer = ~0;<br>
else<br>
srcBuffer = read_buffer_enum_to_index(buffer);<br>
<br>
- if (srcBuffer == -1) {<br>
+ if (srcBuffer == ~0u) {<br>
_mesa_error(ctx, GL_INVALID_ENUM,<br>
"%s(invalid buffer %s)", caller,<br>
_mesa_enum_to_string(buffer));<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<br>
<br>
</font></span></blockquote></div><br></div>