shithub: femtolisp

Download patch

ref: 0619fc6c8de5628a3682b0888c53e11a09889f54
parent: 6bd02b4a8d25b4dcf8095044ff820e3302153e92
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Fri Mar 10 11:21:57 EST 2023

fix more cosmetic stuff

--- a/cvalues.c
+++ b/cvalues.c
@@ -1118,7 +1118,7 @@
 {
     if (isfixnum(n)) {
         fixnum_t s = fixnum(-numval(n));
-        if (__unlikely(s == n))
+        if (__unlikely((value_t)s == n))
             return mk_xlong(-numval(n));
         else
             return s;
--- a/flisp.h
+++ b/flisp.h
@@ -1,12 +1,9 @@
 #ifndef FLISP_H
 #define FLISP_H
 
-#ifdef PLAN9
-#define __attribute__(...)
-#else
+#ifndef PLAN9
 #include <setjmp.h>
 #include <stdint.h>
-#define USED(x) (void)(x)
 #endif
 
 typedef uintptr_t value_t;
--- a/llt/dirpath.c
+++ b/llt/dirpath.c
@@ -120,6 +120,7 @@
     mib[2] = pid;
     mib[3] = KERN_PROC_ARGV;
 
+    USED(size);
     buf = NULL;
     argv = NULL;
     len = 128;
--- a/llt/dtypes.h
+++ b/llt/dtypes.h
@@ -97,6 +97,11 @@
 #  error "unknown platform"
 #endif
 
+#ifdef PLAN9
+#define __attribute__(...)
+#else
+#define USED(x) (void)(x)
+#endif
 
 #ifdef BOEHM_GC
 // boehm GC allocator
--- a/llt/ios.c
+++ b/llt/ios.c
@@ -996,7 +996,7 @@
     va_copy(al, args);
 
     if (s->state == bst_wr && s->bpos < s->maxsize && s->bm != bm_none) {
-        size_t avail = s->maxsize - s->bpos;
+        int avail = s->maxsize - s->bpos;
         char *start = s->buf + s->bpos;
         c = vsnprintf(start, avail, format, args);
         if (c < 0) {