Index: include/roaraudio/caps.h
===================================================================
--- include/roaraudio/caps.h	(revision 4708)
+++ include/roaraudio/caps.h	(revision 5210)
@@ -38,16 +38,16 @@
 
 // standard vendors:
-#define ROAR_STDV_ROARAUDIO      0
-#define ROAR_STDV_PROTO          1
-#define ROAR_STDV_RFC            2
+#define ROAR_STDV_ROARAUDIO      ((uint32_t)0)
+#define ROAR_STDV_PROTO          ((uint32_t)1)
+#define ROAR_STDV_RFC            ((uint32_t)2)
 
 // data macros for standards:
-#define ROAR_STD_MASK_VENDOR     0xFF000000
-#define ROAR_STD_MASK_STD        0x00FFFF00
-#define ROAR_STD_MASK_VERSION    0x000000FF
+#define ROAR_STD_MASK_VENDOR     ((uint32_t)0xFF000000)
+#define ROAR_STD_MASK_STD        ((uint32_t)0x00FFFF00)
+#define ROAR_STD_MASK_VERSION    ((uint32_t)0x000000FF)
 
-#define ROAR_STD_MAKE(vendor,standard,version) ((((vendor)   & 0x00FF) << 24) | \
-                                                (((standard) & 0xFFFF) <<  8) | \
-                                                 ((version)  & 0x00FF)        )
+#define ROAR_STD_MAKE(vendor,standard,version) ((((uint32_t)(vendor)   & 0x00FF) << 24) | \
+                                                (((uint32_t)(standard) & 0xFFFF) <<  8) | \
+                                                 ((uint32_t)(version)  & 0x00FF)        )
 
 #define ROAR_STD_MAKE_RFC(rfc) ROAR_STD_MAKE(ROAR_STDV_RFC, (rfc), 0)
Index: include/roaraudio/muconthacks.h
===================================================================
--- include/roaraudio/muconthacks.h	(revision 5015)
+++ include/roaraudio/muconthacks.h	(revision 5210)
@@ -47,4 +47,5 @@
 #define O_NONBLOCK     0x04
 #define O_CREAT        0x08
+#define O_TRUNC        0x10
 
 #define EAGAIN         11
Index: include/roaraudio/notify.h
===================================================================
--- include/roaraudio/notify.h	(revision 4841)
+++ include/roaraudio/notify.h	(revision 5210)
@@ -34,21 +34,21 @@
 #define ROAR_EVENT_NETFLAG_PROXYEVENT  0x00000002
 
-#define ROAR_NOTIFY_SPECIAL       0xffffffff
+#define ROAR_NOTIFY_SPECIAL       (uint32_t)0xffffffff
 
 // protocol cmds:
-#define ROAR_NOTIFY_OFFSET_CMD    0x00000000
-#define ROAR_NOTIFY_MASK_CMD      0x000000ff
+#define ROAR_NOTIFY_OFFSET_CMD    (uint32_t)0x00000000
+#define ROAR_NOTIFY_MASK_CMD      (uint32_t)0x000000ff
 
 // event groups (AKA meta events):
-#define ROAR_NOTIFY_OFFSET_EGRP    0x00010000
-#define ROAR_NOTIFY_MASK_EGRP      0x0000ffff
+#define ROAR_NOTIFY_OFFSET_EGRP   (uint32_t)0x00010000
+#define ROAR_NOTIFY_MASK_EGRP     (uint32_t)0x0000ffff
 
 // object event:
-#define ROAR_NOTIFY_OFFSET_OE    0x00020000
-#define ROAR_NOTIFY_MASK_OE      0x0000ffff
+#define ROAR_NOTIFY_OFFSET_OE     (uint32_t)0x00020000
+#define ROAR_NOTIFY_MASK_OE       (uint32_t)0x0000ffff
 
 // user defined events:
-#define ROAR_NOTIFY_OFFSET_USER   0x40000000
-#define ROAR_NOTIFY_MASK_USER     0x3fffffff
+#define ROAR_NOTIFY_OFFSET_USER   (uint32_t)0x40000000
+#define ROAR_NOTIFY_MASK_USER     (uint32_t)0x3fffffff
 
 #define ROAR_NOTIFY_X2EVENT(x,offset,mask) ((x) == -1 ? ROAR_NOTIFY_SPECIAL : (((x) & (mask))+(offset)))
Index: include/roaraudio/units.h
===================================================================
--- include/roaraudio/units.h	(revision 4708)
+++ include/roaraudio/units.h	(revision 5210)
@@ -35,7 +35,7 @@
 #define _ONE    1
 #define _KILO   1000
-#define _MEGA   (_KILO*_KILO)
-#define _GIGA   (_KILO*_MEGA)
-#define _TERA   (_KILO*_GIGA)
+#define _MEGA   ((int_least32_t)_KILO*(int_least32_t)_KILO)
+#define _GIGA   ((int_least32_t)_KILO*_MEGA)
+#define _TERA   ((int_least32_t)_KILO*_GIGA)
 
 
@@ -43,15 +43,22 @@
 #ifndef _SEC
 #if defined(_UNITS_T_BASE_MSEC)
-#define _SEC  1000
+#define _SEC_TYPE int_least32_t
+#define _SEC  (_SEC_TYPE)1000
 #elif defined(_UNITS_T_BASE_USEC)
-#define _SEC  1000000
+#define _SEC_TYPE int_least32_t
+#define _SEC  (_SEC_TYPE)1000000
 //#elif defined(_UNITS_T_BASE_SEC)
 #else
 #define _SEC  1
+#define _SEC_TYPE int
 #endif
 #endif
 
-#define _MIN  (60*_SEC)
-#define _HOUR (60*_MIN)
+#ifndef _SEC_TYPE
+#define _SEC_TYPE int_least32_t
+#endif
+
+#define _MIN  ((_SEC_TYPE)60*_SEC)
+#define _HOUR ((_SEC_TYPE)60*_MIN)
 
 #define _MSEC (_SEC*_MILI)
@@ -62,14 +69,21 @@
 #ifndef _METER
 #if defined(_UNITS_D_BASE_MMETER)
+#define _METER_TYPE int
 #define _METER 1000
 #elif defined(_UNITS_D_BASE_UMETER)
-#define _METER 1000000
+#define _METER_TYPE int_least32_t
+#define _METER (_METER_TYPE)1000000
 //#elif defined(_UNITS_D_BASE_METER)
 #else
+#define _METER_TYPE int
 #define _METER 1
 #endif
 #endif
 
-#define _AE    (149597870691LL     *_METER)
+#ifndef _METER_TYPE
+#define _METER_TYPE int_least32_t
+#endif
+
+#define _AE    ((int_least64_t)149597870691LL     *_METER)
 #define _LJ    (9460730472580800LL *_METER)
 #define _PC    (30856804413117847LL*_METER) /* TODO: FIXME: get a more corret value */
