libibmad: To fix compilation warning: need typecasts
PATCH 1/1 libibmad: To fix compilation warning: need typecasts
From: Brendan Doyle <[email protected]>
---include/infiniband/mad.h | 12 ++++++++----src/fields.c | 8 ++++----
2 files changed, 12 insertions(+), 8 deletions(-)
include/infiniband/mad.h +0 -0
@@ -1655,14 +1655,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)
src/fields.c +0 -0
@@ -959,15 +959,15 @@ static void _set_field64(void *buf, int base_offs, const ib_field_t * f,
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);
}Signature · 7 lines
1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html