util: Include bitscan.h directly
[mesa.git] / src / compiler / blob.c
index f0fa85e5bebd07f04f203ca2af3ba0021fdd2190..5e8671b7b4450b82ea8fc4151bb03801576d9c08 100644 (file)
@@ -158,10 +158,10 @@ blob_write_bytes(struct blob *blob, const void *bytes, size_t to_write)
    return true;
 }
 
-ssize_t
+intptr_t
 blob_reserve_bytes(struct blob *blob, size_t to_write)
 {
-   ssize_t ret;
+   intptr_t ret;
 
    if (! grow_to_fit (blob, to_write))
       return -1;
@@ -172,14 +172,14 @@ blob_reserve_bytes(struct blob *blob, size_t to_write)
    return ret;
 }
 
-ssize_t
+intptr_t
 blob_reserve_uint32(struct blob *blob)
 {
    align_blob(blob, sizeof(uint32_t));
    return blob_reserve_bytes(blob, sizeof(uint32_t));
 }
 
-ssize_t
+intptr_t
 blob_reserve_intptr(struct blob *blob)
 {
    align_blob(blob, sizeof(intptr_t));
@@ -256,7 +256,7 @@ ensure_can_read(struct blob_reader *blob, size_t size)
    if (blob->overrun)
       return false;
 
-   if (blob->current < blob->end && blob->end - blob->current >= size)
+   if (blob->current <= blob->end && blob->end - blob->current >= size)
       return true;
 
    blob->overrun = true;