summaryrefslogtreecommitdiff
path: root/textproc/helpdeco/patches/patch-aa
blob: 3c0cb21f906f3204aca4396d10199e3c98d6c583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
$NetBSD: patch-aa,v 1.2 2004/09/22 17:00:33 ben Exp $

--- splitmrb.c.orig	Fri Sep 13 00:11:54 1996
+++ splitmrb.c
@@ -12,6 +12,7 @@ n is a digit from 0 to 9). Discarded hot
 This program is freeware. Use at your own risk. No part of it may be used
 commercially. No fees may be charged on distributing.
 */
+#include <sys/types.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -216,14 +217,10 @@ void PrintHotspotInfo(FILE *f)
     int i,l,n;
     typedef struct
     {
-	unsigned char c1,c2,c3;
-	unsigned int x,y,w,h;
-	unsigned long hash;
-    }
-    HOTSPOT;
-#if sizeof(HOTSPOT)!=15
-#error Compile byte aligned !
-#endif
+	u_int8_t c1,c2,c3;
+	u_int16_t x,y,w,h;
+	u_int32_t hash;
+    } HOTSPOT __attribute__((packed));
     HOTSPOT *hotspot;
     char name[80];
     char buffer[128];
@@ -308,7 +305,7 @@ int main(int argc,char *argv[])
 	while(l>0&&filename[l-1]!='\\'&&filename[l-1]!='/'&&filename[l-1]!=':') l--;
 	m=l;
 	while(filename[l]!='\0'&&filename[l]!='.') l++;
-	if(filename[l]=='\0') strcpy(filename+l,".MRB");
+	if(filename[l]=='\0') strcpy(filename+l,".mrb");
 	f=fopen(filename,"rb");
 	if(!f)
 	{
@@ -331,7 +328,7 @@ int main(int argc,char *argv[])
 		    fseek(f,offset,SEEK_SET);
 		    byType=getc(f); // type of picture: 5=DDB, 6=DIB, 8=METAFILE
 		    byPacked=getc(f); // packing method: 0=unpacked, 1=RunLen, 2=LZ77
-		    if(byType==6||byType==5&&byPacked<2)
+		    if(byType==6||(byType==5&&byPacked<2))
 		    {
 			memset(&bmfh,0,sizeof(bmfh));
 			memset(&bmih,0,sizeof(bmih));
@@ -378,17 +375,17 @@ int main(int argc,char *argv[])
 			    sprintf(filename+l,".%03d",j);
 			    if(w==96&&h==48&&!res[0])
 			    {
-				strcpy(filename+l,".CGA");
+				strcpy(filename+l,".cga");
 				res[0]=TRUE;
 			    }
 			    else if(w==96&&h==72&&!res[1])
 			    {
-				strcpy(filename+l,".EGA");
+				strcpy(filename+l,".ega");
 				res[1]=TRUE;
 			    }
 			    else if(w==96&&h==96&&!res[2])
 			    {
-				strcpy(filename+l,".VGA");
+				strcpy(filename+l,".vga");
 				res[2]=TRUE;
 			    }
 			    else if(w==120&&h==120&&!res[3])
@@ -398,12 +395,12 @@ int main(int argc,char *argv[])
 			    }
 			    else if(w==72&&h==72&&!res[4])
 			    {
-				strcpy(filename+l,".MAC");
+				strcpy(filename+l,".mac");
 				res[4]=TRUE;
 			    }
 			    else if(!res[6])
 			    {
-				strcpy(filename+l,".BMP");
+				strcpy(filename+l,".bmp");
 				res[6]=TRUE;
 			    }
 			    fTarget=fopen(filename+m,"wb");
@@ -472,7 +469,6 @@ int main(int argc,char *argv[])
 		    }
 		    else if(byType==8) // Windows MetaFile
 		    {
-			APMFILEHEADER afh;
 			unsigned short *wp;
 
 			memset(&afh,0,sizeof(afh));
@@ -512,7 +508,7 @@ int main(int argc,char *argv[])
 			    for(k=0;k<10;k++) afh.wChecksum^=*wp++;
 			    if(!res[5])
 			    {
-				strcpy(filename+l,".WMF");
+				strcpy(filename+l,".wmf");
 				res[5]=TRUE;
 			    }
 			    else