summaryrefslogtreecommitdiff
path: root/net/irrtoolset-nox11/patches/patch-as
blob: a3fce685f169ef20039ae0a2e76100aa7e3addb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$NetBSD: patch-as,v 1.1.1.1 2005/02/28 12:37:30 spz Exp $

--- src/irr/cache.hh.orig	2002-04-09 13:48:47.000000000 +0200
+++ src/irr/cache.hh
@@ -77,13 +77,13 @@ public:
    Cache(void) : CacheKeyCacheValueAVLMap(cDefaultValue) {}
    // Add stuff into cache 
    bool add(K aKey, V aValue) {
-      (*this)[(CacheKey)aKey] = CacheValue(aValue);
+      (*this)[(CacheKey)(intptr_t)aKey] = CacheValue(aValue);
       return true;
    }
    ~Cache(void) { clear(); }
    // Retrieve stuff from cache
    bool query(K aKey, V &arValue) {
-      CacheValue *pcValue = &(*this)[(CacheKey)aKey];
+      CacheValue *pcValue = &(*this)[(CacheKey)(intptr_t)aKey];
       // if not found, it always return default value: cDefaultValue
       // we never increase count of default value, so, it's safe to determine
       // cache miss by just checking the reference count to see if it's 0
@@ -97,7 +97,7 @@ public:
 	 return false;
    }
    void nullify(K aKey) {
-      CacheValue *pcValue = &(*this)[(CacheKey)aKey];
+      CacheValue *pcValue = &(*this)[(CacheKey)(intptr_t)aKey];
       pcValue->pvData = NULL;
    }
    // Override the function on the base class