[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 58/178: hash: calculate sizes with size_t instead o
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 58/178: hash: calculate sizes with size_t instead of longs |
Date: |
Wed, 23 May 2018 12:24:53 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit dd03e8c281582af454fabfb4a666a5b232d518aa
Author: Daniel Stenberg <address@hidden>
AuthorDate: Fri Apr 6 14:19:39 2018 +0200
hash: calculate sizes with size_t instead of longs
... since they return size_t anyway!
closes #2462
---
lib/cookie.c | 4 ++--
lib/hash.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/cookie.c b/lib/cookie.c
index 5aa959690..9c90c2a38 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -270,11 +270,11 @@ static const char *get_top_domain(const char * const
domain, size_t *outlen)
static size_t cookie_hash_domain(const char *domain, const size_t len)
{
const char *end = domain + len;
- unsigned long h = 5381;
+ size_t h = 5381;
while(domain < end) {
h += h << 5;
- h ^= (unsigned long) Curl_raw_toupper(*domain++);
+ h ^= Curl_raw_toupper(*domain++);
}
return (h % COOKIE_HASH_SIZE);
diff --git a/lib/hash.c b/lib/hash.c
index c99b1b699..15a128fec 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2018, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -261,11 +261,11 @@ size_t Curl_hash_str(void *key, size_t key_length, size_t
slots_num)
{
const char *key_str = (const char *) key;
const char *end = key_str + key_length;
- unsigned long h = 5381;
+ size_t h = 5381;
while(key_str < end) {
h += h << 5;
- h ^= (unsigned long) *key_str++;
+ h ^= *key_str++;
}
return (h % slots_num);
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 39/178: travis: enable apt retry on fail, (continued)
- [GNUnet-SVN] [gnurl] 39/178: travis: enable apt retry on fail, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 36/178: threaded resolver: track resolver time and set suitable timeout values, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 30/178: CI: add lgtm.yml for tweaking lgtm.com analysis, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 40/178: TODO: connection cache sharing is now supporte, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 43/178: test1148: set a fixed locale for the test, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 41/178: cmake: Add advapi32 as explicit link library for win32, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 49/178: cookie: case-insensitive hashing for the domains, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 47/178: openssl: provide defines for argument typecasts to build warning-free, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 60/178: configure: detect sa_family_t, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 45/178: cookie: store cookies per top-level-domain-specific hash table, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 58/178: hash: calculate sizes with size_t instead of longs,
gnunet <=
- [GNUnet-SVN] [gnurl] 53/178: FTP: allow PASV on IPv6 connections when a proxy is being used, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 42/178: docs: fix CURLINFO_*_T examples use of CURL_FORMAT_CURL_OFF_T, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 62/178: curl_setup: provide a CURL_SA_FAMILY_T type if none exists, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 59/178: tool_operate: Fix retry on FTP 4xx to ignore other protocols, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 61/178: build: add picky compiler warning flags for gcc 6 and 7, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 46/178: openssl: fix build with LibreSSL 2.7, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 57/178: RELEASE-NOTES: synced, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 54/178: build-openssl.bat: allow custom paths for VS and perl, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 50/178: tls: fix mbedTLS 2.7.0 build + handle sha256 failures, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 52/178: file: restore old behavior for file:////foo/bar URLs, gnunet, 2018/05/23