]> sigrok.org Git - libsigrok.git/blobdiff - libsigrok-internal.h
Add initial support for the UNI-T UT60G.
[libsigrok.git] / libsigrok-internal.h
index b3eeb8dbbb5931378e2e186176c0c9b7458206e7..2577fd0dcd981202b927e9d95dbb5ee633c61d47 100644 (file)
  * @param x a pointer to the input memory
  * @return the corresponding integer
  */
-#define RB16(x)  ((((const uint8_t*)(x))[0] <<  8) |  \
-                   ((const uint8_t*)(x))[1])
+#define RB16(x)  (((unsigned)((const uint8_t*)(x))[0] <<  8) |  \
+                   (unsigned)((const uint8_t*)(x))[1])
 
 /**
  * Read a 16 bits little endian integer out of memory.
  * @param x a pointer to the input memory
  * @return the corresponding integer
  */
-#define RL16(x)  ((((const uint8_t*)(x))[1] <<  8) |  \
-                   ((const uint8_t*)(x))[0])
+#define RL16(x)  (((unsigned)((const uint8_t*)(x))[1] <<  8) | \
+                   (unsigned)((const uint8_t*)(x))[0])
 
 /**
  * Read a 32 bits big endian integer out of memory.
  * @param x a pointer to the input memory
  * @return the corresponding integer
  */
-#define RB32(x)  ((((const uint8_t*)(x))[0] << 24) |  \
-                  (((const uint8_t*)(x))[1] << 16) |  \
-                  (((const uint8_t*)(x))[2] <<  8) |  \
-                   ((const uint8_t*)(x))[3])
+#define RB32(x)  (((unsigned)((const uint8_t*)(x))[0] << 24) | \
+                  ((unsigned)((const uint8_t*)(x))[1] << 16) |  \
+                  ((unsigned)((const uint8_t*)(x))[2] <<  8) |  \
+                   (unsigned)((const uint8_t*)(x))[3])
 
 /**
  * Read a 32 bits little endian integer out of memory.
  * @param x a pointer to the input memory
  * @return the corresponding integer
  */
-#define RL32(x)  ((((const uint8_t*)(x))[3] << 24) |  \
-                  (((const uint8_t*)(x))[2] << 16) |  \
-                  (((const uint8_t*)(x))[1] <<  8) |  \
-                   ((const uint8_t*)(x))[0])
+#define RL32(x)  (((unsigned)((const uint8_t*)(x))[3] << 24) | \
+                  ((unsigned)((const uint8_t*)(x))[2] << 16) |  \
+                  ((unsigned)((const uint8_t*)(x))[1] <<  8) |  \
+                   (unsigned)((const uint8_t*)(x))[0])
 
 /* Portability fixes for FreeBSD. */
 #ifdef __FreeBSD__
@@ -514,6 +514,7 @@ SR_PRIV void sr_fs9721_00_temp_c(struct sr_datafeed_analog *analog, void *info);
 SR_PRIV void sr_fs9721_01_temp_c(struct sr_datafeed_analog *analog, void *info);
 SR_PRIV void sr_fs9721_10_temp_c(struct sr_datafeed_analog *analog, void *info);
 SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog *analog, void *info);
+SR_PRIV void sr_fs9721_max_c_min(struct sr_datafeed_analog *analog, void *info);
 
 /*--- hardware/common/dmm/m2110.c -----------------------------------------*/