From 10affed097df354f1b9db8602cd7257f76d10654 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 21 Feb 2010 19:59:09 +0000 Subject: fix compiler warning --- ares/ares_data.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'ares') diff --git a/ares/ares_data.c b/ares/ares_data.c index 16a5cc507..ee7601856 100644 --- a/ares/ares_data.c +++ b/ares/ares_data.c @@ -45,8 +45,18 @@ void ares_free_data(void *dataptr) if (!dataptr) return; +#ifdef __INTEL_COMPILER +# pragma warning(push) +# pragma warning(disable:1684) + /* 1684: conversion from pointer to same-sized integral type */ +#endif + ptr = (void *)((char *)dataptr - offsetof(struct ares_data, data)); +#ifdef __INTEL_COMPILER +# pragma warning(pop) +#endif + if (ptr->mark != ARES_DATATYPE_MARK) return; @@ -134,8 +144,18 @@ ares_datatype ares_get_datatype(void * dataptr) { struct ares_data *ptr; +#ifdef __INTEL_COMPILER +# pragma warning(push) +# pragma warning(disable:1684) + /* 1684: conversion from pointer to same-sized integral type */ +#endif + ptr = (void *)((char *)dataptr - offsetof(struct ares_data, data)); +#ifdef __INTEL_COMPILER +# pragma warning(pop) +#endif + if (ptr->mark == ARES_DATATYPE_MARK) return ptr->type; -- cgit v1.2.1