ucx/printf.c

changeset 852
83fdf679df99
parent 816
839fefbdedc7
--- a/ucx/printf.c	Thu Nov 28 17:53:13 2024 +0100
+++ b/ucx/printf.c	Mon Jan 06 21:18:36 2025 +0100
@@ -34,12 +34,12 @@
 #ifndef CX_PRINTF_SBO_SIZE
 #define CX_PRINTF_SBO_SIZE 512
 #endif
-unsigned const cx_printf_sbo_size = CX_PRINTF_SBO_SIZE;
+const unsigned cx_printf_sbo_size = CX_PRINTF_SBO_SIZE;
 
 int cx_fprintf(
         void *stream,
         cx_write_func wfc,
-        char const *fmt,
+        const char *fmt,
         ...
 ) {
     int ret;
@@ -53,7 +53,7 @@
 int cx_vfprintf(
         void *stream,
         cx_write_func wfc,
-        char const *fmt,
+        const char *fmt,
         va_list ap
 ) {
     char buf[CX_PRINTF_SBO_SIZE];
@@ -69,10 +69,10 @@
     } else {
         int len = ret + 1;
         char *newbuf = malloc(len);
-        if (!newbuf) {
+        if (!newbuf) { // LCOV_EXCL_START
             va_end(ap2);
             return -1;
-        }
+        } // LCOV_EXCL_STOP
 
         ret = vsnprintf(newbuf, len, fmt, ap2);
         va_end(ap2);
@@ -85,8 +85,8 @@
 }
 
 cxmutstr cx_asprintf_a(
-        CxAllocator const *allocator,
-        char const *fmt,
+        const CxAllocator *allocator,
+        const char *fmt,
         ...
 ) {
     va_list ap;
@@ -97,8 +97,8 @@
 }
 
 cxmutstr cx_vasprintf_a(
-        CxAllocator const *a,
-        char const *fmt,
+        const CxAllocator *a,
+        const char *fmt,
         va_list ap
 ) {
     cxmutstr s;

mercurial