|
From: <and...@us...> - 2006-04-09 11:29:51
|
Revision: 1236 Author: andreradke Date: 2006-04-09 04:28:08 -0700 (Sun, 09 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1236&view=rev Log Message: ----------- Reorganized macros and code for byte swapping in preparation for MacIntel build. The byte swapping macros moved to their own header file, byteorder.h. The byte order swapping code moved to the corresponding byteorder.c. The VC2K3 and VC2K5 projects have been updated to include the new files, the remaining projects will be updated shortly. The byte swapping functions in byteorder.c should now work with all compilers and for all target platforms. Modified Paths: -------------- Frontier/trunk/Common/SystemHeaders/standard.h Frontier/trunk/Common/headers/macconv.h Frontier/trunk/Common/headers/osincludes.h Frontier/trunk/Common/source/cancoon.c Frontier/trunk/Common/source/claylinelayout.c Frontier/trunk/Common/source/db.c Frontier/trunk/Common/source/langexternal.c Frontier/trunk/Common/source/langhash.c Frontier/trunk/Common/source/langhtml.c Frontier/trunk/Common/source/langpack.c Frontier/trunk/Common/source/langregexp.c Frontier/trunk/Common/source/langscan.c Frontier/trunk/Common/source/langtree.c Frontier/trunk/Common/source/langvalue.c Frontier/trunk/Common/source/memory.c Frontier/trunk/Common/source/menupack.c Frontier/trunk/Common/source/odbengine.c Frontier/trunk/Common/source/oplist.c Frontier/trunk/Common/source/oppack.c Frontier/trunk/Common/source/pict.c Frontier/trunk/Common/source/quickdraw.c Frontier/trunk/Common/source/shellsysverbs.c Frontier/trunk/Common/source/strings.c Frontier/trunk/Common/source/tableformats.c Frontier/trunk/Common/source/tablepack.c Frontier/trunk/Common/source/tablestructure.c Frontier/trunk/Common/source/wpengine.c Frontier/trunk/build_VC2K3/Frontier.vcproj Frontier/trunk/build_VC2K5/Frontier.vcproj Added Paths: ----------- Frontier/trunk/Common/headers/byteorder.h Frontier/trunk/Common/source/byteorder.c Modified: Frontier/trunk/Common/SystemHeaders/standard.h =================================================================== --- Frontier/trunk/Common/SystemHeaders/standard.h 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/SystemHeaders/standard.h 2006-04-09 11:28:08 UTC (rev 1236) @@ -40,32 +40,6 @@ #include "FastTimes.h" #endif -#ifdef PACKFLIPPED - #define conditionallongswap(x) dolongswap(x) - #define conditionalshortswap(x) doshortswap(x) - #define conditionalenumswap(x) doshortswap(x) - #define disklong(x) dolongswap(x) - #define memlong(x) dolongswap(x) - #define diskshort(x) doshortswap(x) - #define memshort(x) doshortswap(x) - #define disktomemshort(x) shortswap(x) - #define disktomemlong(x) longswap(x) - #define memtodiskshort(x) shortswap(x) - #define memtodisklong(x) longswap(x) -#else - #define conditionallongswap(x) x - #define conditionalshortswap(x) x - #define conditionalenumswap(x) x - #define disklong(x) x - #define memlong(x) x - #define diskshort(x) x - #define memshort(x) x - #define disktomemshort(x) - #define disktomemlong(x) - #define memtodiskshort(x) - #define memtodisklong(x) -#endif - #include "stringdefs.h" /* embedded string definitions */ #ifndef appletdefsinclude Added: Frontier/trunk/Common/headers/byteorder.h =================================================================== --- Frontier/trunk/Common/headers/byteorder.h (rev 0) +++ Frontier/trunk/Common/headers/byteorder.h 2006-04-09 11:28:08 UTC (rev 1236) @@ -0,0 +1,77 @@ + +/* $Id: $ */ + +/****************************************************************************** + + UserLand Frontier(tm) -- High performance Web content management, + object database, system-level and Internet scripting environment, + including source code editing and debugging. + + Copyright (C) 1992-2004 UserLand Software, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +******************************************************************************/ + +#ifndef byteorderinclude +#define byteorderinclude + +/* + 2006-04-08 aradke: determine native byte order and define byte swapping macros +*/ + +#if (defined(WIN32) || defined(__i386) || defined(__i386__)) && !defined(__LITTLE_ENDIAN__) + #define __LITTLE_ENDIAN__ 1 +#endif + + +#if defined(__LITTLE_ENDIAN__) && ((__LITTLE_ENDIAN__ == 1) || !defined (__BIG_ENDIAN__)) + #define conditionallongswap(x) dolongswap(x) + #define conditionalshortswap(x) doshortswap(x) + #define conditionalenumswap(x) doshortswap(x) + #define disklong(x) dolongswap(x) + #define memlong(x) dolongswap(x) + #define diskshort(x) doshortswap(x) + #define memshort(x) doshortswap(x) + #define disktomemshort(x) shortswap(x) + #define disktomemlong(x) longswap(x) + #define memtodiskshort(x) shortswap(x) + #define memtodisklong(x) longswap(x) +#elif defined(__BIG_ENDIAN__) && ((__BIG_ENDIAN__ == 1) || !defined (__LITTLE_ENDIAN__)) + #define conditionallongswap(x) x + #define conditionalshortswap(x) x + #define conditionalenumswap(x) x + #define disklong(x) x + #define memlong(x) x + #define diskshort(x) x + #define memshort(x) x + #define disktomemshort(x) + #define disktomemlong(x) + #define memtodiskshort(x) + #define memtodisklong(x) +#else + #error "Couldn't determine byte order of target architecture, update osincludes.h" +#endif + + +#define longswap(foo) do {foo = dolongswap(foo);} while (0) +#define shortswap(foo) do {foo = doshortswap(foo);} while (0) + + +long dolongswap (long); /* byteorder.c */ +short doshortswap (short); + + +#endif /* byteorderinclude */ Modified: Frontier/trunk/Common/headers/macconv.h =================================================================== --- Frontier/trunk/Common/headers/macconv.h 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/headers/macconv.h 2006-04-09 11:28:08 UTC (rev 1236) @@ -87,60 +87,6 @@ #define HiWord(x) HIWORD(x) -static long dolongswap(long foo) - { -#if defined(__i386__) && defined(__GNUC__) - /* - 10.0a5 - TRT - 29 Dec 2004 - GNU by default uses the AT&T assembly code syntax; - MSC/MWERKS uses the Intel assembly code syntax; - some versions of 'gcc' accept -masm=att|intel to - specify which syntax to use; but for those that don't... - */ - __asm__("mov foo,%eax\nbswap %eax\nmov %eax,foo\n"); -#elif defined(__powerpc__) && defined(__GNUC__) - foo = Endian32_Swap(foo); -#else - _asm - { - mov eax,foo - bswap eax - mov foo,eax - } -#endif - return (foo); - } - -static short doshortswap(short foo) - { -#if defined(__i386__) && defined(__GNUC__) - /* - 10.0a5 - TRT - 29 Dec 2004 - GNU by default uses the AT&T assembly code syntax; - MSC/MWERKS uses the Intel assembly code syntax; - some versions of 'gcc' accept -masm=att|intel to - specify which syntax to use; but for those that don't... - */ - __asm__("mov foo,%ax\n mov %al,%bh\nmov %ah,%bl\nmov %bx,foo"); -#elif defined(__powerpc__) && defined(__GNUC__) - foo = Endian16_Swap(foo); -#else - _asm - { - mov ax,foo - mov bh,al - mov bl,ah - mov foo,bx - } -#endif - return (foo); - } - -#define longswap(foo) do {foo = dolongswap(foo);} while (0) - -#define shortswap(foo) do {foo = doshortswap(foo);} while (0) - - enum { /* Apple event descriptor types */ typeBoolean = 'bool', Modified: Frontier/trunk/Common/headers/osincludes.h =================================================================== --- Frontier/trunk/Common/headers/osincludes.h 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/headers/osincludes.h 2006-04-09 11:28:08 UTC (rev 1236) @@ -307,19 +307,5 @@ #include <string.h> #include <assert.h> -/* - 2006-04-07 aradke: determine native byte order. - checking whether WIN32 is defined is rather crude, - but I haven't found a better way yet. -*/ -#if defined(__LITTLE_ENDIAN__) || defined(WIN32) - #define PACKFLIPPED 1 /* enable little endian / big endian conversion for database file functions */ -#elif defined(__BIG_ENDIAN__) - #undef PACKFLIPPED /* big endian is native database format, no need to convert */ -#else - #error Failed to determine native byte order of target architecture, update osincludes.h -#endif - - #endif /* __osincludes_h__ */ Added: Frontier/trunk/Common/source/byteorder.c =================================================================== --- Frontier/trunk/Common/source/byteorder.c (rev 0) +++ Frontier/trunk/Common/source/byteorder.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -0,0 +1,128 @@ + +/* $Id: $ */ + +/****************************************************************************** + + UserLand Frontier(tm) -- High performance Web content management, + object database, system-level and Internet scripting environment, + including source code editing and debugging. + + Copyright (C) 1992-2004 UserLand Software, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +******************************************************************************/ + +#include "frontier.h" +#include "standard.h" + +#include "byteorder.h" + +//#if (defined(TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON == 1)) +//#include <CoreFoundation/CoreFoundation.h> +//#include <CFByteOrder.h> +//#endif + + +long dolongswap (long foo) { + + /* + 2006-04-09 aradke: utility function for swapping the byte order + of 32-bit integers from big endian to little endian and vice versa. + */ + +#if (defined(TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON == 1)) + + foo = CFSwapInt32 (foo); + +#elif (defined(__i386__) && defined(__GNUC__)) + + /* + 10.0a5 - TRT - 29 Dec 2004 + GNU by default uses the AT&T assembly code syntax; + MSC/MWERKS uses the Intel assembly code syntax; + some versions of 'gcc' accept -masm=att|intel to + specify which syntax to use; but for those that don't... + */ + __asm__("mov foo,%eax\nbswap %eax\nmov %eax,foo\n"); + +#elif defined(WIN32) /* intel x86 assembler code */ + + _asm + { + mov eax,foo + bswap eax + mov foo,eax + } + +#else /* default implementation using just C operators, should work with all compilers */ + + #pragma warning "Using default implementation of dolongswap, edit byteorder.c to implement faster native implementation" + + foo = ((((foo) >> 24) & 0x000000ff) /* if all else fails, do it the slow way */ + | (((foo) & 0x00ff0000) >> 8) + | (((foo) & 0x0000ff00) << 8) + | (((foo) & 0x000000ff) << 24)); + +#endif + + return (foo); + } /*dolongswap*/ + + +short doshortswap (short foo) { + + /* + 2006-04-09 aradke: utility function for swapping the byte order + of 16-bit integers from big endian to little endian and vice versa. + */ + +#if (defined(TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON == 1)) + + foo = CFSwapInt16 (foo); + +#elif (defined(__i386__) && defined(__GNUC__)) + + /* + 10.0a5 - TRT - 29 Dec 2004 + GNU by default uses the AT&T assembly code syntax; + MSC/MWERKS uses the Intel assembly code syntax; + some versions of 'gcc' accept -masm=att|intel to + specify which syntax to use; but for those that don't... + */ + __asm__("mov foo,%ax\n mov %al,%bh\nmov %ah,%bl\nmov %bx,foo"); + +#elif defined(WIN32) /* intel x86 assembler code */ + + _asm + { + mov ax,foo + mov bh,al + mov bl,ah + mov foo,bx + } + +#else /* default implementation using just C operators, should work with all compilers */ + + #pragma warning "Using default implementation of doshortswap, edit byteorder.c to implement faster native implementation" + + foo = ((((foo) >> 8) & 0x00ff) /* if all else fails, do it the slow way */ + | (((foo) << 8) & 0xff00)); + +#endif + + return (foo); + } /*doshortswap*/ + Modified: Frontier/trunk/Common/source/cancoon.c =================================================================== --- Frontier/trunk/Common/source/cancoon.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/cancoon.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -65,6 +65,7 @@ #include "serialnumber.h" #include "WinSockNetEvents.h" /*6.2a14 AR*/ +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ Modified: Frontier/trunk/Common/source/claylinelayout.c =================================================================== --- Frontier/trunk/Common/source/claylinelayout.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/claylinelayout.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -44,6 +44,7 @@ #include "tablestructure.h" #include "claybrowser.h" //#include "clayicons.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ typedef struct tydisklinelayout { Modified: Frontier/trunk/Common/source/db.c =================================================================== --- Frontier/trunk/Common/source/db.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/db.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -39,6 +39,7 @@ #include "db.h" #include "dbinternal.h" #include "ops.h" //6.2b3 AR: for numbertostring +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #include "frontierdebug.h" //6.2b7 AR Modified: Frontier/trunk/Common/source/langexternal.c =================================================================== --- Frontier/trunk/Common/source/langexternal.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langexternal.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -57,9 +57,9 @@ #include "tableformats.h" /*7.0b6 PBS*/ #include "menuverbs.h" /*7.0b6 PBS*/ #include "op.h" /*7.0b6 PBS*/ +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ - /* boolean langexternalload (hdlexternalvariable hvariable, Handle *h) { Modified: Frontier/trunk/Common/source/langhash.c =================================================================== --- Frontier/trunk/Common/source/langhash.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langhash.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -44,6 +44,7 @@ #include "tableverbs.h" #include "oplist.h" #include "timedate.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ #include "aeutils.h" /*PBS 03/14/02: AE OS X fix.*/ Modified: Frontier/trunk/Common/source/langhtml.c =================================================================== --- Frontier/trunk/Common/source/langhtml.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langhtml.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -65,6 +65,7 @@ #endif #include "tableverbs.h" //6.1b8 AR: we need gettablevalue +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #include "iso8859.c" Modified: Frontier/trunk/Common/source/langpack.c =================================================================== --- Frontier/trunk/Common/source/langpack.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langpack.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -40,6 +40,7 @@ #include "langexternal.h" #include "langsystem7.h" #include "tablestructure.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ Modified: Frontier/trunk/Common/source/langregexp.c =================================================================== --- Frontier/trunk/Common/source/langregexp.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langregexp.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -48,6 +48,7 @@ #include "kernelverbs.h" #include "kernelverbdefs.h" #include "search.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #include "langregexp.h" Modified: Frontier/trunk/Common/source/langscan.c =================================================================== --- Frontier/trunk/Common/source/langscan.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langscan.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -35,10 +35,10 @@ #include "lang.h" #include "langinternal.h" #include "langparser.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ - #define chstartcomment (byte) chcomment #define chendscanstring (byte)0 /*returned when we've run out of text*/ Modified: Frontier/trunk/Common/source/langtree.c =================================================================== --- Frontier/trunk/Common/source/langtree.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langtree.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -33,6 +33,7 @@ #include "lang.h" #include "langinternal.h" #include "tablestructure.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ typedef struct tydisktreenode { Modified: Frontier/trunk/Common/source/langvalue.c =================================================================== --- Frontier/trunk/Common/source/langvalue.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langvalue.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -56,6 +56,7 @@ #endif #include "timedate.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ Modified: Frontier/trunk/Common/source/memory.c =================================================================== --- Frontier/trunk/Common/source/memory.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/memory.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -33,6 +33,7 @@ #include "ops.h" #include "shellhooks.h" #include "strings.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #define safetycushionsize 0x2800 /*10K*/ @@ -1814,7 +1815,7 @@ *hmerged = nil; /*default return value*/ sizefirsthandle = gethandlesize (h1); - storesizefirsthandle = conditionallongswap (sizefirsthandle); + storesizefirsthandle = disklong (sizefirsthandle); sizesecondhandle = gethandlesize (h2); @@ -1924,9 +1925,7 @@ moveleft (*h, &sizefirsthandle, sizeof (long)); -#ifdef PACKFLIPPED - longswap (sizefirsthandle); -#endif + disktomemlong (sizefirsthandle); ix = sizeof (long); @@ -1978,7 +1977,7 @@ memoryerror (); return (false); - } /*unmergehandles*/ + } /*debugunmergehandles*/ boolean debugnewintarray (char * filename, unsigned long linenumber, unsigned long threadid, short ct, hdlintarray *harray) { @@ -2061,7 +2060,7 @@ *hmerged = nil; /*default return value*/ sizefirsthandle = gethandlesize (h1); - storesizefirsthandle = conditionallongswap (sizefirsthandle); + storesizefirsthandle = disklong (sizefirsthandle); sizesecondhandle = gethandlesize (h2); @@ -2171,9 +2170,7 @@ moveleft (*h, &sizefirsthandle, sizeof (long)); -#ifdef PACKFLIPPED - longswap (sizefirsthandle); -#endif + disktomemlong (sizefirsthandle); ix = sizeof (long); Modified: Frontier/trunk/Common/source/menupack.c =================================================================== --- Frontier/trunk/Common/source/menupack.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/menupack.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -38,6 +38,7 @@ #include "opinternal.h" #include "menueditor.h" #include "menuinternal.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ Modified: Frontier/trunk/Common/source/odbengine.c =================================================================== --- Frontier/trunk/Common/source/odbengine.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/odbengine.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -47,6 +47,7 @@ #include "shellprivate.h" #endif #include "timedate.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ typedef struct tycancoonrecord { /*one of these for every cancoon file that's open*/ Modified: Frontier/trunk/Common/source/oplist.c =================================================================== --- Frontier/trunk/Common/source/oplist.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/oplist.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -34,9 +34,9 @@ #include "op.h" #include "opinternal.h" #include "oplist.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ - /* created 3/20/90 DW: @@ -54,21 +54,6 @@ #define oplistversionnumber 1 -#ifdef MACVERSION - #define unconditionallongswap(x) ((((x) >> 24) & 0x000000ff) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) - #define unconditionalshortswap(x) ((((x) >> 8) & 0x00ff) | (((x) << 8) & 0xff00)) - #define unconditionallyswaplong(x) do {(x) = unconditionallongswap(x);} while (0) - #define unconditionallyswapshort(x) do {(x) = unconditionalshortswap(x);} while (0) -#endif - -#ifdef WIN95VERSION - #define unconditionallongswap(x) dolongswap(x) - #define unconditionalshortswap(x) doshortswap(x) - #define unconditionallyswaplong(x) longswap(x) - #define unconditionallyswapshort(x) shortswap(x) -#endif - - typedef struct tylistrecord { struct tyoutlinerecord ** houtline; /*the list is stored in an outline*/ @@ -725,11 +710,11 @@ if (gethandlesize (hpackedoutline) != (long) info.ctoutlinebytes) { //old, unbyteswapped? - unconditionallyswapshort (info.ctitems); + shortswap (info.ctitems); - // unconditionallyswapshort (info.ctitems_hiword); + // shortswap (info.ctitems_hiword); - unconditionallyswaplong (info.ctoutlinebytes); + longswap (info.ctoutlinebytes); info.isrecord = info.flunused; Modified: Frontier/trunk/Common/source/oppack.c =================================================================== --- Frontier/trunk/Common/source/oppack.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/oppack.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -35,10 +35,9 @@ #include "ops.h" #include "op.h" #include "opinternal.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ - - typedef struct tylinetableitem { short flags; Modified: Frontier/trunk/Common/source/pict.c =================================================================== --- Frontier/trunk/Common/source/pict.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/pict.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -43,6 +43,7 @@ #include "process.h" #include "pict.h" #include "timedate.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ Modified: Frontier/trunk/Common/source/quickdraw.c =================================================================== --- Frontier/trunk/Common/source/quickdraw.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/quickdraw.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -44,6 +44,7 @@ #include "quickdraw.h" #include "frontierwindows.h" #include "shell.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #ifdef WIN95VERSION @@ -3029,11 +3030,9 @@ (*r).blue = (*rgbdisk).blue; - #ifdef PACKFLIPPED - shortswap(r->red); - shortswap(r->green); - shortswap(r->blue); - #endif + disktomemshort(r->red); + disktomemshort(r->green); + disktomemshort(r->blue); } /*diskrgbtorgb*/ @@ -3045,11 +3044,9 @@ (*rgbdisk).blue = (short) (*r).blue; - #ifdef PACKFLIPPED - shortswap(rgbdisk->red); - shortswap(rgbdisk->green); - shortswap(rgbdisk->blue); - #endif + memtodiskshort(rgbdisk->red); + memtodiskshort(rgbdisk->green); + memtodiskshort(rgbdisk->blue); } /*rgbtodiskrgb*/ Modified: Frontier/trunk/Common/source/shellsysverbs.c =================================================================== --- Frontier/trunk/Common/source/shellsysverbs.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/shellsysverbs.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -64,6 +64,7 @@ #include "tableverbs.h" //6.1b7 AR: we need gettablevalue #include "tableinternal.h" //6.1b7 AR: we need tablepacktable and tableunpacktable #include "serialnumber.h" //7.1b34 dmb: new isvalidserialnumber verb +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #define systemevents (osMask | activMask) Modified: Frontier/trunk/Common/source/strings.c =================================================================== --- Frontier/trunk/Common/source/strings.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/strings.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -37,6 +37,7 @@ #include "shell.rsrc.h" #include "timedate.h" #include "langinternal.h" /* 2006-02-26 creedon */ +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #define ctparseparams 4 Modified: Frontier/trunk/Common/source/tableformats.c =================================================================== --- Frontier/trunk/Common/source/tableformats.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/tableformats.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -46,6 +46,7 @@ #include "claycallbacks.h" #include "claybrowservalidate.h" #include "timedate.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #define mincolwidth 50 Modified: Frontier/trunk/Common/source/tablepack.c =================================================================== --- Frontier/trunk/Common/source/tablepack.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/tablepack.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -36,6 +36,7 @@ #include "tablestructure.h" #include "tableinternal.h" #include "tableverbs.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ @@ -357,9 +358,7 @@ if (!fl) return (false); -#ifdef PACKFLIPPED - longswap (adr); -#endif + memtodisklong (adr); return (enlargehandle (*hpacked, sizeof (adr), (ptrchar) &adr)); } /*tableverbpack*/ Modified: Frontier/trunk/Common/source/tablestructure.c =================================================================== --- Frontier/trunk/Common/source/tablestructure.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/tablestructure.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -38,6 +38,7 @@ #include "tableinternal.h" #include "tableverbs.h" #include "tablestructure.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ /* @@ -498,9 +499,7 @@ popfromhandle (htmp, sizeof (dbaddress), adr); -#ifdef PACKFLIPPED - longswap (*adr); // un-swap it; tableverbpack swapped it -#endif + disktomemlong (*adr); // un-swap it; tableverbpack swapped it disposehandle (htmp); /*we can get the address from the variable record, below*/ Modified: Frontier/trunk/Common/source/wpengine.c =================================================================== --- Frontier/trunk/Common/source/wpengine.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/wpengine.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -37,6 +37,7 @@ #include "standard.h" #include "bitmaps.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #include "cursor.h" #include "error.h" #include "font.h" Modified: Frontier/trunk/build_VC2K3/Frontier.vcproj =================================================================== (Binary files differ) Modified: Frontier/trunk/build_VC2K5/Frontier.vcproj =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |