Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

altsvc: silence -Wsign-conversion #13466

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/altsvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static CURLcode altsvc_add(struct altsvcinfo *asi, char *line)
as = altsvc_create(srchost, dsthost, srcalpn, dstalpn, srcport, dstport);
if(as) {
as->expires = expires;
as->prio = prio;
as->prio = (int)prio;
as->persist = persist ? 1 : 0;
Curl_llist_append(&asi->list, as, &as->node);
}
Expand Down Expand Up @@ -409,7 +409,7 @@ static CURLcode getalnum(const char **ptr, char *alpnbuf, size_t buflen)
protop = p;
while(*p && !ISBLANK(*p) && (*p != ';') && (*p != '='))
p++;
len = p - protop;
len = (size_t)(p - protop);
*ptr = p;

if(!len || (len >= buflen))
Expand Down Expand Up @@ -462,7 +462,7 @@ static time_t altsvc_debugtime(void *unused)
char *timestr = getenv("CURL_TIME");
(void)unused;
if(timestr) {
unsigned long val = strtol(timestr, NULL, 10);
long val = strtol(timestr, NULL, 10);
return (time_t)val;
}
return time(NULL);
Expand Down Expand Up @@ -546,7 +546,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
else {
while(*p && (ISALNUM(*p) || (*p == '.') || (*p == '-')))
p++;
len = p - hostp;
len = (size_t)(p - hostp);
}
if(!len || (len >= MAX_ALTSVC_HOSTLEN)) {
infof(data, "Excessive alt-svc host name, ignoring.");
Expand Down Expand Up @@ -624,7 +624,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
num = strtoul(value_ptr, &end_ptr, 10);
if((end_ptr != value_ptr) && (num < ULONG_MAX)) {
if(strcasecompare("ma", option))
maxage = num;
maxage = (time_t)num;
else if(strcasecompare("persist", option) && (num == 1))
persist = TRUE;
}
Expand Down Expand Up @@ -696,7 +696,7 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi,
if((as->src.alpnid == srcalpnid) &&
hostcompare(srchost, as->src.host) &&
(as->src.port == srcport) &&
(versions & as->dst.alpnid)) {
(versions & (int)as->dst.alpnid)) {
/* match */
*dstentry = as;
return TRUE;
Expand Down
Loading