Skip to content

type mismatch in pi-dlp.h #39

@CoSoCo

Description

@CoSoCo

The iterator constants are defined as signed int via enum (line 538):

	/** @brief VFS file iterator constants */
	enum dlpVFSFileIteratorConstants {
		vfsIteratorStart	= 0,		/** < Indicates that iterator is beginning */
		vfsIteratorStop		= -1		/**< Indicate that iterator has gone through all items */
	};

But the iterator function requires an unsigned long diriterator parameter (line 1596):

	extern PI_ERR dlp_VFSDirEntryEnumerate
		PI_ARGS((int sd, FileRef dirref, unsigned long *diriterator, int *maxitems, struct VFSDirInfo *diritems));

This causes an endless loop when using it straight forward (seen in Pics&Videos Plugin) like:

            unsigned long dirIterator = vfsIteratorStart;
            while (dirIterator != vfsIteratorStop) {
                dlp_VFSDirEntryEnumerate(sd, dirRef, &dirIterator, &maxDirItems, dirInfo);
                [.....]
            }

Anyway, there is a workaround, but it's not smart:

            unsigned long dirIterator = (unsigned long)vfsIteratorStart;
            while ((enum dlpVFSFileIteratorConstants)dirIterator != vfsIteratorStop) {
                dlp_VFSDirEntryEnumerate(sd, dirRef, &dirIterator, &maxDirItems, dirInfo);
                [.....]
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions