Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions libs/libscuff/FIBBICache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ void ComputeFIBBIData(RWGSurface *Sa, int nea,
/*--------------------------------------------------------------*/
long JenkinsHash(const char *key, size_t len)
{
long hash;
unsigned int i;
for(hash = i = 0; i < len; ++i)
long hash = 0;
for(size_t i = 0; i < len; ++i)
{
hash += key[i];
hash += (hash << 10);
Expand All @@ -95,7 +94,7 @@ typedef struct { double Data[DATALEN]; } DataStruct;

typedef std::pair<KeyStruct, DataStruct> KDPair;

struct KeyHash
struct FIBBIKeyHash
{
long operator() (const KeyStruct &K) const
{ return HashFunction(K.Key); }
Expand All @@ -111,18 +110,18 @@ typedef struct
);
};

} KeyCmp;
} FIBBIKeyCmp;

#ifdef HAVE_CXX11
typedef std::unordered_map< KeyStruct,
DataStruct,
KeyHash,
KeyCmp> KDMap;
FIBBIKeyHash,
FIBBIKeyCmp> KDMap;
#elif defined(HAVE_TR1)
typedef std::tr1::unordered_map< KeyStruct,
DataStruct,
KeyHash,
KeyCmp> KDMap;
FIBBIKeyHash,
FIBBIKeyCmp> KDMap;
#endif

/*--------------------------------------------------------------*/
Expand Down
12 changes: 6 additions & 6 deletions libs/libscuff/FIPPICache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ typedef struct

typedef std::pair<KeyStruct, QIFIPPIData *> KeyValuePair;

struct KeyHash
struct FIPPIKeyHash
{
long operator() (const KeyStruct &K) const { return HashFunction(K.Key); }
};
Expand All @@ -80,18 +80,18 @@ typedef struct
return true;
};

} KeyCmp;
} FIPPIKeyCmp;

#ifdef HAVE_CXX11
typedef std::unordered_map< KeyStruct,
QIFIPPIData *,
KeyHash,
KeyCmp> KeyValueMap;
FIPPIKeyHash,
FIPPIKeyCmp> KeyValueMap;
#elif defined(HAVE_TR1)
typedef std::tr1::unordered_map< KeyStruct,
QIFIPPIData *,
KeyHash,
KeyCmp> KeyValueMap;
FIPPIKeyHash,
FIPPIKeyCmp> KeyValueMap;
#endif

/*--------------------------------------------------------------*/
Expand Down