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

PTPObjectInfo related improvements #1039

Merged
merged 11 commits into from
Oct 10, 2024
Merged

Commits on Oct 10, 2024

  1. ptp2: move 'oid' variable into PTPObjectInfo as (Object) 'Handle'

    The (Object) Handle member is not part of the "ObjectInfo dataset" in the
    specification but added here to avoid having to carry it around by
    separate means throughout the code base, as it is regularly required in
    combination. While the spec always refers to this item as "ObjectHandle",
    the term "Handle" is only used in this context, so we omit the
    "Object"-prefix for brevity.
    
    Switching from oid/ObjectID, which is nowere to be found the spec,
    increases consistency with the spec and the rest of the code base.
    
    This allows to remove the struct _PTPCanon_New_Object from the codebase.
    
    @msmeissn I added 2 TODO comments for you take a close look, pointing out:
     * a memory leak that I did not want to touch because I can't test it
     * a presumed bug fix where newobject was 0 when passed to ptp_getobject
    axxel committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    cce04d5 View commit details
    Browse the repository at this point in the history
  2. ptp2: replace (most) oid/object_id symbols with handle

    See last commit for reasoning of choosing this terminology.
    
    TLDR: consistency spec / other API
    axxel committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    521c8e2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cfc782e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3fa578b View commit details
    Browse the repository at this point in the history
  5. ptp2: fix some potential memory leaks of PTPObjectInfo::Filename

    This should better be fixed once and for all by replacing the heap
    allocated `char* Filename` with a statically sized buffer. If only I
    knew the 'correct' size for that.
    
    See also here: petabyt/camlib@20fb75a#r147761481
    axxel committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    aa1241d View commit details
    Browse the repository at this point in the history
  6. ptp2: replace PTPObjectHandles and PTPStorageIDs with generic array

    This adds a set of macros implementing a generic array or list of TYPE.
    This is basically a TYPE* pointer and a length integer. This structure
    together with the typical use-cases repeats regularly throughout the
    codebase. It raises the level of abstraction and improves code
    readabilty. I'm a c++ developer and miss my STL ;).
    
    I'm starting here with PTPObjectHandles and PTPStorageIDs as those were
    already modeling an array abstraction. There are other arrays of stuff
    that can benefit from this later.
    axxel committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    b9ab60d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4f50134 View commit details
    Browse the repository at this point in the history
  8. ci: fix CI build by add missing libltdl-dev on ubuntu

    Looks like they changed the build image...
    axxel committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    eefde03 View commit details
    Browse the repository at this point in the history
  9. ptp2: fix -Wshadow warning

    axxel committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    359993d View commit details
    Browse the repository at this point in the history
  10. ptp2: fix build failures on macos...

     * apparently reallocarray() is not supported
     * the compiler seems to have an issue with a goto label position
    axxel committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    a2718e5 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0c0a27d View commit details
    Browse the repository at this point in the history