Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Name: Leo the 28C (by Sulfurik)
Hello everyone!
Okay, my app here works fine under Windows and i386 Linux, however it won't work on my Linux PS3 which has a PowerPC processor.
Since it works on PC Linux, I bet it's an endianess issue. The problem is that I have a binary file that the app uses to load its data. Well, I read a single byte and it turns out to be zero instead of the expected 12.
All I do here is fgetc() for single bytes and fread() for strings, so I don't know how endianess applies here...
Any ideas? Thanks in advance!
If I connect my microwave to my PC, will I be able to download food? I posted a question, haha

Hard to tell if your problem is due to endian issues or not.
I'm not going to explain what big/little-endian is or the details of the issues involved. See:
http://developer.apple.com/document...
http://support.microsoft.com/kb/102025
http://www.webopedia.com/TERM/b/big...
for some information. Use google for more info.
The PowerPC is bi-endian. It can be switched from one mode to the other programatically.
But if you are reading a previously foreign formatted stream, you are going to have to do the conversion yourself, in your code.
If you really want to understand this you need to write a couple of Assembler programs, some on a little-endian box (Intel e.g.), some on a big-endian box (IBM mainframe e.g.).
Low level code should really support both/either. See the TIF file specification for example: if you process TIFs you must be able to handle either format.
So ..... how does your code use 'fgetc' to read e.g. a 4 byte 'int'??

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |