[chocolate-doom] 27/79: Fixes for big endian machines (thanks locust)

Jonathan Dowland jmtd at moszumanska.debian.org
Mon Jan 30 15:07:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

jmtd pushed a commit to annotated tag chocolate-doom-0.1.3
in repository chocolate-doom.

commit 3fcdb6dc1835c87655ae45a1d362dc8b09f6849c
Author: Simon Howard <fraggle at gmail.com>
Date:   Thu Jan 5 02:48:03 2006 +0000

    Fixes for big endian machines (thanks locust)
    
    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 255
---
 NEWS           |  2 ++
 configure.in   |  2 ++
 src/m_swap.c   |  9 ++++++---
 src/m_swap.h   | 11 +++++------
 src/mmus2mid.c | 15 +++++++++------
 5 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/NEWS b/NEWS
index 3631bd0..511e136 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
 
+    Fixes for big endian machines (thanks locust)
+
 0.1.2 (2005-10-29):
 
     Silence sounds at odd sample rates (rather than bombing out); this
diff --git a/configure.in b/configure.in
index 222013b..bced995 100644
--- a/configure.in
+++ b/configure.in
@@ -45,6 +45,8 @@ AC_SUBST(SDLNET_LIBS)
 
 AC_SUBST(ac_aux_dir)
 
+AC_C_BIGENDIAN
+
 AC_OUTPUT([
 Makefile
 textscreen/Makefile
diff --git a/src/m_swap.c b/src/m_swap.c
index 599908f..0a3cab6 100644
--- a/src/m_swap.c
+++ b/src/m_swap.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: m_swap.c 18 2005-07-23 18:56:07Z fraggle $
+// $Id: m_swap.c 255 2006-01-05 02:48:03Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.4  2006/01/05 02:48:03  fraggle
+// Fixes for big endian machines (thanks locust)
+//
 // Revision 1.3  2005/07/23 18:56:07  fraggle
 // Remove unneccessary pragmas
 //
@@ -38,14 +41,14 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: m_swap.c 18 2005-07-23 18:56:07Z fraggle $";
+rcsid[] = "$Id: m_swap.c 255 2006-01-05 02:48:03Z fraggle $";
 
 
 #include "m_swap.h"
 
 
 // Not needed with big endian.
-#ifndef __BIG_ENDIAN__
+#ifndef WORDS_BIGENDIAN
 
 // Swap 16bit, that is, MSB and LSB byte.
 unsigned short SwapSHORT(unsigned short x)
diff --git a/src/m_swap.h b/src/m_swap.h
index 881574e..9774e72 100644
--- a/src/m_swap.h
+++ b/src/m_swap.h
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: m_swap.h 75 2005-09-05 22:50:56Z fraggle $
+// $Id: m_swap.h 255 2006-01-05 02:48:03Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -35,7 +35,7 @@
 
 // Endianess handling.
 // WAD files are stored little endian.
-#ifdef __BIG_ENDIAN__
+#ifdef WORDS_BIGENDIAN
 short	SwapSHORT(short);
 long	SwapLONG(long);
 #define SHORT(x)	((short)SwapSHORT((unsigned short) (x)))
@@ -43,10 +43,6 @@ long	SwapLONG(long);
 #else
 #define SHORT(x)	(x)
 #define LONG(x)         (x)
-#define doom_wtohs(x)   ((short int) (x))
-#define doom_htows(x)   ((short int) (x))
-#define doom_wtohl(x)   ((long int) (x))
-#define doom_htowl(x)   ((long int) (x))
 #endif
 
 
@@ -56,6 +52,9 @@ long	SwapLONG(long);
 //-----------------------------------------------------------------------------
 //
 // $Log$
+// Revision 1.5  2006/01/05 02:48:03  fraggle
+// Fixes for big endian machines (thanks locust)
+//
 // Revision 1.4  2005/09/05 22:50:56  fraggle
 // Add mmus2mid code from prboom.  Use 'void *' for music handles.  Pass
 // length of data when registering music.
diff --git a/src/mmus2mid.c b/src/mmus2mid.c
index 59dadca..5e6cb5e 100644
--- a/src/mmus2mid.c
+++ b/src/mmus2mid.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: mmus2mid.c 76 2005-09-06 21:06:45Z fraggle $
+// $Id: mmus2mid.c 255 2006-01-05 02:48:03Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 //  Copyright (C) 1999 by
@@ -27,6 +27,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.3  2006/01/05 02:48:03  fraggle
+// Fixes for big endian machines (thanks locust)
+//
 // Revision 1.2  2005/09/06 21:06:45  fraggle
 // Newer versions of mmus2mid.c,h from prboom
 //
@@ -340,11 +343,11 @@ int mmus2mid(const UBYTE *mus, MIDI *mididata, UWORD division, int nocomp)
   // copy the MUS header from the MUS buffer to the MUSh header structure
 
   memcpy(&MUSh,mus,sizeof(MUSheader));
-  MUSh.ScoreLength = doom_wtohs(MUSh.ScoreLength);
-  MUSh.ScoreStart  = doom_wtohs(MUSh.ScoreStart);
-  MUSh.channels    = doom_wtohs(MUSh.channels);
-  MUSh.SecChannels = doom_wtohs(MUSh.SecChannels);
-  MUSh.InstrCnt    = doom_wtohs(MUSh.InstrCnt);
+  MUSh.ScoreLength = SHORT(MUSh.ScoreLength);
+  MUSh.ScoreStart  = SHORT(MUSh.ScoreStart);
+  MUSh.channels    = SHORT(MUSh.channels);
+  MUSh.SecChannels = SHORT(MUSh.SecChannels);
+  MUSh.InstrCnt    = SHORT(MUSh.InstrCnt);
 
   // check some things and set length of MUS buffer from internal data
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/chocolate-doom.git



More information about the Pkg-games-commits mailing list