[Mesa-dev] [PATCH 13/19] compiler/blob: Add blob_skip_bytes

Jordan Justen jordan.l.justen at intel.com
Mon May 14 16:52:14 UTC 2018


Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/compiler/blob.c | 7 +++++++
 src/compiler/blob.h | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/src/compiler/blob.c b/src/compiler/blob.c
index 5e8671b7b44..c89092e1cf3 100644
--- a/src/compiler/blob.c
+++ b/src/compiler/blob.c
@@ -291,6 +291,13 @@ blob_copy_bytes(struct blob_reader *blob, void *dest, size_t size)
    memcpy(dest, bytes, size);
 }
 
+void
+blob_skip_bytes(struct blob_reader *blob, size_t size)
+{
+   if (ensure_can_read (blob, size))
+      blob->current += size;
+}
+
 /* These next three read functions have identical form. If we add any beyond
  * these first three we should probably switch to generating these with a
  * preprocessor macro.
diff --git a/src/compiler/blob.h b/src/compiler/blob.h
index 2b975d45dfe..b56fa4b2fe0 100644
--- a/src/compiler/blob.h
+++ b/src/compiler/blob.h
@@ -294,6 +294,12 @@ blob_read_bytes(struct blob_reader *blob, size_t size);
 void
 blob_copy_bytes(struct blob_reader *blob, void *dest, size_t size);
 
+/**
+ * Skip \size bytes within the blob.
+ */
+void
+blob_skip_bytes(struct blob_reader *blob, size_t size);
+
 /**
  * Read a uint32_t from the current location, (and update the current location
  * to just past this uint32_t).
-- 
2.16.2



More information about the mesa-dev mailing list