1 /*
2 Copyright (C) 2002 John R. Hall
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 */
20 //***************************************************************************
21 //
22 // byteordr.c - Byte order conversion routines.
23 //
24 //***************************************************************************
25
26 #include "rt_def.h"
27 #include "rt_util.h"
28 #include "byteordr.h"
29 #include "lumpy.h"
30
31 #define DEFINE_CONVERTER(type) \
32 void Cvt_##type(void *lmp, int num) \
33 { \
34 int i; \
35 type *recs = (type *)lmp; \
36 for (i = 0; i < num; i++, recs++) { \
37 CONVERT_ENDIAN_##type(recs); \
38 } \
39 }
40
41 DEFINE_CONVERTER(pic_t);
42 DEFINE_CONVERTER(lpic_t);
43 DEFINE_CONVERTER(font_t);
44 DEFINE_CONVERTER(lbm_t);
45 DEFINE_CONVERTER(patch_t);
46 DEFINE_CONVERTER(transpatch_t);
47 DEFINE_CONVERTER(cfont_t);
48
49
CvtNull(void * lmp,int num)50 void CvtNull(void *lmp, int num)
51 {
52 Debug("No-op endian converter on %p.\n", lmp);
53 }
54
CvtFixme(void * lmp,int num)55 void CvtFixme(void *lmp, int num)
56 {
57 Debug("FIXME endian converter on %p.\n", lmp);
58 }
59