libibmad: To fix compilation warning: need typecasts Signed-off-by: Brendan Doyle diff -uprN ./SOURCES/libibmad-1.3.9/src/fields.c ./SOURCES/libibmad-1.3.9.fix_typecasts/src/fields.c --- ./SOURCES/libibmad-1.3.9/src/fields.c 2012-04-30 13:42:47.000000000 -0700 +++ ./SOURCES/libibmad-1.3.9.fix_typecasts/src/fields.c 2013-02-13 15:32:03.000000000 -0800 @@ -937,15 +937,15 @@ static void _set_field64(void *buf, int uint64_t nval; nval = htonll(val); - memcpy((char *)buf + base_offs + f->bitoffs / 8, &nval, - sizeof(uint64_t)); + memcpy(((void *)(char *)buf + base_offs + f->bitoffs / 8), + (void *)&nval, sizeof(uint64_t)); } static uint64_t _get_field64(void *buf, int base_offs, const ib_field_t * f) { uint64_t val; - memcpy(&val, ((char *)buf + base_offs + f->bitoffs / 8), - sizeof(uint64_t)); + memcpy((void *)&val, (void *)((char *)buf + base_offs + f->bitoffs / 8), + sizeof(uint64_t)); return ntohll(val); } diff -uprN ./SOURCES/libibmad-1.3.9/include/infiniband/mad.h ./SOURCES/libibmad-1.3.9.fix_typecasts/include/infiniband/mad.h --- ./SOURCES/libibmad-1.3.9/include/infiniband/mad.h 2012-04-30 13:42:43.000000000 -0700 +++ ./SOURCES/libibmad-1.3.9.fix_typecasts/include/infiniband/mad.h 2013-02-13 15:43:52.000000000 -0800 @@ -1627,14 +1627,18 @@ static inline uint64_t htonll(uint64_t x #define ALIGN(l, size) (((l) + ((size) - 1)) / (size) * (size)) /** printf style warning MACRO, includes name of function and pid */ -#define IBWARN(fmt, ...) fprintf(stderr, "ibwarn: [%d] %s: " fmt "\n", getpid(), __func__, ## __VA_ARGS__) +#define IBWARN(fmt, ...) fprintf(stderr, "ibwarn: [%d] %s: " fmt "\n", \ +(int)getpid(), __func__, ## __VA_ARGS__) -#define IBDEBUG(fmt, ...) fprintf(stdout, "ibdebug: [%d] %s: " fmt "\n", getpid(), __func__, ## __VA_ARGS__) +#define IBDEBUG(fmt, ...) fprintf(stdout, "ibdebug: [%d] %s: " fmt "\n", \ +(int)getpid(), __func__, ## __VA_ARGS__) -#define IBVERBOSE(fmt, ...) fprintf(stdout, "[%d] %s: " fmt "\n", getpid(), __func__, ## __VA_ARGS__) +#define IBVERBOSE(fmt, ...) fprintf(stdout, "[%d] %s: " fmt "\n", \ +(int)getpid(), __func__, ## __VA_ARGS__) #define IBPANIC(fmt, ...) do { \ - fprintf(stderr, "ibpanic: [%d] %s: " fmt ": %m\n", getpid(), __func__, ## __VA_ARGS__); \ + fprintf(stderr, "ibpanic: [%d] %s: " fmt ": %m\n", \ + (int)getpid(), __func__, ## __VA_ARGS__); \ exit(-1); \ } while(0)