-
Notifications
You must be signed in to change notification settings - Fork 17
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 error in function change_transmat #34
Conversation
Matrix entry update function "change_transmat" should only change one value at a time, instead of all at once, otherwise the requested matrix data will be overwritten after the first value with values already in the boxes.
Hi!
I don't have access to a Mac at the moment, but it *should* compile okay. The trick is to use GINT_TO_POINTER to send i, which should keep the compiler happy.
In pull request #21:
"While this is not equivalent I think we can afford to loose the little time needed to update 12 text fields instead of 1, and gain clang optimization."
Unfortunately this will give you the wrong matrix values, as changing matrix entries greater than i before the new matrix values are displayed results in the matrix values being overwritten.
The pull request should make it work smoothly now.
Regards,
Craig
…________________________________
差出人: Okadome Valencia ***@***.***>
送信日時: 2021年5月20日 14:31
宛先: arohl/gdis ***@***.***>
CC: クレイグ・フィッシャー ***@***.***>; Author ***@***.***>
件名: Re: [arohl/gdis] Fix error in function change_transmat (#34)
Hello, and thank you for your suggestion.
Have you see the pull request #21<#21> ?
I wonder if the code with your modification is properly optimizing with clang?
There use to be some trouble is using a pointer to represent an interger.
Maybe we should implement the suggestion in #21<#21>
Sincerely,
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#34 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AP5N32AZEUYXTPNANCFLMJ3TOSNERANCNFSM45GCKWFA>.
|
Hello, Please give me a moment to test the change with clang and I will merge the PR ;) Best, |
Hello again and sorry for the wait... It seems that the latest version of clang does not complain with your change. Maybe when I have the time I will implement the small array solution, which does not cast an integer from a pointer. Anyway, thank you for pointing that out, and thank you for your contribution. Best, for future references: Original call to |
Hi, again.
After reading your comments it dawned on me that the more robust/compiler-friendly way is to give the variable in the function header as a gpointer, not gint; the gpointer can then be converted to gint in the function.
The same goes for "apply_transmat".
Sorry for messing you around like this,
C.
…________________________________
差出人: Okadome Valencia ***@***.***>
送信日時: 2021年5月20日 16:00
宛先: arohl/gdis ***@***.***>
CC: クレイグ・フィッシャー ***@***.***>; Author ***@***.***>
件名: Re: [arohl/gdis] Fix error in function change_transmat (#34)
Merged #34<#34> into master.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#34 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AP5N32BED2VAJISE7YIJKMTTOSXRTANCNFSM45GCKWFA>.
|
Matrix entry update function "change_transmat" should only change one value at a time, instead of all at once, otherwise the requested matrix data will be overwritten after the first value with values already in the boxes.