Skip to content

sdl: use versioned library, cleanup ffi/util helpers#1929

Merged
Frenzie merged 2 commits into
koreader:masterfrom
benoit-pierre:pr/use_versioned_sdl2_+_cleanup_ffi.util_helpers
Sep 22, 2024
Merged

sdl: use versioned library, cleanup ffi/util helpers#1929
Frenzie merged 2 commits into
koreader:masterfrom
benoit-pierre:pr/use_versioned_sdl2_+_cleanup_ffi.util_helpers

Conversation

@benoit-pierre

@benoit-pierre benoit-pierre commented Sep 8, 2024

Copy link
Copy Markdown
Member

This change is Reviewable

benoit-pierre added a commit to benoit-pierre/koreader that referenced this pull request Sep 8, 2024
@benoit-pierre benoit-pierre force-pushed the pr/use_versioned_sdl2_+_cleanup_ffi.util_helpers branch from 159e565 to 62e0cec Compare September 21, 2024 20:32
@NiLuJe

NiLuJe commented Sep 21, 2024

Copy link
Copy Markdown
Member

(nit: typo in the commit msg if this is to be a rebase, ffi/input is gone, not ffi/util ;)).

@NiLuJe NiLuJe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions, but good to go on principle ;).

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @benoit-pierre)


ffi/util.lua line 685 at r1 (raw file):

        libSDL2, err = util.ffiLoadCandidates(candidates)
        if not libSDL2 then
            print("SDL2 not loaded:", libSDL2)

Shouldn't this still be printing err? libSDL2 is always false in this branch.


ffi/util.lua line 688 at r1 (raw file):

        end
    end
    return libSDL2 or nil

Would returning a false libSDL2 (as opposed to nil) here be an issue for ffi/SDL2_0.lua?

Or, perhaps a better question would be: should ffi/SDL2_0.lua handle failure to load SDL2 in a specific way?

@benoit-pierre benoit-pierre force-pushed the pr/use_versioned_sdl2_+_cleanup_ffi.util_helpers branch from 62e0cec to 34dbf6f Compare September 21, 2024 22:07
@benoit-pierre benoit-pierre force-pushed the pr/use_versioned_sdl2_+_cleanup_ffi.util_helpers branch from 34dbf6f to 6efa4c3 Compare September 21, 2024 22:09

@NiLuJe NiLuJe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @benoit-pierre)

@benoit-pierre

Copy link
Copy Markdown
Member Author

ffi/util.lua line 685 at r1 (raw file):

        libSDL2, err = util.ffiLoadCandidates(candidates)
        if not libSDL2 then
            print("SDL2 not loaded:", libSDL2)

Shouldn't this still be printing err? libSDL2 is always false in this branch.

Yep.

ffi/util.lua line 688 at r1 (raw file):

        end
    end
    return libSDL2 or nil

Would returning a false libSDL2 (as opposed to nil) here be an issue for ffi/SDL2_0.lua?

Or, perhaps a better question would be: should ffi/SDL2_0.lua handle failure to load SDL2 in a specific way?

No (it will fail in frontend/device.lua before that), but it's cleaner / more logical, no?

@NiLuJe NiLuJe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @benoit-pierre)

@Frenzie Frenzie merged commit be74047 into koreader:master Sep 22, 2024
@benoit-pierre benoit-pierre deleted the pr/use_versioned_sdl2_+_cleanup_ffi.util_helpers branch September 22, 2024 16:32
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.

3 participants