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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix some C++ warnings #3079
Fix some C++ warnings #3079
Changes from all commits
1534888
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The leading whitespace is unnecessary. Other than that, more
const
is never a bad thing!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More bad whitespace detected. Also, I feel like the comment should be above the variable declaration. However, moving
__lastRemovedDigit
to its most necessary scope is a good change.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better yet, just remove
__isSmallInt
altogether if that is its only purpose. (To be fair, I will do things likeconst bool isSomethingTrue = [. . .];
in my own code if the defining expression is really long or not very self-explanatory, but the comment beneath theif
-statement backs up what is going on here and when this case is hit.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kind of silly, in my opinion. I guess "true or false" rolls off of the tongue better than "false or true," but is something like this really worth the effort?
No changes are suggested here. Keep in mind, however, that reviewers have to look over every change you make. (I still feel bad for the reviewers who had to endure the copious amounts of non-conformance and style differences in my own PR.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add a newline here? The definition for
select_on_container_copy_construction()
immediately beneath this also fits on one line with its/* strengthened */
comment, and that one takes even more characters than this one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_Thrd_equal()
is already defined in anextern "C"
block, so this is redundant. (See the use of the_EXTERN_C
macro above.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually prefer the old code on this better, it will be easier to set breakpoints to debug the old way. The way in this PR makes it much more harder to set breakpoint for assignment and the if separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually like the changed version better. Setting a breakpoint at an assignment is kind of silly unless it is to walk through the code which follows it (since assigning to a variable is trivial). Using Visual Studio, if you set a breakpoint at the
if
-statement in the proposed code, then I'm pretty sure that using the "Step In" function will still allow you to inspect things like the call toDecodePointer
. (That's a Win32 function, though, so unless you have the source code, you would just be looking at disassembly.)No changes are requested from me here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another case of
auto
being used when it probably shouldn't be. I like the addition ofconst
to the pointer value itself, though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the removal of nullptr here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably, they did that because the
ptr
variable is immediately initialized to a different value after the_BEGIN_LOCK(_LOCK_LOCALE)
macro, so the initialization tonullptr
is ultimately redundant. I do like to believe that any optimizing compiler with half of a brain would remove that assignment anyways, though.(On another note, I really don't like those
_BEGIN_LOCK
and_END_LOCK
macros. I mean,_END_LOCK
is literally defined as just an end brace character, for crying out loud! Perhaps a separate PR should be make just to remove those macros, unless there's some really strange reason for its continued existence.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file I am mostly ok with, except that I have no idea why the removal of
--qh;
(was it a bug or something?).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @AraHaan mentioned, this change affects the logic of the code. Could you explain why it was made? Was the removal intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see nothing wrong with the original here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the reformat of the namespaces like this?