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

Add experimental support for big endian hosts (read part only) #703

Closed
wants to merge 4 commits into from

Conversation

stweil
Copy link
Contributor

@stweil stweil commented Feb 5, 2017

This PR is not ready for getting pulled. I put it here only for further discussion. See also issue #518.

Writing training data on big endian machines is currently not addressed.

@@ -69,6 +72,19 @@ class TFile {
char* FGets(char* buffer, int buffer_size);
// Replicates fread, returning the number of items read.
int FRead(void* buffer, int size, int count);
int FRead(char* buffer, unsigned count);
Copy link
Contributor

@egorpugin egorpugin Feb 5, 2017

Choose a reason for hiding this comment

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

Is it possible to implement this using templates?

}
#else

bool fread(uint8_t* data, FILE* f, size_t n = 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

templates?

@stweil
Copy link
Contributor Author

stweil commented Feb 5, 2017

Yes, I think it would be possible to use templates in both cases.

I did not do that because I wanted to see which cases occur in practice. Some of those cases are problematic, because they don't use portable data types: the current code reads and writes enum and int data which happen to be 32 bit on Intel, but maybe not everywhere.

stweil and others added 3 commits February 5, 2017 18:15
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit adds hacks to enforce more debug messages.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: root <root@bib.uni-mannheim.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
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.

3 participants