size_t is defined in the C Standard section 4.1.5 as an 'unsigned integral type'.
Fixes the following clang compile warning: glsl/blob.c:110:15: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (offset < 0 || blob->size - offset < to_write) ~~~~~~ ^ ~ Signed-off-by: Christian Gmeiner <christian.gmei...@gmail.com> --- src/compiler/glsl/blob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/glsl/blob.c b/src/compiler/glsl/blob.c index dd4341b..ef17255 100644 --- a/src/compiler/glsl/blob.c +++ b/src/compiler/glsl/blob.c @@ -107,7 +107,7 @@ blob_overwrite_bytes(struct blob *blob, size_t to_write) { /* Detect an attempt to overwrite data out of bounds. */ - if (offset < 0 || blob->size - offset < to_write) + if (blob->size - offset < to_write) return false; memcpy(blob->data + offset, bytes, to_write); -- 2.9.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev