fix compiler warning

pull/1/head
Yang Tse 15 years ago
parent d2f21d37b1
commit 157d68729f
  1. 20
      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;

Loading…
Cancel
Save