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

Type mismatch in pi-dlp.h #7

Open
CoSoCo opened this issue Jul 29, 2022 · 1 comment
Open

Type mismatch in pi-dlp.h #7

CoSoCo opened this issue Jul 29, 2022 · 1 comment

Comments

@CoSoCo
Copy link

CoSoCo commented Jul 29, 2022

I already reported this problem erroneously on the JPilot project.

Please see juddmon/jpilot#39 for the details.

@CoSoCo CoSoCo changed the title type mismatch in /usr/include/pi-dlp.h Type mismatch in pi-dlp.h Aug 3, 2022
@CoSoCo
Copy link
Author

CoSoCo commented Aug 15, 2022

This bug lead to a complicated question here:
https://stackoverflow.com/questions/73210048/how-can-a-function-change-the-original-variable-when-it-is-passed-as-value-argu/73266886#73266886

It appears, that the value retrieved from dlp_exec (sd, req, &res) in dlp.c is only 32 bit, so we can use unsigned int for diriterator.
Because emum dlpVFSFileIteratorConstants are of type int, user should use casts like:

unsigned itr = (unsigned)vfsIteratorStart;
while ((emum dlpVFSFileIteratorConstants)itr != vfsIteratorStop) {
    PI_ERR result = dlp_VFSDirEntryEnumerate(sd, dirRef, &itr, &maxItems, &dirItems)
    [.....]

So here is a patch to solve the problem:
0003-Fix-type-mismatch-of-iterator-in-dlp_VFSDirEntryEnum.patch.zip

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

No branches or pull requests

1 participant