summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-05-29 10:24:54 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-05-29 10:24:54 +0200
commit1f631bf6673d3159abf58aa670c92cdd34190b64 (patch)
tree28083b54855be8657865f41fd5d2cb6c2b6a6fef /tools.c
parent1e63fa4174c73d8ea4d257b883a9ac926a87311d (diff)
downloadvdr-1f631bf6673d3159abf58aa670c92cdd34190b64.tar.gz
vdr-1f631bf6673d3159abf58aa670c92cdd34190b64.tar.bz2
Fixed a crash with negative hash ids (made them unsigned)
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools.c b/tools.c
index 58028398..55612165 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.94 2005/05/28 11:46:44 kls Exp $
+ * $Id: tools.c 1.95 2005/05/29 10:18:26 kls Exp $
*/
#include "tools.h"
@@ -1075,15 +1075,15 @@ cHashBase::~cHashBase(void)
free(hashTable);
}
-void cHashBase::Add(cListObject *Object, int Id)
+void cHashBase::Add(cListObject *Object, unsigned int Id)
{
- int hash = hashfn(Id);
+ unsigned int hash = hashfn(Id);
if (!hashTable[hash])
hashTable[hash] = new cList<cHashObject>;
hashTable[hash]->Add(new cHashObject(Object, Id));
}
-void cHashBase::Del(cListObject *Object, int Id)
+void cHashBase::Del(cListObject *Object, unsigned int Id)
{
cList<cHashObject> *list = hashTable[hashfn(Id)];
if (list) {
@@ -1096,7 +1096,7 @@ void cHashBase::Del(cListObject *Object, int Id)
}
}
-cListObject *cHashBase::Get(int Id) const
+cListObject *cHashBase::Get(unsigned int Id) const
{
cList<cHashObject> *list = hashTable[hashfn(Id)];
if (list) {
@@ -1108,7 +1108,7 @@ cListObject *cHashBase::Get(int Id) const
return NULL;
}
-cList<cHashObject> *cHashBase::GetList(int Id) const
+cList<cHashObject> *cHashBase::GetList(unsigned int Id) const
{
return hashTable[hashfn(Id)];
}