Skip to content

[hist] Replace C limit macros with std::numeric_limits - #24273

Merged
guitargeek merged 1 commit into
root-project:masterfrom
philippe554:hist-numeric-limits
Nov 20, 2026
Merged

guitargeek merged 1 commit into
root-project:masterfrom
philippe554:hist-numeric-limits

Conversation

@philippe554

Copy link
Copy Markdown
Contributor

This Pull request:

Modernize C numeric limit macros in hist to use std::numeric_limits.

Changes or fixes:

  • Replace FLT_MAX, INT_MAX, LLONG_MAX, and UINT_MAX with std::numeric_limits<...>::max() across hist/ (TH1.h, TH1.cxx, TH2.cxx, TH3.cxx, THLimitsFinder.cxx, TSpectrum2Painter.cxx) and tutorials/hist/hist103_THnSparse_hist.C.
  • Explicitly #include <limits> wherever std::numeric_limits is used.
  • Kept existing <cfloat> / <climits> includes in place to avoid breaking downstream code relying on transitive includes, and left documentation/comments unchanged.

Checklist:

  • tested changes locally (hist build and ctest pass)
  • documentation: no changes to the docs—they still use the C macros to stay in line with the rest of the docs

@github-actions

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 12h 22m 13s ⏱️
 3 941 tests  3 941 ✅ 0 💤 0 ❌
77 258 runs  77 258 ✅ 0 💤 0 ❌

Results for commit 6e859e1.

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for this contribution Philippe

@guitargeek
guitargeek merged commit 42ea3cd into root-project:master Nov 20, 2026
34 checks passed
@guitargeek guitargeek self-assigned this Nov 20, 2026
@guitargeek

Copy link
Copy Markdown
Contributor

/backport to 6.42

@root-project-bot

Copy link
Copy Markdown

Preparing to backport PR #24273 to branch 6.42 requested by guitargeek

@root-project-bot

Copy link
Copy Markdown

This PR has been backported to branch 6.42: #24284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants