From owner-svn-src-all@FreeBSD.ORG Sat Jun 13 00:54:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFB751065672; Sat, 13 Jun 2009 00:54:52 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 937178FC0A; Sat, 13 Jun 2009 00:54:52 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D0sq9r098292; Sat, 13 Jun 2009 00:54:52 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D0sqko098290; Sat, 13 Jun 2009 00:54:52 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906130054.n5D0sqko098290@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 00:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194095 - head/usr.sbin/nscd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 00:54:53 -0000 Author: des Date: Sat Jun 13 00:54:52 2009 New Revision: 194095 URL: http://svn.freebsd.org/changeset/base/194095 Log: Change hashtable_index_t to unsigned. Generate prototypes for our hash table. MFC after: 1 week Modified: head/usr.sbin/nscd/cachelib.c head/usr.sbin/nscd/hashtable.h Modified: head/usr.sbin/nscd/cachelib.c ============================================================================== --- head/usr.sbin/nscd/cachelib.c Sat Jun 13 00:46:07 2009 (r194094) +++ head/usr.sbin/nscd/cachelib.c Sat Jun 13 00:54:52 2009 (r194095) @@ -146,6 +146,7 @@ ht_item_hash_func(const void *p, size_t return retval; } +HASHTABLE_PROTOTYPE(cache_ht_, cache_ht_item_, struct cache_ht_item_data_); HASHTABLE_GENERATE(cache_ht_, cache_ht_item_, struct cache_ht_item_data_, data, ht_item_hash_func, ht_items_cmp_func); @@ -291,7 +292,7 @@ clear_cache_entry(struct cache_entry_ *e struct cache_policy_ *policy; struct cache_policy_item_ *item, *next_item; size_t entry_size; - int i; + unsigned int i; if (entry->params->entry_type == CET_COMMON) { common_entry = (struct cache_common_entry_ *)entry; @@ -396,7 +397,6 @@ flush_cache_policy(struct cache_common_e hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &entry->items, &ht_key); - assert(hash >= 0); assert(hash < HASHTABLE_ENTRIES_COUNT(&entry->items)); ht_item = HASHTABLE_GET_ENTRY(&(entry->items), hash); @@ -718,7 +718,6 @@ cache_read(struct cache_entry_ *entry, c hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &common_entry->items, &item_data); - assert(hash >= 0); assert(hash < HASHTABLE_ENTRIES_COUNT(&common_entry->items)); item = HASHTABLE_GET_ENTRY(&(common_entry->items), hash); @@ -822,7 +821,6 @@ cache_write(struct cache_entry_ *entry, hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &common_entry->items, &item_data); - assert(hash >= 0); assert(hash < HASHTABLE_ENTRIES_COUNT(&common_entry->items)); item = HASHTABLE_GET_ENTRY(&(common_entry->items), hash); Modified: head/usr.sbin/nscd/hashtable.h ============================================================================== --- head/usr.sbin/nscd/hashtable.h Sat Jun 13 00:46:07 2009 (r194094) +++ head/usr.sbin/nscd/hashtable.h Sat Jun 13 00:54:52 2009 (r194095) @@ -32,7 +32,7 @@ #include #define HASHTABLE_INITIAL_ENTRIES_CAPACITY 8 -typedef int hashtable_index_t; +typedef unsigned int hashtable_index_t; /* * This file contains queue.h-like macro definitions for hash tables.