diff options
author | Jason Ekstrand <[email protected]> | 2017-10-11 12:09:02 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-10-12 21:47:06 -0700 |
commit | 4d56ff0a714adfd763149ce98e3fa7437e14abac (patch) | |
tree | d030c08874cac33a3facc41f85f2604398348727 /src/compiler/blob.c | |
parent | 3af1c829891a4530682bce113fdd512d4f2de3c6 (diff) |
compiler/blob: Constify the reader
Reviewed-by: Nicolai Hähnle <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/compiler/blob.c')
-rw-r--r-- | src/compiler/blob.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/blob.c b/src/compiler/blob.c index 5375c647b02..5c94beed842 100644 --- a/src/compiler/blob.c +++ b/src/compiler/blob.c @@ -238,10 +238,10 @@ blob_write_string(struct blob *blob, const char *str) } void -blob_reader_init(struct blob_reader *blob, uint8_t *data, size_t size) +blob_reader_init(struct blob_reader *blob, const uint8_t *data, size_t size) { blob->data = data; - blob->end = data + size; + blob->end = blob->data + size; blob->current = data; blob->overrun = false; } @@ -264,10 +264,10 @@ ensure_can_read(struct blob_reader *blob, size_t size) return false; } -void * +const void * blob_read_bytes(struct blob_reader *blob, size_t size) { - void *ret; + const void *ret; if (! ensure_can_read (blob, size)) return NULL; @@ -282,7 +282,7 @@ blob_read_bytes(struct blob_reader *blob, size_t size) void blob_copy_bytes(struct blob_reader *blob, uint8_t *dest, size_t size) { - uint8_t *bytes; + const uint8_t *bytes; bytes = blob_read_bytes(blob, size); if (bytes == NULL) |