diff options
author | Brad King <brad.king@kitware.com> | 2017-10-04 07:28:34 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-10-10 11:15:16 -0400 |
commit | 9e3ef40edb6eae36e822c129bec5d4ee9de0dd57 (patch) | |
tree | c739e929f90b5e6c4e26d4f5fea7f17d3772aefb /Utilities/cmcurl/lib/splay.c | |
parent | 2fad0e20b6b2b4c3cfc177267cf9689658f50c23 (diff) | |
parent | de7c21d677db1ddaeece03c19e13e448f4031511 (diff) | |
download | cmake-9e3ef40edb6eae36e822c129bec5d4ee9de0dd57.tar.gz |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2017-10-04 (3ea76790)
Diffstat (limited to 'Utilities/cmcurl/lib/splay.c')
-rw-r--r-- | Utilities/cmcurl/lib/splay.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Utilities/cmcurl/lib/splay.c b/Utilities/cmcurl/lib/splay.c index 1b301f95db..69af446eb5 100644 --- a/Utilities/cmcurl/lib/splay.c +++ b/Utilities/cmcurl/lib/splay.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1997 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1997 - 2017, 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 @@ -37,7 +37,7 @@ * Splay using the key i (which may or may not be in the tree.) The starting * root is t. */ -struct Curl_tree *Curl_splay(struct timeval i, +struct Curl_tree *Curl_splay(struct curltime i, struct Curl_tree *t) { struct Curl_tree N, *l, *r, *y; @@ -97,24 +97,26 @@ struct Curl_tree *Curl_splay(struct timeval i, * * @unittest: 1309 */ -struct Curl_tree *Curl_splayinsert(struct timeval i, +struct Curl_tree *Curl_splayinsert(struct curltime i, struct Curl_tree *t, struct Curl_tree *node) { - static const struct timeval KEY_NOTUSED = {-1, -1}; /* will *NEVER* appear */ + static const struct curltime KEY_NOTUSED = { + (time_t)-1, (unsigned int)-1 + }; /* will *NEVER* appear */ if(node == NULL) return t; if(t != NULL) { t = Curl_splay(i, t); - if(compare(i, t->key)==0) { + if(compare(i, t->key) == 0) { /* There already exists a node in the tree with the very same key. Build a doubly-linked circular list of nodes. We add the new 'node' struct to the end of this list. */ node->key = KEY_NOTUSED; /* we set the key in the sub node to NOTUSED - to quickly identify this node as a subnode */ + to quickly identify this node as a subnode */ node->samen = t; node->samep = t->samep; t->samep->samen = node; @@ -149,11 +151,11 @@ struct Curl_tree *Curl_splayinsert(struct timeval i, /* Finds and deletes the best-fit node from the tree. Return a pointer to the resulting tree. best-fit means the smallest node if it is not larger than the key */ -struct Curl_tree *Curl_splaygetbest(struct timeval i, - struct Curl_tree *t, - struct Curl_tree **removed) +struct Curl_tree *Curl_splaygetbest(struct curltime i, + struct Curl_tree *t, + struct Curl_tree **removed) { - static struct timeval tv_zero = {0, 0}; + static struct curltime tv_zero = {0, 0}; struct Curl_tree *x; if(!t) { @@ -209,7 +211,9 @@ int Curl_splayremovebyaddr(struct Curl_tree *t, struct Curl_tree *removenode, struct Curl_tree **newroot) { - static const struct timeval KEY_NOTUSED = {-1, -1}; /* will *NEVER* appear */ + static const struct curltime KEY_NOTUSED = { + (time_t)-1, (unsigned int)-1 + }; /* will *NEVER* appear */ struct Curl_tree *x; if(!t || !removenode) |