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
Fixed gint/guint not being different types #22
Conversation
src/gtk2.nim
Outdated
@@ -6463,7 +6463,7 @@ proc in_drag*(a: PHandleBox): guint | |||
proc set_in_drag*(a: PHandleBox, `in_drag`: guint) | |||
proc shrink_on_detach*(a: PHandleBox): guint | |||
proc set_shrink_on_detach*(a: PHandleBox, `shrink_on_detach`: guint) | |||
proc snap_edge*(a: PHandleBox): gint | |||
#proc snap_edge*(a: PHandleBox): gint |
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 was this changed?
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.
From the comment on line #13328:
set_snap_edge was in a when false. snap_edge put in when false as the actual return type should be GtkPositionType not gint
Better? All those should really be turned into enums, but that is a task for another day, or for someone else. |
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.
Can you verify that Aporia still compiles after these changes?
c2nim seems to do some weird stuff when converting enums. But with the latest push to the PMunch/gtk2 branch and the PR nim-lang/Aporia#145 it compiles and runs fine. |
Okay, cool. Hopefully this won't cause any breakage. |
oh damn, I misread. Thought there would be no changes required to Aporia :\ |
Oh well. I guess this is for the best anyway. |
Yeah, the wrapper was simply wrong, so this is indeed for the best. It breaks some code, but at least it should now be more correct. I'm sure there are still things left to be converted. It seems like a lot of the code uses enums, for which the definitions have been converted to Nim const int statements and the usage of which has been converted to Nim uint statements.. And C doing its |
Noticed while using GdkColor that guint and gint were not different types. This meant that I couldn't assign the highest values of a guint to it without doing weird casting. This PR should fix the issue.