aappleby / smhasher

Automatically exported from code.google.com/p/smhasher
2.66k stars 469 forks source link

BUG in platform.h #83

Open UnePierre opened 4 years ago

UnePierre commented 4 years ago

Hi!

There is a compiler warning:

C:\Users\fergerm\github.com\aappleby\smhasher\src\Platform.h: In function 'long long unsigned int rdtsc()':
C:\Users\fergerm\github.com\aappleby\smhasher\src\Platform.h:78:52: warning: left shift count >= width of type [-Wshift-count-overflow]
     return (unsigned long)a | ((unsigned long)d << 32);
                                                    ^~

I agree with the analysis, that this looses information!

Fix:

#file platform.h
#line 78
--    return (unsigned long)a | ((unsigned long)d << 32);
++    return (unsigned long long)a | ((unsigned long long)d << 32);