MaddTheSane / Simple-Comic

macOS comic viewer
MIT License
260 stars 22 forks source link

Found an error in code that causes the project to fail to build. After being corrected, the project can be built successfully. #122

Closed hyrulelinks closed 2 months ago

hyrulelinks commented 2 months ago

search in xcode

ssize_t windowoffs=CurrentLZSSWindowOffset(self);

change to

size_t windowoffs=CurrentLZSSWindowOffset(self);

However, I am not sure whether this modification is the author's original programming intention. The original author needs to evaluate whether the above modification is appropriate, so no PR has been initiated.

@MaddTheSane

MaddTheSane commented 2 months ago

What specific error are you getting? ssize_t is a valid type, the same size as size_t, just signed as opposed to unsigned.

hyrulelinks commented 2 months ago

I want to use the xcodebuild command not to sign, but to build it in a local way. The error message is as follows:

The following build commands failed:
    CompileC /Users/username/Library/Developer/Xcode/DerivedData/SimpleComic-faixbivhnryjjyfjwccwnuymmefe/Build/Intermediates.noindex/XADMaster.build/Release/XADMaster.build/Objects-normal/arm64/LZSS.o /Users/username/Downloads/Simple-Comic/Vendor/XADMaster/LZSS.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler (in target 'XADMaster' from project 'XADMaster')
    Building project SimpleComic with scheme Simple Comic and configuration Release
(2 failures)

Then open xcode and find that the "ssize_t windowoffs=CurrentLZSSWindowOffset(self);" above prompts an error. After changing it to "size_t windowoffs=CurrentLZSSWindowOffset(self);", it can be built normally.

I am a beginner who has just started programming. The above modifications were made based on intuition at that time, and I am not clear about the principles involved.

MaddTheSane commented 2 months ago

What OS/Xcode versions are you using?

hyrulelinks commented 2 months ago

macOS 15.1 Beta Xcode 16.0 Beta 6

MaddTheSane commented 2 months ago

I was able to reproduce the error with Xcode 16 beta 5, and have fixed the file (by including <sys/types.h>).

hyrulelinks commented 2 months ago

greatful