fix build on macOS

Thu, 10 Aug 2023 09:40:54 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 10 Aug 2023 09:40:54 +0200
changeset 785
645f7e802873
parent 784
592ff4ca2aaa
child 786
f9d6e4cbcb62

fix build on macOS

dav/tags.c file | annotate | diff | comparison | revisions
dav/tar.c file | annotate | diff | comparison | revisions
--- a/dav/tags.c	Thu Jul 20 22:15:01 2023 +0200
+++ b/dav/tags.c	Thu Aug 10 09:40:54 2023 +0200
@@ -294,7 +294,7 @@
 }
 
 CxList* parse_macos_taglist(const char *buf, size_t length) {
-    CxList *taglist = cxLinkedListCreate(CX_STORE_POINTERS);
+    CxList *taglist = cxLinkedListCreateSimple(CX_STORE_POINTERS);
     taglist->simple_destructor = (cx_destructor_func)free_dav_tag;
     
     CFDataRef data = CFDataCreateWithBytesNoCopy(
@@ -326,18 +326,18 @@
 }
 
 CxBuffer* create_macos_taglist(CxList *tags) {
-    size_t count = ucx_list_size(tags);
+    size_t count = tags->size;
     if(count == 0) {
         return NULL;
     }
     
     CFStringRef *strings = calloc(sizeof(CFStringRef), count);
     int i = 0;
-    CxIterator i = cxListIterator(tags);
-    cx_foreach(DavTag*, tag, i) {
+    CxIterator iter = cxListIterator(tags);
+    cx_foreach(DavTag*, tag, iter) {
         CFStringRef str = NULL;
         if(tag->color) {
-            sstr_t s = sstrcat(3, sstr(tag->name), S("\n"), sstr(tag->color));
+            cxmutstr s = cx_strcat(3, cx_mutstr(tag->name), CX_STR("\n"), cx_str(tag->color));
             str = CFStringCreateWithCString(kCFAllocatorDefault, s.ptr, kCFStringEncodingUTF8);
             free(s.ptr);
         } else {
--- a/dav/tar.c	Thu Jul 20 22:15:01 2023 +0200
+++ b/dav/tar.c	Thu Aug 10 09:40:54 2023 +0200
@@ -104,7 +104,7 @@
     memset(h.gid, '0', 8);
     h.gid[7] = ' ';
     // size
-    snprintf(h.size, 12, "%011lo", size);
+    snprintf(h.size, 12, "%011lo", (unsigned long)size);
     h.size[11] = ' ';
     // mtime
     uint64_t t = (uint64_t)mtime;

mercurial