Skip to content

Commit

Permalink
Merge branch 'develop' into cmake/set-cmp0135
Browse files Browse the repository at this point in the history
  • Loading branch information
balos1 authored Feb 17, 2024
2 parents 946dfff + f4f8d16 commit 1a93637
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ sundials_band.h

Fixed [#329](https://github.com/LLNL/sundials/issues/329) so that C++20 aggregate initialization can be used.

Fixed integer overflow in the internal SUNDIALS hashmap. This resolves
[#409](https://github.com/LLNL/sundials/issues/409) and
[#249](https://github.com/LLNL/sundials/issues/249)

## Changes to SUNDIALS in release 6.7.0

Added the `SUNAdaptController` base class, ported ARKODE's internal
Expand Down
4 changes: 4 additions & 0 deletions doc/arkode/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ rely on these are recommended to transition to the corresponding :c:type:`SUNMat
Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Fixed integer overflow in the internal SUNDIALS hashmap. This resolves
`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and
`#249 <https://github.com/LLNL/sundials/issues/249>`_.

Changes in v5.7.0
-----------------

Expand Down
4 changes: 4 additions & 0 deletions doc/cvode/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules:
Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Fixed integer overflow in the internal SUNDIALS hashmap. This resolves
`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and
`#249 <https://github.com/LLNL/sundials/issues/249>`_.

Changes in v6.7.0
-----------------

Expand Down
4 changes: 4 additions & 0 deletions doc/cvodes/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules:
Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Fixed integer overflow in the internal SUNDIALS hashmap. This resolves
`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and
`#249 <https://github.com/LLNL/sundials/issues/249>`_.

Changes in v6.7.0
-----------------

Expand Down
4 changes: 4 additions & 0 deletions doc/ida/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules:
Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Fixed integer overflow in the internal SUNDIALS hashmap. This resolves
`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and
`#249 <https://github.com/LLNL/sundials/issues/249>`_.

Changes in v6.7.0
-----------------

Expand Down
4 changes: 4 additions & 0 deletions doc/idas/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules:
Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Fixed integer overflow in the internal SUNDIALS hashmap. This resolves
`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and
`#249 <https://github.com/LLNL/sundials/issues/249>`_.

Changes in v5.7.0
-----------------

Expand Down
4 changes: 4 additions & 0 deletions doc/kinsol/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules:
Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Fixed integer overflow in the internal SUNDIALS hashmap. This resolves
`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and
`#249 <https://github.com/LLNL/sundials/issues/249>`_.

Changes in v6.7.0
-----------------

Expand Down
9 changes: 5 additions & 4 deletions src/sundials/sundials_hashmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
#ifndef _SUNDIALS_HASHMAP_H
#define _SUNDIALS_HASHMAP_H

#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include "sundials/sundials_errors.h"
#include "sundials/sundials_types.h"

static const unsigned long HASH_PRIME = 14695981039346656037U;
static const unsigned long HASH_OFFSET_BASIS = 1099511628211U;
static const uint64_t HASH_PRIME = 14695981039346656037U;
static const uint64_t HASH_OFFSET_BASIS = 1099511628211U;

/*
For a nice discussion on popular hashing algorithms see:
Expand All @@ -36,9 +37,9 @@ static const unsigned long HASH_OFFSET_BASIS = 1099511628211U;
This is a 64-bit implementation of the 'a' modification of the
Fowler–Noll–Vo hash (i.e., FNV1-a).
*/
static unsigned long fnv1a_hash(const char* str)
static uint64_t fnv1a_hash(const char* str)
{
unsigned long hash = HASH_OFFSET_BASIS;
uint64_t hash = HASH_OFFSET_BASIS;
char c;
while ((c = *str++)) { hash = (hash ^ c) * HASH_PRIME; }
return hash;
Expand Down

0 comments on commit 1a93637

Please sign in to comment.