* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, 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
const curl_ssl_backend **list;
int i;
- result = curl_global_sslset(-1, NULL, &list);
+ result = curl_global_sslset((curl_sslbackend)-1, NULL, &list);
assert(result == CURLSSLSET_UNKNOWN_BACKEND);
for(i = 0; list[i]; i++)
result = curl_global_sslset((curl_sslbackend)id, NULL, NULL);
}
else
- result = curl_global_sslset(-1, name, NULL);
+ result = curl_global_sslset((curl_sslbackend)-1, name, NULL);
if(result == CURLSSLSET_UNKNOWN_BACKEND) {
fprintf(stderr, "Unknown SSL backend id: %s\n", name);
{"XFERINFODATA", CURLOPT_XFERINFODATA, CURLOT_CBPTR, 0},
{"XFERINFOFUNCTION", CURLOPT_XFERINFOFUNCTION, CURLOT_FUNCTION, 0},
{"XOAUTH2_BEARER", CURLOPT_XOAUTH2_BEARER, CURLOT_STRING, 0},
- {NULL, 0, 0, 0} /* end of table */
+ {NULL, CURLOPT_LASTENTRY, 0, 0} /* end of table */
};
#ifdef DEBUGBUILD
}
print <<FOOT
- {NULL, 0, 0, 0} /* end of table */
+ {NULL, CURLOPT_LASTENTRY, 0, 0} /* end of table */
};
#ifdef DEBUGBUILD
* rewrite to work around the paragraph 2 in the BSD licenses as explained
* below.
*
- * Copyright (c) 1998, 1999, 2017 Kungliga Tekniska Högskolan
+ * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
*
- * Copyright (C) 2001 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2001 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* All rights reserved.
*
if(ret != AUTH_CONTINUE) {
if(ret != AUTH_OK) {
/* Mechanism has dumped the error to stderr, don't error here. */
- return -1;
+ return CURLE_USE_SSL_FAILED;
}
DEBUGASSERT(ret == AUTH_OK);
return GNUTLS_X509_FMT_PEM;
if(strcasecompare(type, "DER"))
return GNUTLS_X509_FMT_DER;
- return -1;
+ return GNUTLS_X509_FMT_PEM; /* default to PEM */
}
#define GNUTLS_CIPHERS "NORMAL:-ARCFOUR-128:-CTYPE-ALL:+CTYPE-X509"
if(!dir)
return CURLE_SSL_CACERT_BADFILE;
- while((entry = PR_ReadDir(dir, PR_SKIP_BOTH | PR_SKIP_HIDDEN))) {
+ while((entry =
+ PR_ReadDir(dir, (PRDirFlags)(PR_SKIP_BOTH | PR_SKIP_HIDDEN)))) {
char *fullpath = aprintf("%s/%s", capath, entry->name);
if(!fullpath) {
PR_CloseDir(dir);
tmp_CFLAGS="$tmp_CFLAGS -Wno-varargs"
fi
fi
+ dnl clang 7 or later
+ if test "$compiler_num" -ge "700"; then
+ CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [assign-enum])
+ fi
fi
;;
#
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, 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
CURLSHcode shareret;
(void)URL;
- curl_easy_strerror(INT_MAX);
- curl_multi_strerror(INT_MAX);
- curl_share_strerror(INT_MAX);
- curl_easy_strerror(-INT_MAX);
- curl_multi_strerror(-INT_MAX);
- curl_share_strerror(-INT_MAX);
+ curl_easy_strerror((CURLcode)INT_MAX);
+ curl_multi_strerror((CURLMcode)INT_MAX);
+ curl_share_strerror((CURLSHcode)INT_MAX);
+ curl_easy_strerror((CURLcode)-INT_MAX);
+ curl_multi_strerror((CURLMcode)-INT_MAX);
+ curl_share_strerror((CURLSHcode)-INT_MAX);
for(easyret = CURLE_OK; easyret <= CURL_LAST; easyret++) {
printf("e%d: %s\n", (int)easyret, curl_easy_strerror(easyret));
}
return CURLUPART_FRAGMENT;
if(!strcmp("zoneid", part))
return CURLUPART_ZONEID;
- return 9999; /* bad input => bad output */
+ return (CURLUPart)9999; /* bad input => bad output */
}
static CURLUcode updateurl(CURLU *u, const char *cmd, unsigned int setflags)
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, 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
int stillRunning;
CURLM *multiHandle = NULL;
CURL *curl = NULL;
- CURLMcode res = CURLM_OK;
+ CURLcode res = CURLE_OK;
int timeout;
global_init(CURL_GLOBAL_ALL);
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, 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
}
if(iolen != 0)
- res = TEST_ERR_FAILURE;
+ res = (CURLcode)TEST_ERR_FAILURE;
}
test_cleanup:
int stillRunning;
CURLM *multiHandle = NULL;
CURL *curl = NULL;
- CURLMcode res = CURLM_OK;
+ CURLcode res = CURLE_OK;
global_init(CURL_GLOBAL_ALL);
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, 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
print <<FOOTER
- curl_easy_setopt(curl, 1, 0);
+ curl_easy_setopt(curl, (CURLoption)1, 0);
res = CURLE_OK;
test_cleanup:
curl_easy_cleanup(curl);
** For portability reasons TEST_ERR_* values should be less than 127.
*/
-#define TEST_ERR_MAJOR_BAD 126
-#define TEST_ERR_RUNS_FOREVER 125
-#define TEST_ERR_EASY_INIT 124
-#define TEST_ERR_MULTI_INIT 123
-#define TEST_ERR_NUM_HANDLES 122
-#define TEST_ERR_SELECT 121
-#define TEST_ERR_SUCCESS 120
-#define TEST_ERR_FAILURE 119
-#define TEST_ERR_USAGE 118
-#define TEST_ERR_FOPEN 117
-#define TEST_ERR_FSTAT 116
-#define TEST_ERR_BAD_TIMEOUT 115
+#define TEST_ERR_MAJOR_BAD (CURLcode) 126
+#define TEST_ERR_RUNS_FOREVER (CURLcode) 125
+#define TEST_ERR_EASY_INIT (CURLcode) 124
+#define TEST_ERR_MULTI (CURLcode) 123
+#define TEST_ERR_NUM_HANDLES (CURLcode) 122
+#define TEST_ERR_SELECT (CURLcode) 121
+#define TEST_ERR_SUCCESS (CURLcode) 120
+#define TEST_ERR_FAILURE (CURLcode) 119
+#define TEST_ERR_USAGE (CURLcode) 118
+#define TEST_ERR_FOPEN (CURLcode) 117
+#define TEST_ERR_FSTAT (CURLcode) 116
+#define TEST_ERR_BAD_TIMEOUT (CURLcode) 115
/*
** Macros for test source code readability/maintainability.
#define exe_multi_init(A,Y,Z) do { \
if(((A) = curl_multi_init()) == NULL) { \
fprintf(stderr, "%s:%d curl_multi_init() failed\n", (Y), (Z)); \
- res = TEST_ERR_MULTI_INIT; \
+ res = TEST_ERR_MULTI; \
} \
} while(0)
fprintf(stderr, "%s:%d curl_easy_setopt() failed, " \
"with code %d (%s)\n", \
(Y), (Z), (int)ec, curl_easy_strerror(ec)); \
- res = (int)ec; \
+ res = ec; \
} \
} while(0)
fprintf(stderr, "%s:%d curl_multi_setopt() failed, " \
"with code %d (%s)\n", \
(Y), (Z), (int)ec, curl_multi_strerror(ec)); \
- res = (int)ec; \
+ res = TEST_ERR_MULTI; \
} \
} while(0)
fprintf(stderr, "%s:%d curl_multi_add_handle() failed, " \
"with code %d (%s)\n", \
(Y), (Z), (int)ec, curl_multi_strerror(ec)); \
- res = (int)ec; \
+ res = TEST_ERR_MULTI; \
} \
} while(0)
fprintf(stderr, "%s:%d curl_multi_remove_handle() failed, " \
"with code %d (%s)\n", \
(Y), (Z), (int)ec, curl_multi_strerror(ec)); \
- res = (int)ec; \
+ res = TEST_ERR_MULTI; \
} \
} while(0)
fprintf(stderr, "%s:%d curl_multi_perform() failed, " \
"with code %d (%s)\n", \
(Y), (Z), (int)ec, curl_multi_strerror(ec)); \
- res = (int)ec; \
+ res = TEST_ERR_MULTI; \
} \
else if(*((B)) < 0) { \
fprintf(stderr, "%s:%d curl_multi_perform() succeeded, " \
fprintf(stderr, "%s:%d curl_multi_fdset() failed, " \
"with code %d (%s)\n", \
(Y), (Z), (int)ec, curl_multi_strerror(ec)); \
- res = (int)ec; \
+ res = TEST_ERR_MULTI; \
} \
else if(*((E)) < -1) { \
fprintf(stderr, "%s:%d curl_multi_fdset() succeeded, " \
fprintf(stderr, "%s:%d curl_multi_timeout() failed, " \
"with code %d (%s)\n", \
(Y), (Z), (int)ec, curl_multi_strerror(ec)); \
- res = (int)ec; \
+ res = TEST_ERR_BAD_TIMEOUT; \
} \
else if(*((B)) < -1L) { \
fprintf(stderr, "%s:%d curl_multi_timeout() succeeded, " \
fprintf(stderr, "%s:%d curl_multi_poll() failed, " \
"with code %d (%s)\n", \
(Y), (Z), (int)ec, curl_multi_strerror(ec)); \
- res = (int)ec; \
+ res = TEST_ERR_MULTI; \
} \
else if(*((E)) < 0) { \
fprintf(stderr, "%s:%d curl_multi_poll() succeeded, " \
fprintf(stderr, "%s:%d curl_multi_wakeup() failed, " \
"with code %d (%s)\n", \
(Y), (Z), (int)ec, curl_multi_strerror(ec)); \
- res = (int)ec; \
+ res = TEST_ERR_MULTI; \
} \
} while(0)
fprintf(stderr, "%s:%d curl_global_init() failed, " \
"with code %d (%s)\n", \
(Y), (Z), (int)ec, curl_easy_strerror(ec)); \
- res = (int)ec; \
+ res = ec; \
} \
} while(0)