-
Notifications
You must be signed in to change notification settings - Fork 325
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
More code cosmetic #1029
Merged
Merged
More code cosmetic #1029
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Move the byte-order-swapping helpers from ptp-pack.c to ptp.h as well as 2 ptp_free_deviceinfo variants and remove all but one ptp-pack.c inclusions. This speeds up compile time and removes lots of compiler warning repetitions if one shows up in ptp-pack.c.
Layout this one case block just like the other ones. This is basically a whitespace only change.
PTPDeviceProperty data of EOS cameras is not polled but rather pro-actively sent by the camera via a PropValueChanged event. The unpack function used to interpret the data and unpack it into the PTPDevicePropDesc struct but also copied the raw event data block into an extra member (data, size) of the special special PTPCanon_Property struct. This data is then never looked at again. This patch removes those data members and is a first step to completely eliminate the special PTPCanon_Property struct.
Make the names more consistent and expressive.
The proptype (a.k.a. device property code) is already stored in dpd.DevicePropertyCode member. This patch introduces the ptp_find_eos_devicepropdesc() function for the commonly repeated for-loop looking for the DevicePropDesc* in the cache. This now allows to completely replace PTPCanon_Property with PTPDevicePropDesc and then drop the canon_props array altogether and use the generic one.
The current value of the device property is only stored in the desc.CurrentValue field.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is basically code cosmetic that prepares the removal of
params->canon_props
member and accompanying EOS specific handler functions.