From: José Fonseca Date: Fri, 30 Jan 2009 14:06:25 +0000 (+0000) Subject: pipebuffer: Consider 0 as no alignment needed. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7996b3e034f92eeceed3f3e7c01eb1f829d98b18;p=mesa.git pipebuffer: Consider 0 as no alignment needed. --- diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h index 7cba5fa441c..d8f1f02d681 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h @@ -255,7 +255,13 @@ pb_reference(struct pb_buffer **dst, static INLINE boolean pb_check_alignment(size_t requested, size_t provided) { - return requested <= provided && (provided % requested) == 0 ? TRUE : FALSE; + if(!requested) + return TRUE; + if(requested > provided) + return FALSE; + if(provided % requested != 0) + return FALSE; + return TRUE; }