ucx/buffer.c

branch
newapi
changeset 324
ce13a778654a
parent 253
087cc9216f28
--- a/ucx/buffer.c	Thu Oct 03 18:54:19 2024 +0200
+++ b/ucx/buffer.c	Sun Oct 06 12:00:31 2024 +0200
@@ -36,7 +36,7 @@
         CxBuffer *buffer,
         void *space,
         size_t capacity,
-        CxAllocator const *allocator,
+        const CxAllocator *allocator,
         int flags
 ) {
     if (allocator == NULL) allocator = cxDefaultAllocator;
@@ -73,7 +73,7 @@
 CxBuffer *cxBufferCreate(
         void *space,
         size_t capacity,
-        CxAllocator const *allocator,
+        const CxAllocator *allocator,
         int flags
 ) {
     CxBuffer *buf = cxMalloc(allocator, sizeof(CxBuffer));
@@ -140,7 +140,7 @@
     buffer->pos = 0;
 }
 
-int cxBufferEof(CxBuffer const *buffer) {
+int cxBufferEof(const CxBuffer *buffer) {
     return buffer->pos >= buffer->size;
 }
 
@@ -172,7 +172,7 @@
  */
 static size_t cx_buffer_write_flush_helper(
         CxBuffer *buffer,
-        unsigned char const *space,
+        const unsigned char *space,
         size_t size,
         size_t nitems
 ) {
@@ -197,7 +197,7 @@
 }
 
 size_t cxBufferWrite(
-        void const *ptr,
+        const void *ptr,
         size_t size,
         size_t nitems,
         CxBuffer *buffer
@@ -273,7 +273,7 @@
             items_keep = nitems - items_flush;
             if (items_keep > 0) {
                 // try again with the remaining stuff
-                unsigned char const *new_ptr = ptr;
+                const unsigned char *new_ptr = ptr;
                 new_ptr += items_flush * size;
                 // report the directly flushed items as written plus the remaining stuff
                 return items_flush + cxBufferWrite(new_ptr, size, items_keep, buffer);

mercurial