From: Leandro Lucarella Date: Thu, 8 Dec 2005 07:38:32 +0000 (+0000) Subject: Algunas precauciones extra. X-Git-Tag: 0.1-recibe-matriz-raw-por-udp~21 X-Git-Url: https://git.llucax.com/z.facultad/66.09/etherled.git/commitdiff_plain/de75095b6e1f36831d7a9746ed55e0feb2af6600 Algunas precauciones extra. --- diff --git a/src/types.h b/src/types.h index 3bd0dc6..23910b1 100644 --- a/src/types.h +++ b/src/types.h @@ -37,16 +37,16 @@ typedef bit bool; enum { false = 0, true = 1 }; /** convierte 2 bytes (high, low) en un word */ -#define WORD(high, low) ((uint16)((uint16)(high << 8) + (uint16)low)) +#define WORD(high, low) ((uint16)((uint16)((high) << 8) + (uint16)(low))) /** convierte un word en 2 bytes */ -#define UNPACK(word, high, low) (high = (byte)(word >> 8), \ - low = (byte)word & 0xFF) +#define UNPACK(word, high, low) (high = (byte)((word) >> 8), \ + low = (byte)(word) & 0xFF) /** obtiene parte alta de un word */ -#define HIGH(word) ((byte)(word >> 8)) +#define HIGH(word) ((byte)((word) >> 8)) /** obtiene parte baja de un word */ -#define LOW(word) ((byte)(word & 0xFF)) +#define LOW(word) ((byte)((word) & 0xFF)) #endif /* _TYPES_H_ */