summaryrefslogtreecommitdiff
path: root/graphics/tgd/files/patch-ab
blob: 70597d57755e18f5bbfebcd38f341a12eee54d4a (plain) (blame)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
--- tgd.c.orig	Mon Oct  7 15:31:25 1996
+++ tgd.c	Sat Apr  3 11:41:37 1999
@@ -31,7 +31,7 @@
 #include <strings.h>
 #endif
 #include <ctype.h>
-#include <malloc.h>
+#include <stdlib.h>
 #include "gd.h"
 #include "gdfontl.h"
 #include "gdfonts.h"
@@ -40,6 +40,7 @@
 #include "gdfontt.h"
 #include "tgdsamfont.h"
 #include "tgd.h"
+#include "tgdcommand.h"
 
 static char SCCS[] = "@(#)tgd.c	1.6 10/13/95 tgd";
 static char    *Current_file; /* Name of current input file */
@@ -54,9 +55,11 @@
 COLOUR *colourbyname();
 TIM *timbyname();
 static void tgdgo();
-static init();
+static void init();
+static void loadfonts();
+static void unloadfonts();
 
-main( argc, argv )
+int main( argc, argv )
 int argc;
 char *argv[];
 {
@@ -79,7 +82,7 @@
 			fclose( fp );
 		}
 	}
-	exit( 0 );
+	return 0;
 }
 
 
@@ -87,7 +90,7 @@
  *	Unrecoverable error, terminate program with
  *	a message.
  */
-die( s )
+void die( char *s )
 {
 	char buf[BUFSIZ];
 	sprintf( buf, "tgd error is [%s]. Near line %d in file %s.\n",
@@ -101,7 +104,7 @@
  *	Setting Ldebug less than 0 will completely
  *	shut program up.
  */
-tgdputs( s )
+void tgdputs( s )
 char *s;
 {
 	if ( Ldebug >= 0 )
@@ -111,7 +114,7 @@
 /* --
  *	All error reports should go through here.
  */
-tgdputerr( s )
+void tgdputerr( char *s )
 {
 		fprintf( Fp_err, "%s\n", s );
 }
@@ -120,7 +123,7 @@
  *	(Re)Initialize datastructures for each input file.
  */
 static
-init()
+void init()
 {
 	int i, j;
 
@@ -236,13 +239,14 @@
 		}
 	}
 	die( "too many images" );
+	return 0; /* turn off compiler warning */
 }
 
 /* --
  *	Called when we read in an image to synchronize
  *	our conception of the image with the GD library.
  */
-timset( tim )
+void timset( tim )
 TIM *tim;
 {
 	int colors;
@@ -306,7 +310,7 @@
  *	off all standard output, including that from
  *	printing functions.
  */
-tgddebug( argc, argv )
+void tgddebug( argc, argv )
 int argc;
 char *argv[];
 {
@@ -316,7 +320,7 @@
 /* --
  *  center the string on the given x y coords. (see imagestring)
  */
-tgdstringcenter( argc, argv )
+void tgdstringcenter( argc, argv )
 int argc;
 char *argv[];
 {
@@ -347,7 +351,7 @@
  *	Note that "macros" can be built
  *	up out of text commands.
  */
-tgdstockimage( argc, argv )
+void tgdstockimage( argc, argv )
 int argc;
 char *argv[];
 {
@@ -418,7 +422,7 @@
 /* --
  *	Release argv strings 
  */
-tgdargdestroy( argc, argv )
+void tgdargdestroy( argc, argv )
 int argc;
 char *argv[];
 {
@@ -434,7 +438,7 @@
 /* --
  *	Report on the current comand.
  */
-tgdshowvector( argc, argv )
+void tgdshowvector( argc, argv )
 int argc;
 char *argv[];
 {
@@ -510,7 +514,7 @@
  *	Font names are case-insenstive to user, so make names
  *	all lower case here (cf. fontbyname() ).
  */
-loadfonts()
+static void loadfonts()
 {
 	/* Font kludge XXX */
 	strcpy( Font[0].name, "gdfontsmall" );
@@ -562,7 +566,7 @@
 /* --
  *	Eventually will dump fonts out of memory
  */
-unloadfonts()
+static void unloadfonts()
 {
 	/* XXX */
 }