Add inline, remove unused exception variable name, safe float computation#324
Open
mnorris11 wants to merge 1 commit intointel:mainfrom
Open
Add inline, remove unused exception variable name, safe float computation#324mnorris11 wants to merge 1 commit intointel:mainfrom
mnorris11 wants to merge 1 commit intointel:mainfrom
Conversation
rfsaliev
reviewed
Apr 30, 2026
Member
rfsaliev
left a comment
There was a problem hiding this comment.
Thank you @mnorris11 , for the contribution.
There are some suggestions, proposals and comments
| static_cast<uint32_t>(e > 112) * ((((e - 112) << 10) & 0x7C00) | m >> 13) | | ||
| static_cast<uint32_t>((e < 113) && (e > 101)) * | ||
| ((((0x007FF000 + m) >> (125 - e)) + 1) >> 1) | | ||
| ((((0x007FF000 + m) >> (125 - safe_e)) + 1) >> 1) | |
Member
There was a problem hiding this comment.
Hm, in case when (e < 101 || e > 113), this component is always 0:
return (b & 0x80000000) >> 16 |
... |
static_cast<uint32_t>((e < 113) && (e > 101)) *
((((0x007FF000 + m) >> (125 - safe_e)) + 1) >> 1) |
// equal to:
return (b & 0x80000000) >> 16 |
... |
static_cast<uint32_t>(e > 101 && e < 113) *
((((0x007FF000 + m) >> (125 - safe_e)) + 1) >> 1) |
// equal to:
return (b & 0x80000000) >> 16 |
... |
static_cast<uint32_t>(false) *
((((0x007FF000 + m) >> (125 - safe_e)) + 1) >> 1) |
//equal to:
return (b & 0x80000000) >> 16 |
... |
0 *
((((0x007FF000 + m) >> (125 - safe_e)) + 1) >> 1) |
| try { | ||
| unsafe_assign(fn); | ||
| } catch (const ThreadCrashedError& err) { | ||
| } catch (const ThreadCrashedError&) { |
Member
There was a problem hiding this comment.
Suggested change
| } catch (const ThreadCrashedError&) { | |
| } catch (const ThreadCrashedError& SVS_UNUSED(err)) { |
Comment on lines
+858
to
+861
| throw ANNEXCEPTION( | ||
| "Expected to get an exception from a crashed thread but no " | ||
| "exception was thrown!" | ||
| ); |
Member
There was a problem hiding this comment.
Please, use SVS formatting rules.
Comment on lines
33
to
+35
| namespace svs { | ||
| namespace runtime { | ||
| namespace v0 { | ||
| inline namespace v0 { |
Member
There was a problem hiding this comment.
IMHO, this change will negatively affect usability and maintainability for further API major versions.
Instead, a macro can be used here which value defined in version.h depending on SVS_RUNTIME_API_VERSION, e.g.:
#if (SVS_RUNTIME_API_VERSION == 0)
...
#define SVS_API_V0 inline namespace v0
...
#endif
With usage aka:
Suggested change
| namespace svs { | |
| namespace runtime { | |
| namespace v0 { | |
| inline namespace v0 { | |
| namespace svs { | |
| namespace runtime { | |
| SVS_API_V0 { | |
| ... | |
| } // SVS_API_V0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a patch to get it to work internally. It would be easier if things are in SVS, so next version upgrade we don't need to apply this patch.
Reason for changes: