libauthretry_SOURCES = libauthretry.c $(SUPPORTFILES)
-libntlmconnect_SOURCES = libntlmconnect.c $(SUPPORTFILES) $(TESTUTIL)
+libntlmconnect_SOURCES = libntlmconnect.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
libntlmconnect_LDADD = $(TESTUTIL_LIBS)
#include "test.h"
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
#include <stdio.h>
#include <string.h>
curl_multi_timeout(multi_handle, &curl_timeo);
if(curl_timeo >= 0) {
- timeout.tv_sec = curl_timeo / 1000;
+ int itimeout = (curl_timeo > (long)INT_MAX) ? INT_MAX : (int)curl_timeo;
+ timeout.tv_sec = itimeout / 1000;
if(timeout.tv_sec > 1)
timeout.tv_sec = 1;
else
- timeout.tv_usec = (curl_timeo % 1000) * 1000;
+ timeout.tv_usec = (itimeout % 1000) * 1000;
}
/* get file descriptors from the transfers */
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
#include "test.h"
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
#include "testutil.h"
#include "warnless.h"
#include "memdebug.h"
/* At this point, L is guaranteed to be greater or equal than -1. */
if(L != -1) {
- T.tv_sec = L/1000;
- T.tv_usec = (L%1000)*1000;
+ int itimeout = (L > (long)INT_MAX) ? INT_MAX : (int)L;
+ T.tv_sec = itimeout/1000;
+ T.tv_usec = (itimeout%1000)*1000;
}
else {
T.tv_sec = 5;
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
/* lib591 is used for test cases 591, 592, 593 and 594 */
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
#include <fcntl.h>
#include "testutil.h"
/* At this point, timeout is guaranteed to be greater or equal than -1. */
if(timeout != -1L) {
- interval.tv_sec = timeout/1000;
- interval.tv_usec = (timeout%1000)*1000;
+ int itimeout = (timeout > (long)INT_MAX) ? INT_MAX : (int)timeout;
+ interval.tv_sec = itimeout/1000;
+ interval.tv_usec = (itimeout%1000)*1000;
}
else {
interval.tv_sec = 0;
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
***************************************************************************/
#include "test.h"
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
#include "testutil.h"
#include "warnless.h"
#include "memdebug.h"
/* At this point, timeout is guaranteed to be greater or equal than -1. */
if(timeout != -1L) {
- interval.tv_sec = timeout/1000;
- interval.tv_usec = (timeout%1000)*1000;
+ int itimeout = (timeout > (long)INT_MAX) ? INT_MAX : (int)timeout;
+ interval.tv_sec = itimeout/1000;
+ interval.tv_usec = (itimeout%1000)*1000;
}
else {
interval.tv_sec = TEST_HANG_TIMEOUT/1000+1;
***************************************************************************/
#include "test.h"
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
#include <assert.h>
+
#include "testutil.h"
+#include "warnless.h"
#include "memdebug.h"
#define TEST_HANG_TIMEOUT 5 * 1000
static size_t callback(char* ptr, size_t size, size_t nmemb, void* data)
{
- int idx = ((CURL **) data) - easy;
+ ssize_t idx = ((CURL **) data) - easy;
curl_socket_t sock;
long lastsock;
sockets[idx] = sock;
}
else if (sock != sockets[idx]) {
- fprintf(stderr, "Handle %d started on socket %d and moved to %d\n", idx,
- sockets[idx], sock);
+ fprintf(stderr, "Handle %d started on socket %d and moved to %d\n",
+ curlx_sztosi(idx), (int)sockets[idx], (int)sock);
res = TEST_ERR_MAJOR_BAD;
return 0;
}
matched socket_exists should be true and we would never get here */
assert(curfd != sockets[num_handles-1]);
fprintf(stderr, "Handle %d wrote to socket %d then detected on %d\n",
- num_handles-1, sockets[num_handles-1], curfd);
+ num_handles-1, (int)sockets[num_handles-1], (int)curfd);
res = TEST_ERR_MAJOR_BAD;
goto test_cleanup;
}
__FILE__, __LINE__, num_handles, timeout);
if(timeout != -1L) {
- interval.tv_sec = timeout/1000;
- interval.tv_usec = (timeout%1000)*1000;
+ int itimeout = (timeout > (long)INT_MAX) ? INT_MAX : (int)timeout;
+ interval.tv_sec = itimeout/1000;
+ interval.tv_usec = (itimeout%1000)*1000;
}
else {
interval.tv_sec = TEST_HANG_TIMEOUT/1000+1;