File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ This file documents changes done for the stan-math project
2+
3+ - Backported bugfix for hashmap int overflow on Windows (https://github.com/LLNL/sundials/pull/421)
Original file line number Diff line number Diff line change 2020#ifndef _SUNDIALS_HASHMAP_H
2121#define _SUNDIALS_HASHMAP_H
2222
23+ #include <stdint.h>
2324#include <string.h>
2425#include <stdlib.h>
2526
3031 This is a 64-bit implementation of the 'a' modification of the
3132 Fowler–Noll–Vo hash (i.e., FNV1-a).
3233 */
33- static unsigned long fnv1a_hash (const char * str )
34+ static uint64_t fnv1a_hash (const char * str )
3435{
35- const unsigned long prime = 14695981039346656037U ; /* prime */
36- unsigned long hash = 1099511628211U ; /* offset basis */
36+ const uint64_t prime = 14695981039346656037U ; /* prime */
37+ uint64_t hash = 1099511628211U ; /* offset basis */
3738 char c ;
3839 while ((c = * str ++ ))
3940 hash = (hash ^c ) * prime ;
You can’t perform that action at this time.
0 commit comments