summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/m_swap.c12
-rw-r--r--src/m_swap.h9
-rw-r--r--src/w_wad.c9
3 files changed, 19 insertions, 11 deletions
diff --git a/src/m_swap.c b/src/m_swap.c
index 0a3cab6d..4fd31b85 100644
--- a/src/m_swap.c
+++ b/src/m_swap.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: m_swap.c 255 2006-01-05 02:48:03Z fraggle $
+// $Id: m_swap.c 342 2006-01-24 01:46:08Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.5 2006/01/24 01:46:08 fraggle
+// More endianness fixes
+//
// Revision 1.4 2006/01/05 02:48:03 fraggle
// Fixes for big endian machines (thanks locust)
//
@@ -41,14 +44,13 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: m_swap.c 255 2006-01-05 02:48:03Z fraggle $";
+rcsid[] = "$Id: m_swap.c 342 2006-01-24 01:46:08Z fraggle $";
#include "m_swap.h"
-// Not needed with big endian.
-#ifndef WORDS_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
// Swap 16bit, that is, MSB and LSB byte.
unsigned short SwapSHORT(unsigned short x)
@@ -58,7 +60,7 @@ unsigned short SwapSHORT(unsigned short x)
}
// Swapping 32bit.
-unsigned long SwapLONG( unsigned long x)
+unsigned int SwapLONG( unsigned int x)
{
return
(x>>24)
diff --git a/src/m_swap.h b/src/m_swap.h
index 87bef799..e0887038 100644
--- a/src/m_swap.h
+++ b/src/m_swap.h
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: m_swap.h 340 2006-01-23 21:56:18Z fraggle $
+// $Id: m_swap.h 342 2006-01-24 01:46:08Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -38,9 +38,9 @@
// WAD files are stored little endian.
#ifdef WORDS_BIGENDIAN
short SwapSHORT(short);
-long SwapLONG(long);
+int SwapLONG(int);
#define SHORT(x) ((short)SwapSHORT((unsigned short) (x)))
-#define LONG(x) ((long)SwapLONG((unsigned long) (x)))
+#define LONG(x) ((int)SwapLONG((unsigned int) (x)))
#else
#define SHORT(x) (x)
#define LONG(x) (x)
@@ -53,6 +53,9 @@ long SwapLONG(long);
//-----------------------------------------------------------------------------
//
// $Log$
+// Revision 1.7 2006/01/24 01:46:08 fraggle
+// More endianness fixes
+//
// Revision 1.6 2006/01/23 21:56:18 fraggle
// Include the config header so that endianness is dealt with correctly
//
diff --git a/src/w_wad.c b/src/w_wad.c
index 69605fa9..feb0c96f 100644
--- a/src/w_wad.c
+++ b/src/w_wad.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: w_wad.c 280 2006-01-10 22:14:13Z fraggle $
+// $Id: w_wad.c 342 2006-01-24 01:46:08Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.10 2006/01/24 01:46:08 fraggle
+// More endianness fixes
+//
// Revision 1.9 2006/01/10 22:14:13 fraggle
// Shut up compiler warnings
//
@@ -58,7 +61,7 @@
static const char
-rcsid[] = "$Id: w_wad.c 280 2006-01-10 22:14:13Z fraggle $";
+rcsid[] = "$Id: w_wad.c 342 2006-01-24 01:46:08Z fraggle $";
#include <ctype.h>
@@ -204,7 +207,7 @@ void W_AddFile (char *filename)
// single lump file
fileinfo = Z_Malloc(sizeof(filelump_t), PU_STATIC, 0);
fileinfo->filepos = 0;
- fileinfo->size = LONG(filelength(handle));
+ fileinfo->size = filelength(handle);
ExtractFileBase (filename, fileinfo->name);
numlumps++;
}