updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / tmview / 203_64bit_support.diff
blob8860b0e2e7e96f19a01e398dfa26e48bbb2fc299
1 --- tmview-01.03.orig/svga/defssvga.h
2 +++ tmview-01.03/svga/defssvga.h
3 @@ -176,8 +178,6 @@
4 */
6 /* be careful with storge types !!! */
7 -#define BMLONG32 /* for architectures where "long int" has 32bits, e.g. i386 */
8 -/* #define BMLONG64 *//* for architectures where "long int" has 64bits, e.g. alpha */
9 /* #define GREYINBMU *//* waste memory. may be a bit faster */
11 /* if DOSFILES is defined, a dosfilesystem is expected, */
12 --- tmview-01.03.orig/src/tmview.c
13 +++ tmview-01.03/src/tmview.c
14 @@ -2335,14 +2362,6 @@
15 pfprot("This is some kind of a DVIewer, %s\n",MYVERSION);
16 pfprot("(C)opyright 1995 Thomas Moor\n\n");
18 - /* check some arcitecture dependant stuff ... better be configured */
19 - if(BYTES_PER_BMUNIT !=sizeof(BMUNIT)){
20 - pfprot("This message addresses the administrator rather than the user:\n");
21 - pfprot("the compiletime option BMLONG64/BMLONG32 seems not to meet your\n");
22 - pfprot("machines architecture. Please check the non-i386 section in the\n");
23 - pfprot("README and re-compile. Sorry.\n\n");
24 - exit(1);
25 - }
26 if(sizeof(void*)<sizeof(long)){ /* this is for the lru-buffer in subs.c*/
27 pfprot("This message addresses the administrator rather than the user:\n");
28 pfprot("sizeof \"void*\" is assumed to be at least the size of \"long int\".");
29 --- tmview-01.03.orig/src/bookmks.c
30 +++ tmview-01.03/src/bookmks.c
31 @@ -194,24 +194,15 @@
34 void rolldownfilemk(void) {
35 - int i, maxloop;
36 - char *bustr=NULL;
37 + int i;
38 filemark *bbu;
39 #ifdef DEBUGBMK
40 pfprot("(rolldownfile... )");
41 #endif
42 if(nfilemks<=0) return;
43 - maxloop=nfilemks; /* put a -1 here if deleting stuff ? */
44 - while(maxloop>0) {
45 - maxloop--;
46 - bbu=filemks[0];
47 - for(i=0;i<nfilemks-1;i++) filemks[i]=filemks[i+1];
48 - filemks[i]=bbu;
49 - if(dvistandard(&bustr,filemks[0]->lastpos.dvifilename))
50 - break; /* loop nominal ends here */
51 - /* freefilemknumber(0); ... no, we dont delete these things! */
52 - };
53 - freemem(&bustr);
54 + bbu=filemks[0];
55 + for(i=0;i<nfilemks-1;i++) filemks[i]=filemks[i+1];
56 + filemks[i]=bbu;
57 curfmk=filemks[0];
58 curbmks=&(curfmk->bookmks);
60 --- tmview-01.03.orig/src/readpk.c
61 +++ tmview-01.03/src/readpk.c
62 @@ -16,7 +16,7 @@
65 void pkopen(char* fname) {
66 - if((pkfile = fopen(fname, "rb"))==0) {
67 + if((pkfile = fopen(fname, "rb"))==NULL) {
68 pfprot("\n fatal error: pk-file disapeard. \n");
69 exit(1);
71 --- tmview-01.03.orig/src/defsgen.h
72 +++ tmview-01.03/src/defsgen.h
73 @@ -189,18 +189,18 @@
77 -#ifdef BMLONG64
78 +#if __WORDSIZE == 64
79 #define BMUNIT unsigned long
80 #define BITS_PER_BMUNIT 64
81 #define BITS_LOG2 6
82 #define BYTES_PER_BMUNIT 8
83 -#endif
84 -#ifdef BMLONG32
85 +#else
86 #define BMUNIT unsigned long
87 #define BITS_PER_BMUNIT 32
88 #define BITS_LOG2 5
89 #define BYTES_PER_BMUNIT 4
90 #endif
92 #ifdef BMCHAR
93 #define BMUNIT unsigned char
94 #define BITS_PER_BMUNIT 8
95 --- tmview-01.03.orig/README
96 +++ tmview-01.03/README
97 @@ -14,7 +14,6 @@
98 - EXTRA NOTES kpathsea
99 - EXTRA NOTES mouse
100 - EXTRA NOTES X-Window System
101 - - EXTRA NOTES non-i386 architectures e.g. Alpha.
102 5. Get the newest version, send me your comments
105 @@ -361,17 +360,6 @@
106 colors, asking for fonts and so, set DEBUGX in writelx.c . This helps
107 if no tmview window shows up at all.
109 -EXTRA NOTES non-i386 architectures: Of course I realize that there are several
110 -non-i386 architectures. The clean way of dealing with machine dependand stuff
111 -is to make use of <sys/types.h> and such. Unfortunately I didn't. In a future
112 -version I shall carefully review the code from this perspective. In the
113 -meanwhile there is on crucial compiletime option to set up how many bits
114 -actually make a "long int". On i386 these are 32. Thus, enable "#define BMLONG32"
115 -in the platformm dependant "defs*.h", e.g. "./tmview/lX/defslx.h". On Alpha
116 -systems a "long int" is made up from 64 bits. Here, "#define BMLONG64" needs
117 -to be enabled. tmview will issue a runtime warning message if it figures out
118 -that ends don't meet here.
121 *****************************************************************************
122 *****************************************************************************
123 --- tmview-01.03.orig/fb/writefb.c
124 +++ tmview-01.03/fb/writefb.c
125 @@ -7,6 +7,7 @@
127 #include <termios.h>
128 #include <errno.h>
129 +#include <stdint.h>
131 #include <sys/types.h>
132 #include <sys/ioctl.h>
133 @@ -518,7 +589,7 @@
136 uchar getonechar(void){
137 - int res;
138 + char res;
139 if(1==read(STDIN_FILENO, &res, 1))
140 return(res);
141 return(0);
142 --- tmview-01.03.orig/fb/defsfb.h
143 +++ tmview-01.03/fb/defsfb.h
144 @@ -144,8 +147,6 @@
147 /* be careful with storge types !!! */
148 -#define BMLONG32 /* for architectures where "long int" has 32bits, e.g. i386 */
149 -/* #define BMLONG64 *//* for architectures where "long int" has 64bits, e.g. alpha */
150 /* #define GREYINBMU *//* waste memory. may be a bit faster */
152 /* if DOSFILES is defined, a dosfilesystem is expected, */
153 --- tmview-01.03.orig/lX/defslx.h
154 +++ tmview-01.03/lX/defslx.h
155 @@ -142,8 +143,6 @@
158 /* be careful with storge types !!! */
159 -#define BMLONG32 /* when "long int" has 32bits, e.g. i386 architecture */
160 -/*#define BMLONG64 *//* when "long int" has 64bits, e.g. alpha architecture*/
161 /*#define GREYINBMU*//* waste memory. may be a bit faster */
162 #define COLORS_PER_GREY 16 /* 2^BITS_PER_GREY, no MECK-like things in lX */