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.
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.
Sometimes (Windows?),
int
might be just as large aslong
. While the minimums are 16 and 32, sizes can be 32 and 32 or 32 and 64 according to https://en.cppreference.com/w/cpp/language/types (C++, C does not have that nice description but since it depends on the compiler anyway, I guess it applies the same way).I think someone brought this up in the past, but I don't recall if we have a best practice for that.
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.
If
total_count
is guaranteed to be >=0unsigned int
could be a better alternative, otherwisegrass_int64
may be considered.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 chose
long
becauseNode.count
islong
.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.
In r.in.pdal, I used typedef which goes for
unsigned long
orunsigned long long
for number of points depending onHAVE_LONG_LONG_INT
. However, I thinkgrass_int64
is better as it is aligned with the new(ish) trend of fixed with integers (C99, C++11). Signed versus unsigned andint64_t
versusgrass_int64
, that's whole another discussion.However, if int->long helps in your case and it fits with the other numbers there, I'm not against merging this as is.