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

[win] UnixFILE GetInt primitives return unsigned #231

Closed
jleben opened this issue May 6, 2012 · 2 comments
Closed

[win] UnixFILE GetInt primitives return unsigned #231

jleben opened this issue May 6, 2012 · 2 comments
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. os: Windows

Comments

@jleben
Copy link
Member

jleben commented May 6, 2012

[Issue migrated from SourceForge | ID: 3470125 | Submitted by 'jamshark70']
[http://sourceforge.net/support/tracker.php?aid=3470125]

In UNIX-based systems, getInt8 and getInt16 methods of File (implemented in UnixFILE) return signed integers. In Windows, the same methods return unsigned. This breaks code libraries (for example, SimpleMIDIFile in wslib) that expect signed integers.

The primitive should be fixed so that the behavior in Windows is consistent with Linux/osx.

p = PathName.tmp +/+ "onechar.txt";
f = File(p, "w");
f.putInt8(255);
f.close;

f = File(p, "r");
f.getInt8.postln; // should print -1 on all platforms
f.close;

@jleben
Copy link
Member Author

jleben commented May 6, 2012

[Comment migrated from SourceForge | Submitted by 'timblech']

i can see the reason for int8, but not for int16. can you confirm that reading int16 will return unsigned chars?

@timblechmann
Copy link
Contributor

most likely fixed in e34628c. if not, please reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. os: Windows
Projects
None yet
Development

No branches or pull requests

2 participants