move malloc implementation types and macros to an internal header
[musl] / src / internal / stdio_impl.h
index 0dd7fb5..1127a49 100644 (file)
@@ -9,7 +9,7 @@
 
 #define FFINALLOCK(f) ((f)->lock>=0 ? __lockfile((f)) : 0)
 #define FLOCK(f) int __need_unlock = ((f)->lock>=0 ? __lockfile((f)) : 0)
-#define FUNLOCK(f) if (__need_unlock) __unlockfile((f)); else
+#define FUNLOCK(f) do { if (__need_unlock) __unlockfile((f)); } while (0)
 
 #define F_PERM 1
 #define F_NORD 4
@@ -86,7 +86,8 @@ void __ofl_unlock(void);
 #define getc_unlocked(f) \
        ( ((f)->rpos < (f)->rend) ? *(f)->rpos++ : __uflow((f)) )
 
-#define putc_unlocked(c, f) ( ((c)!=(f)->lbf && (f)->wpos<(f)->wend) \
+#define putc_unlocked(c, f) \
+       ( ((unsigned char)(c)!=(f)->lbf && (f)->wpos<(f)->wend) \
        ? *(f)->wpos++ = (c) : __overflow((f),(c)) )
 
 /* Caller-allocated FILE * operations */