#include "ares.h"
#include "inet_net_pton.h"
#include "ares_library_init.h"
+#include "ares_nowarn.h"
#include "ares_private.h"
#ifdef ANDROID
q++;
val = try_option(p, q, "ndots:");
if (val && channel->ndots == -1)
- channel->ndots = (int)strtol(val, NULL, 10);
+ channel->ndots = aresx_sltosi(strtol(val, NULL, 10));
val = try_option(p, q, "retrans:");
if (val && channel->timeout == -1)
- channel->timeout = (int)strtol(val, NULL, 10);
+ channel->timeout = aresx_sltosi(strtol(val, NULL, 10));
val = try_option(p, q, "retry:");
if (val && channel->tries == -1)
- channel->tries = (int)strtol(val, NULL, 10);
+ channel->tries = aresx_sltosi(strtol(val, NULL, 10));
val = try_option(p, q, "rotate");
if (val && channel->rotate == -1)
channel->rotate = 1;
# pragma warning(pop)
#endif
}
+
+/*
+** signed long to signed int
+*/
+
+int aresx_sltosi(long slnum)
+{
+#ifdef __INTEL_COMPILER
+# pragma warning(push)
+# pragma warning(disable:810) /* conversion may lose significant bits */
+#endif
+
+ return (int)(slnum & (long) CARES_MASK_SINT);
+
+#ifdef __INTEL_COMPILER
+# pragma warning(pop)
+#endif
+}