Skip to content

Conversation

@chiphogg
Copy link
Member

For get_value_result(), we split the implementation between two new
types: one for "trying to put a non-integer in an integral type", and
one for "everything else". We still assign the result to a constexpr
variable to force it to be evaluated at compile time.

For the other two, we use ternary operators to bring things into a
single line of code, splitting out into separate functions when that
makes sense.

Follow-on to #467.

For `get_value_result()`, we split the implementation between two new
types: one for "trying to put a non-integer in an integral type", and
one for "everything else".  We still assign the result to a `constexpr`
variable to force it to be evaluated at compile time.

For the other two, we use ternary operators to bring things into a
single line of code, splitting out into separate functions when that
makes sense.

Follow-on to #467.
@chiphogg chiphogg requested review from Copilot and removed request for Copilot August 18, 2025 20:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies compiler-specific code to circumvent Green Hills compiler warnings by restructuring control flow to use single expressions rather than multi-statement blocks. The changes focus on making functions technically "one-liners" to satisfy the compiler's requirements.

  • Refactored get_value_result() into separate template structs for different cases
  • Converted conditional logic to ternary operators in categorize_mag_label()
  • Extracted helper function double_first_until_second() in ValueOfMaxFloatNotExceedingMaxInt

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
au/magnitude.hh Splits get_value_result() into template specializations and converts categorize_mag_label() to nested ternary operators
au/overflow_boundary.hh Converts if-else logic to ternary operator and extracts loop into separate helper function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@chiphogg chiphogg merged commit 870a201 into main Aug 18, 2025
14 checks passed
@chiphogg chiphogg deleted the chiphogg/new-errors#467 branch August 18, 2025 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants