shithub: femtolisp

Download patch

ref: 2b105a52129a3124f1d75273f7b4e01b25ab25df
parent: 8a63b1475410f63d1e73974dcee090204cce4e39
author: Jeff Bezanson <jeff.bezanson@gmail.com>
date: Thu Mar 28 20:35:42 EDT 2013

change wcwidth detection
fix some compiler warnings

--- a/llt/ios.c
+++ b/llt/ios.c
@@ -45,6 +45,7 @@
 extern void *memrchr(const void *s, int c, size_t n);
 #endif
 
+#if 0
 // poll for read, unless forwrite!=0
 static void _fd_poll(long fd, int forwrite)
 {
@@ -60,6 +61,7 @@
 #else
 #endif
 }
+#endif
 
 static int _enonfatal(int err)
 {
@@ -226,7 +228,6 @@
 {
     size_t tot = 0;
     size_t got, avail;
-    int result;
 
     while (n > 0) {
         avail = s->size - s->bpos;
@@ -260,9 +261,9 @@
         if (n > MOST_OF(s->maxsize)) {
             // doesn't fit comfortably in buffer; go direct
             if (all)
-                result = _os_read_all(s->fd, dest, n, &got);
+                _os_read_all(s->fd, dest, n, &got);
             else
-                result = _os_read(s->fd, dest, n, &got);
+                _os_read(s->fd, dest, n, &got);
             tot += got;
             if (got == 0)
                 s->_eof = 1;
--- a/string.c
+++ b/string.c
@@ -47,13 +47,11 @@
     return size_wrap(u8_charnum(str+start, stop-start));
 }
 
-
-#if defined( __WIN32__ ) || defined( __linux__ )
-extern int wcwidth( wchar_t );
+#if defined(__linux__) || (defined(__APPLE__) && defined(__MACH__))
+extern int wcwidth(uint32_t);
 #else
-#  error "I need int wcwidth( wchar_t );"
+#error "wcwidth function not available"
 #endif
-
 
 value_t fl_string_width(value_t *args, u_int32_t nargs)
 {