Skip to content

Update XADPDFParser.m#104

Open
MaddTheSane wants to merge 1 commit into
MacPaw:masterfrom
MaddTheSane:patch-1
Open

Update XADPDFParser.m#104
MaddTheSane wants to merge 1 commit into
MacPaw:masterfrom
MaddTheSane:patch-1

Conversation

@MaddTheSane

Copy link
Copy Markdown

Fix type of PDF's SortPages function.

An alternative is to use NSInteger instead of NSComparisonResult.
This should fix a void cast, most likely used to quiet a warning on OS X/iOS.

Fix type of PDF's SortPages function.
@MaddTheSane

Copy link
Copy Markdown
Author

Any feedback on this?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR corrects the comparator function type used to sort extracted PDF image objects by page order in XADPDFParser, aligning it with the codebase’s established NSComparisonResult comparator pattern and removing an unsafe function-pointer cast.

Changes:

  • Updated SortPages to return NSComparisonResult and to use NSOrderedAscending/Descending/Same constants.
  • Removed the (void *) cast when passing SortPages to sortUsingFunction:context:.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Krivoblotsky

Copy link
Copy Markdown
Contributor

Hi @MaddTheSane — sorry this has been sitting without feedback for so long.

The fix to SortPages's return type is a legit correction — using NSComparisonResult is the right type for a comparator. We'll review and merge this. Thank you for the contribution.

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.

4 participants