Skip to content
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 11 commits into from
Sep 25, 2024
Merged

More code cosmetic #1029

merged 11 commits into from
Sep 25, 2024

Conversation

axxel
Copy link
Contributor

@axxel axxel commented Sep 25, 2024

This is basically code cosmetic that prepares the removal of params->canon_props member and accompanying EOS specific handler functions.

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.
camlibs/ptp2/ptp-pack.c Dismissed Show dismissed Hide dismissed
camlibs/ptp2/ptp-pack.c Dismissed Show dismissed Hide dismissed
@msmeissn msmeissn merged commit da7dead into gphoto:master Sep 25, 2024
5 checks passed
@axxel axxel deleted the more-code-cosmetic branch September 25, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants