• R/O
  • SSH

wp2latex: Commit

WP2LaTeX sources.


Commit MetaInfo

Revision3e8cadb4c1c50f342386e49c6b50ac1ac46ba54c (tree)
Time2021-10-10 20:12:11
AuthorFojtik
CommiterFojtik

Log Message

Check for compillation endianity.

Change Summary

Incremental Difference

diff -r 7c7eebffbd11 -r 3e8cadb4c1c5 trunk/sources.cc/atoms/include/typedfs.h
--- a/trunk/sources.cc/atoms/include/typedfs.h Sun Oct 03 01:17:49 2021 +0200
+++ b/trunk/sources.cc/atoms/include/typedfs.h Sun Oct 10 13:12:11 2021 +0200
@@ -59,6 +59,12 @@
5959 #ifndef LO_ENDIAN
6060 #define LO_ENDIAN
6161 #endif
62+ #else
63+ #if (__BYTE_ORDER__==__ORDER_BIG_ENDIAN__)
64+ #ifndef HI_ENDIAN
65+ #define HI_ENDIAN
66+ #endif
67+ #endif
6268 #endif
6369
6470 #if !defined(_ASM_GENERIC_INT_LL64_H) && !defined(_UAPI_ASM_GENERIC_INT_LL64_H)
@@ -280,6 +286,17 @@
280286 #define LD_DOUBLE_HI(ptr) LD_DOUBLE_SWAP(ptr)
281287 #define ST_DOUBLE_HI(ptr,val) ST_DOUBLE_SWAP(ptr,val)
282288 #endif
289+
290+ #ifdef HI_ENDIAN
291+ #define LD_UINT16_HI(ptr) LD_UINT16_CPU(ptr)
292+ #define LD_UINT32_HI(ptr) LD_UINT32_CPU(ptr)
293+ #define ST_UINT16_HI(ptr,val) ST_UINT16_CPU(ptr,val)
294+ #define ST_UINT32_HI(ptr,val) ST_UINT32_CPU(ptr,val)
295+ #if defined(__u64_defined)
296+ #define LD_UINT64_HI(ptr) LD_UINT64_CPU(ptr)
297+ #define ST_UINT64_HI(ptr,val) ST_UINT64_CPU(ptr,val)
298+ #endif
299+ #endif
283300 #endif
284301
285302
diff -r 7c7eebffbd11 -r 3e8cadb4c1c5 trunk/sources.cc/images.cc
--- a/trunk/sources.cc/images.cc Sun Oct 03 01:17:49 2021 +0200
+++ b/trunk/sources.cc/images.cc Sun Oct 10 13:12:11 2021 +0200
@@ -1579,7 +1579,7 @@
15791579 fprintf(cq->log,"\n%*s{GRtyp#%X;len:%lXh;%s}", cq->recursion*2, "",
15801580 (int)Rec2.Type, (long)Rec2.RecordLength, cq->ObjType);
15811581 //fprintf(cq->log,"MaxY= %2.2f",MaxY);
1582- fprintf(cq->log," Pos= %lX", (long)cq->ActualPos);
1582+ fprintf(cq->log," Pos=%lXh", (long)cq->ActualPos);
15831583 }
15841584 if(*cq->ObjType=='!' || *cq->ObjType=='?')
15851585 {UnknownObjects++;*cq->ObjType=0;}
@@ -2031,7 +2031,7 @@
20312031 fprintf(cq->log,"\n%*s{GRtyp#%Xh;len:%lXh;%s}",cq->recursion * 2, "",
20322032 (int)Rec2.Type, (long)Rec2.RecordLength, cq->ObjType);
20332033 //fprintf(cq->log,"MaxY= %2.2f",MaxY);
2034- fprintf(cq->log," Pos= %lX", (long)cq->ActualPos);
2034+ fprintf(cq->log," Pos=%lXh", (long)cq->ActualPos);
20352035 }
20362036 cq->ActualPos = (NewObject+1) & ~1;
20372037 fseek(cq->wpd,cq->ActualPos,SEEK_SET);
diff -r 7c7eebffbd11 -r 3e8cadb4c1c5 trunk/sources.cc/word/wvparser.c
--- a/trunk/sources.cc/word/wvparser.c Sun Oct 03 01:17:49 2021 +0200
+++ b/trunk/sources.cc/word/wvparser.c Sun Oct 10 13:12:11 2021 +0200
@@ -16,6 +16,7 @@
1616 #include "bintree.h"
1717 #include "wrd_type.h"
1818 #endif
19+#include "struct.h"
1920
2021 #define wvTrace(xxx) {}
2122 #define wvError(xxx) {}
@@ -25,15 +26,6 @@
2526 #ifdef __cplusplus
2627 extern "C" {
2728 #endif
28-int RdWORD_LoEnd( WORD *num, FILE *f );
29-int RdDWORD_LoEnd( DWORD *num, FILE *f );
30-int RdWORD_HiEnd( WORD *num, FILE *f );
31-int RdDWORD_HiEnd( DWORD *num, FILE *f );
32-
33-int WrWORD_LoEnd( WORD num, FILE *f );
34-int WrDWORD_LoEnd( DWORD num, FILE *f );
35-int WrWORD_HiEnd( WORD num, FILE *f );
36-int WrDWORD_HiEnd( DWORD num, FILE *f );
3729
3830 WORD fil_sreadU16(const BYTE *in);
3931 DWORD fil_sreadU32(const BYTE *in);
diff -r 7c7eebffbd11 -r 3e8cadb4c1c5 trunk/sources.cc/wp2latex.cc
--- a/trunk/sources.cc/wp2latex.cc Sun Oct 03 01:17:49 2021 +0200
+++ b/trunk/sources.cc/wp2latex.cc Sun Oct 10 13:12:11 2021 +0200
@@ -630,6 +630,15 @@
630630 AskUser();
631631 }
632632 #endif
633+#ifdef LO_ENDIAN
634+ int i=1;
635+ if(*((unsigned char *)&i) != 1)
636+ {
637+ Heading();
638+ fprintf(err,_("\nFatal: Compillation has been optimised for LO_ENDIAN that does not belong to this system!"));
639+ AskUser();
640+ }
641+#endif
633642 }
634643
635644
diff -r 7c7eebffbd11 -r 3e8cadb4c1c5 trunk/sources.cc/wp2latex.h
--- a/trunk/sources.cc/wp2latex.h Sun Oct 03 01:17:49 2021 +0200
+++ b/trunk/sources.cc/wp2latex.h Sun Oct 10 13:12:11 2021 +0200
@@ -17,8 +17,8 @@
1717
1818 #define LineLength 80 /* Split lines after more than LineLength charcters */
1919
20-#define VersionWP2L "3.100"
21-#define VersionDate "2 Oct 2021" /* day (space) month (space) full year */
20+#define VersionWP2L "3.pre101"
21+#define VersionDate "10 Oct 2021" /* day (space) month (space) full year */
2222
2323 #ifndef false
2424 #define false 0
Show on old repository browser