Skip to content

Commit

Permalink
master: fix uses of CPPAD_DEBUG_AND_RELEASE.
Browse files Browse the repository at this point in the history
whats_new.xrst: fix 2023 -> 2024.
  • Loading branch information
bradbell committed Jan 3, 2024
1 parent def4088 commit ffcd340
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions appendix/whats_new/24.xrst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ new_24s and Additions to CppAD During 2024
mm-dd
*****

01-03
=====

#. The change on :ref:`whats_new_23@mm-dd@12-24` 2023,
when :ref:`cmake@cppad_debug_and_release` was implemented,
was not done properly and might cause a mistaken assertion.
This has been fixed.

01-02
=====

Expand Down
2 changes: 1 addition & 1 deletion appendix/whats_new/whats_new.xrst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ assist you in learning about changes between various versions of CppAD.

This Year
*********
:ref:`2023<whats_new_24-name>`
:ref:`2024<whats_new_24-name>`

Previous Years
**************
Expand Down
2 changes: 1 addition & 1 deletion example/general/general.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ int main(void)
Run( unary_plus, "unary_plus" );
Run( vec_ad, "vec_ad" );
// END_SORT_THIS_LINE_MINUS_1
# if CPPAD_DEBUG_AND_RELEASE
# if ! CPPAD_DEBUG_AND_RELEASE
Run( check_for_nan, "check_for_nan" );
# endif
# if CPPAD_HAS_ADOLC
Expand Down
8 changes: 4 additions & 4 deletions include/cppad/utility/thread_alloc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ Example
first_trace = false;
}

# if CPPAD_DEBUG_AND_RELEASE
# if ! CPPAD_DEBUG_AND_RELEASE
// Root nodes for both lists. Note these are different for different
// threads because tc_index is different for different threads.
block_t* inuse_root = info->root_inuse_ + c_index;
Expand All @@ -808,7 +808,7 @@ Example
// return value for get_memory
void* v_ptr = reinterpret_cast<void*>(node + 1);
# ifndef NDEBUG
# if CPPAD_DEBUG_AND_RELEASE
# if ! CPPAD_DEBUG_AND_RELEASE
// add node to inuse list
node->next_ = inuse_root->next_;
inuse_root->next_ = v_node;
Expand Down Expand Up @@ -844,7 +844,7 @@ Example
void* v_ptr = reinterpret_cast<void*>(node + 1);

# ifndef NDEBUG
# if CPPAD_DEBUG_AND_RELEASE
# if ! CPPAD_DEBUG_AND_RELEASE
// add node to inuse list
node->next_ = inuse_root->next_;
inuse_root->next_ = v_node;
Expand Down Expand Up @@ -943,7 +943,7 @@ Example

thread_alloc_info* info = thread_info(thread);
# ifndef NDEBUG
# if CPPAD_DEBUG_AND_RELEASE
# if ! CPPAD_DEBUG_AND_RELEASE
// remove node from inuse list
void* v_node = reinterpret_cast<void*>(node);
block_t* inuse_root = info->root_inuse_ + c_index;
Expand Down
4 changes: 2 additions & 2 deletions test_more/general/forward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ bool ForwardOlder(void)
}

# ifndef NDEBUG
# if CPPAD_DEBUG_AND_RELEASE
# if ! CPPAD_DEBUG_AND_RELEASE
void my_error_handler(
bool known ,
int line ,
Expand Down Expand Up @@ -239,7 +239,7 @@ bool Forward(void)
ok &= ForwardCases< std::valarray <double> >();
ok &= ForwardOlder();
# ifndef NDEBUG
# if CPPAD_DEBUG_AND_RELEASE
# if ! CPPAD_DEBUG_AND_RELEASE
// CppAD does not check for nan when NDEBUG is defined
ok &= forward_nan();
# endif
Expand Down

0 comments on commit ffcd340

Please sign in to comment.