<div dir="ltr">Reviewed-by: Elie Tournier <<a href="mailto:tournier.elie@gmail.com">tournier.elie@gmail.com</a>></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-20 23:20 GMT+01:00 Christian Gmeiner <span dir="ltr"><<a href="mailto:christian.gmeiner@gmail.com" target="_blank">christian.gmeiner@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">size_t is defined in the C Standard section 4.1.5 as an<br>
'unsigned integral type'.<br>
<br>
Fixes the following clang compile warning:<br>
<br>
glsl/blob.c:110:15: warning: comparison of unsigned expression < 0 is<br>
always false [-Wtautological-compare]<br>
if (offset < 0 || blob->size - offset < to_write)<br>
~~~~~~ ^ ~<br>
<br>
Signed-off-by: Christian Gmeiner <<a href="mailto:christian.gmeiner@gmail.com">christian.gmeiner@gmail.com</a>><br>
---<br>
src/compiler/glsl/blob.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/compiler/glsl/blob.c b/src/compiler/glsl/blob.c<br>
index dd4341b..ef17255 100644<br>
--- a/src/compiler/glsl/blob.c<br>
+++ b/src/compiler/glsl/blob.c<br>
@@ -107,7 +107,7 @@ blob_overwrite_bytes(struct blob *blob,<br>
size_t to_write)<br>
{<br>
/* Detect an attempt to overwrite data out of bounds. */<br>
- if (offset < 0 || blob->size - offset < to_write)<br>
+ if (blob->size - offset < to_write)<br>
return false;<br>
<br>
memcpy(blob->data + offset, bytes, to_write);<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.9.3<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>