ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/util.h
(Generate patch)

Comparing deliantra/server/include/util.h (file contents):
Revision 1.97 by root, Fri Mar 26 01:04:44 2010 UTC vs.
Revision 1.98 by root, Fri Apr 2 03:41:24 2010 UTC

573 // FNV-1a is faster on many cpus because the multiplication 573 // FNV-1a is faster on many cpus because the multiplication
574 // runs concurrently with the looping logic. 574 // runs concurrently with the looping logic.
575 uint32_t hash = STRHSH_NULL; 575 uint32_t hash = STRHSH_NULL;
576 576
577 while (*s) 577 while (*s)
578 hash = (hash ^ *s++) * 16777619; 578 hash = (hash ^ *s++) * 16777619U;
579 579
580 return hash; 580 return hash;
581} 581}
582 582
583static inline uint32_t 583static inline uint32_t
584memhsh (const char *s, size_t len) 584memhsh (const char *s, size_t len)
585{ 585{
586 uint32_t hash = STRHSH_NULL; 586 uint32_t hash = STRHSH_NULL;
587 587
588 while (len--) 588 while (len--)
589 hash = (hash ^ *s++) * 16777619; 589 hash = (hash ^ *s++) * 16777619U;
590 590
591 return hash; 591 return hash;
592} 592}
593 593
594struct str_hash 594struct str_hash

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines