X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Ffile-handle-def.c;h=0652501faa17fa27b19989b07e471b816731360c;hb=2c411d651e22704f60f117d944b9380a07d247fe;hp=5d807ab9a0a5a5b9867836bd62e9daf9ae494281;hpb=62c871225e944dbdb2a50e1253423952719145cf;p=pspp-builds.git diff --git a/src/data/file-handle-def.c b/src/data/file-handle-def.c index 5d807ab9..0652501f 100644 --- a/src/data/file-handle-def.c +++ b/src/data/file-handle-def.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -592,10 +592,12 @@ static unsigned int hash_fh_lock (const void *lock_, const void *aux UNUSED) { const struct fh_lock *lock = lock_; - unsigned int hash = hsh_hash_int ((lock->referent << 3) | lock->access); + unsigned int basis; if (lock->referent == FH_REF_FILE) - hash ^= fn_hash_identity (lock->u.file); + basis = fn_hash_identity (lock->u.file); else if (lock->referent == FH_REF_SCRATCH) - hash ^= hsh_hash_int (lock->u.unique_id); - return hash; + basis = lock->u.unique_id; + else + basis = 0; + return hash_int ((lock->referent << 3) | lock->access, basis); }