Skip to content

Commit

Permalink
Merge pull request #85 from MaddTheSane/endianFix
Browse files Browse the repository at this point in the history
Fix endian read-write for doubles.
  • Loading branch information
JeodC authored Apr 19, 2024
2 parents 1fb980d + c88af83 commit 99f86c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cfile/CFILE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ float cf_ReadFloat(CFILE *cfp) {
double cf_ReadDouble(CFILE *cfp) {
double f;
cf_ReadBytes((ubyte *)&f, sizeof(f), cfp);
#ifdef BIG_ENDIAN
#ifdef OUTRAGE_BIG_ENDIAN
{
double t;
int *sp = (int *)&f;
Expand Down Expand Up @@ -1015,7 +1015,7 @@ void cf_WriteFloat(CFILE *cfp, float f) {
// Write a double (64 bits)
// Throws an exception of type (cfile_error *) if the OS returns an error on write
void cf_WriteDouble(CFILE *cfp, double d) {
#ifdef BIG_ENDIAN
#ifdef OUTRAGE_BIG_ENDIAN
{
double t;
int *sp = (int *)&d;
Expand Down

0 comments on commit 99f86c5

Please sign in to comment.