-
Notifications
You must be signed in to change notification settings - Fork 310
delete the warning in the compilation by casting in (int) warning: … #774
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
delete the warning in the compilation by casting in (int) warning: … #774
Conversation
…omparison between signed and unsigned integer expressions
Oh nice, I shouldn't have let a compile warning get through. @apetrynet What do you think? Either way, this fix makes things better so we'd still be improving if we decided to merge as-is. |
@zebulon75018 Thanks for the catch! @reinecke All of the APIs in this cohort have an int as the frame number. If frame numbers must be >= 0, it makes sense to "repair" the API, and consequently the variables in the methods. If frame numbers can be negative, then a static_cast would be idiomatic in this diff, rather than a C style cast. I'm guessing, >= 0 is the answer, so what do you think about taking a quick pass over the API? |
@reinecke I think @meshula Negative frame numbers are used in some cases where the preroll of a simulation needs to go below frame zero for instance. So, even if not that common, frame numbers should support negative numbers. |
If negative frame numbers are allowable, then the zero padding algorithm should do this ~
~ shouldn't it? |
@meshula I'm sorry, but don't think I understand what your suggesting here. |
The existing code, if zero padded to 4, will do this: |
Hmm. I'm unable to replicate that. I might of course be doing something strange here. @reinecke do you have any input? |
I'll try to repro after ASWF OpenSource Days wraps later today |
I was quite mistaken, sorry! When I was reviewing the code, every time I looked, I didn't spot that the image_num_string conversion has an abs in it. The logic does make sense for negative numbers :) |
Great! Thanks for double-checking!
…On Fri, Aug 21, 2020, 00:35 Nick Porcino ***@***.***> wrote:
I was quite mistaken, sorry! When I was reviewing the code, every time I
looked, I didn't spot that the image_num_string conversion has an abs in
it. The logic does make sense for negative numbers :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#774 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIW7YJ7HP6JUO54AXPCHELSBWQMLANCNFSM4QEH3LMQ>
.
|
Yep, negative frame numbers are allowed and (I think) have good test coverage for the examples discussed: https://github.com/PixarAnimationStudios/OpenTimelineIO/blob/887575ae1f9febe605bb9bd7889aa6e700112193/tests/test_image_sequence_reference.py#L552-L613 @meshula would you agree switching This would probably imply fixing up Just below that point in the code is a good example of how to bubble up deserialization errors: https://github.com/PixarAnimationStudios/OpenTimelineIO/blob/887575ae1f9febe605bb9bd7889aa6e700112193/src/opentimelineio/imageSequenceReference.cpp#L148-L151 I think this would be, overall, a good update to the API and would prevent some potentially odd behavior. @zebulon75018 Sorry to blow out the scope on what is supposed to be a simple compile warning fix, please let us know if doing all that is more than you'd want to take on. |
@reinecke yes to the uint question |
Waou , I just want to give to the project my 2 cents ... :) , that's produced an interesting discution :). |
Codecov Report
@@ Coverage Diff @@
## master #774 +/- ##
==========================================
+ Coverage 83.21% 83.98% +0.76%
==========================================
Files 74 74
Lines 2884 3122 +238
==========================================
+ Hits 2400 2622 +222
- Misses 484 500 +16
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@zebulon75018 Thank you for pointing this one out, you managed to find a little indicator of a bigger oversight I made. |
delete the warning in the compilation by casting in (int) warning: …
…comparison between signed and unsigned integer expressions
just for delete a compilation message.
please just tell me if it;s not interesting.
My two cents....
Cheer