summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipng/dvipng-1.12-patches
blob: edb933c19e6e4de8f8ee248961ebd3902b61e3a1 (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
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
diff -ur dvipng-1.12/color.c dvipng/color.c
--- dvipng-1.12/color.c	2008-06-03 19:29:31.000000000 +0200
+++ dvipng/color.c	2009-03-25 14:03:10.000000000 +0100
@@ -23,7 +23,7 @@
 ************************************************************************/
 
 #include "dvipng.h"
-#if HAVE_ALLOCA_H
+#ifdef HAVE_ALLOCA_H
 # include <alloca.h>
 #endif
 
diff -ur dvipng-1.12/dvipng.h dvipng/dvipng.h
--- dvipng-1.12/dvipng.h	2008-06-03 19:30:18.000000000 +0200
+++ dvipng/dvipng.h	2009-03-25 14:04:41.000000000 +0100
@@ -478,11 +478,11 @@
 
 /************************timing stuff*********************/
 #ifdef TIMING
-#if TIME_WITH_SYS_TIME
+#ifdef TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
 #else
-# if HAVE_SYS_TIME_H
+# ifdef HAVE_SYS_TIME_H
 #  include <sys/time.h>
 # else
 #  include <time.h>
diff -ur dvipng-1.12/fontmap.c dvipng/fontmap.c
--- dvipng-1.12/fontmap.c	2008-05-05 20:58:00.000000000 +0200
+++ dvipng/fontmap.c	2009-04-22 14:14:06.000000000 +0200
@@ -25,7 +25,7 @@
 #include "dvipng.h"
 
 static struct filemmap psfont_mmap;
-#if HAVE_FT2
+#ifdef HAVE_FT2
 static struct filemmap ttfont_mmap;
 #endif
 static struct psfontmap *psfontmap=NULL;
@@ -106,10 +106,10 @@
     newentry->psfile = copyword(copyfrom->psfile);
     newentry->encname = copyword(copyfrom->encname);
     newentry->encoding = copyfrom->encoding;
-#if HAVE_LIBT1
+#ifdef HAVE_LIBT1
     newentry->t1_transformp = copyfrom->t1_transformp;
 #endif
-#if HAVE_FT2
+#ifdef HAVE_FT2
     newentry->ft_transformp = copyfrom->ft_transformp;
     newentry->subfont = copyfrom->subfont;
 #endif
@@ -120,10 +120,10 @@
     newentry->psfile = NULL;
     newentry->encname = NULL;
     newentry->encoding = NULL;
-#if HAVE_LIBT1
+#ifdef HAVE_LIBT1
     newentry->t1_transformp = NULL;
 #endif
-#if HAVE_FT2
+#ifdef HAVE_FT2
     newentry->ft_transformp = NULL;
     newentry->subfont = NULL;
 #endif
@@ -249,14 +249,14 @@
 	}
 	free(word);
       }
-#if HAVE_FT2
+#ifdef HAVE_FT2
       entry->ft_transformp=&(entry->ft_transform);
       entry->ft_transform.xx=(FT_Fixed)(cxx*0x10000);
       entry->ft_transform.xy=(FT_Fixed)(cxy*0x10000);
       entry->ft_transform.yx=0;
       entry->ft_transform.yy=0x10000;
 #endif
-#if HAVE_LIBT1
+#ifdef HAVE_LIBT1
       entry->t1_transformp=&(entry->t1_transform);
       entry->t1_transform.cxx=cxx;
       entry->t1_transform.cxy=cxy;
@@ -316,6 +316,7 @@
     }
 #endif
   }
+#ifdef HAVE_FT2
   if(entry==NULL) {
     struct psfontmap* entry_subfont=NULL;
     entry=psfontmap;
@@ -331,6 +332,7 @@
       }
     }
   }
+#endif
   if (entry!=NULL && entry->psfile==NULL) 
     ReadPSFontMap(entry);
   if (entry!=NULL && entry->encname!=NULL && entry->encoding==NULL) 
diff -ur dvipng-1.12/ft.c dvipng/ft.c
--- dvipng-1.12/ft.c	2008-02-08 14:45:24.000000000 +0100
+++ dvipng/ft.c	2009-03-25 14:05:41.000000000 +0100
@@ -23,7 +23,7 @@
 ************************************************************************/
 
 #include "dvipng.h"
-#if HAVE_ALLOCA_H
+#ifdef HAVE_ALLOCA_H
 # include <alloca.h>
 #endif
 
diff -ur dvipng-1.12/misc.c dvipng/misc.c
--- dvipng-1.12/misc.c	2008-06-02 21:29:33.000000000 +0200
+++ dvipng/misc.c	2009-03-25 14:05:54.000000000 +0100
@@ -195,7 +195,7 @@
 	}
 	break ;
       case 't':       /* specify paper format, only for cropmarks */
-#if HAVE_GDIMAGECREATETRUECOLOR
+#ifdef HAVE_GDIMAGECREATETRUECOLOR
 	/* Truecolor */
 	if (strncmp(p,"ruecolor",8)==0) { 
 	  if (p[8] != '0') {
diff -ur dvipng-1.12/pk.c dvipng/pk.c
--- dvipng-1.12/pk.c	2008-05-05 20:58:00.000000000 +0200
+++ dvipng/pk.c	2009-03-25 14:06:03.000000000 +0100
@@ -23,7 +23,7 @@
 ************************************************************************/
 
 #include "dvipng.h"
-#if HAVE_ALLOCA_H
+#ifdef HAVE_ALLOCA_H
 # include <alloca.h>
 #endif
 
diff -ur dvipng-1.12/set.c dvipng/set.c
--- dvipng-1.12/set.c	2008-02-08 14:45:23.000000000 +0100
+++ dvipng/set.c	2009-03-25 14:06:11.000000000 +0100
@@ -23,7 +23,7 @@
 ************************************************************************/
 
 #include "dvipng.h"
-#if HAVE_ALLOCA_H
+#ifdef HAVE_ALLOCA_H
 # include <alloca.h>
 #endif
 #include <math.h>
diff -ur dvipng-1.12/special.c dvipng/special.c
--- dvipng-1.12/special.c	2009-02-23 14:48:50.000000000 +0100
+++ dvipng/special.c	2009-03-24 21:44:50.000000000 +0100
@@ -632,9 +632,9 @@
 
   if (dvi->flags & DVI_PREVIEW_BOP_HOOK && ~page_flags & PAGE_PREVIEW_BOP 
       && strncmp(special,"ps::",4)==0) {
+    dviunits adj_llx,adj_lly,adj_urx,adj_ury,ht,dp,wd;
     page_flags |= PAGE_PREVIEW_BOP;
     /* Hokay, decode bounding box */
-    dviunits adj_llx,adj_lly,adj_urx,adj_ury,ht,dp,wd;
     adj_llx = strtol(special+4,&special,10);
     adj_lly = strtol(special,&special,10);
     adj_urx = strtol(special,&special,10);
diff -ur dvipng-1.12/t1.c dvipng/t1.c
--- dvipng-1.12/t1.c	2008-02-08 14:45:23.000000000 +0100
+++ dvipng/t1.c	2009-03-25 14:06:17.000000000 +0100
@@ -23,7 +23,7 @@
 ************************************************************************/
 
 #include "dvipng.h"
-#if HAVE_ALLOCA_H
+#ifdef HAVE_ALLOCA_H
 # include <alloca.h>
 #endif
 
diff -ur dvipng-1.12/tfm.c dvipng/tfm.c
--- dvipng-1.12/tfm.c	2008-05-05 20:58:00.000000000 +0200
+++ dvipng/tfm.c	2009-03-25 14:06:21.000000000 +0100
@@ -23,7 +23,7 @@
 ************************************************************************/
 
 #include "dvipng.h"
-#if HAVE_ALLOCA_H
+#ifdef HAVE_ALLOCA_H
 # include <alloca.h>
 #endif
 
Index: color.c
===================================================================
--- color.c	(revision 13607)
+++ color.c	(working copy)
@@ -54,7 +54,7 @@
    cstack[1].blue=0; 
 }
 
-struct colorname * NewColor(char* prefix, int nprefix,
+static struct colorname * NewColor(char* prefix, int nprefix,
               char* name, int nname,
 	      char* model, int nmodel,
 	      char* values, int nvalues)
@@ -92,7 +92,7 @@
 #define FINDPSNAMEEND(s,n) n=0; while(s<max && *s!='{') { s++; n++; }
 #define BLANKCOMMAS(s) 
 
-struct colorname* LoadColornameFile(char* filename)
+static struct colorname* LoadColornameFile(char* filename)
 {
   struct colorname *list=NULL,*tmp=NULL; 
   char *filepath,*pos,*max;
@@ -165,7 +165,7 @@
   return(list);
 }
 
-void ClearXColorPrologue(void)
+static void ClearXColorPrologue(void)
 {
   struct colorname *next;
   while (xcp) {
@@ -199,7 +199,7 @@
   strcpy(xcpname,name);
 }
 
-struct colorname* LoadXColorPrologue(void)
+static struct colorname* LoadXColorPrologue(void)
 {
   struct colorname *list=NULL,*tmp=NULL; 
   char *filepath,*pos,*max;
Index: draw.c
===================================================================
--- draw.c	(revision 13607)
+++ draw.c	(working copy)
@@ -284,7 +284,7 @@
 }
 
 
-void DrawPage(dviunits hoffset, dviunits voffset) 
+static void DrawPage(dviunits hoffset, dviunits voffset) 
      /* To be used after having read BOP and will exit cleanly when
       * encountering EOP.
       */
Index: dvi.c
===================================================================
--- dvi.c	(revision 13607)
+++ dvi.c	(working copy)
@@ -56,7 +56,7 @@
   return (unsigned char)got;
 }
 
-void DVIInit(struct dvi_data* dvi)
+static void DVIInit(struct dvi_data* dvi)
 {
   int     k;
   unsigned char* pre;
@@ -277,7 +277,7 @@
   return(length);
 }
 
-void SkipPage(struct dvi_data* dvi)
+static void SkipPage(struct dvi_data* dvi)
 { 
   /* Skip present page */
   unsigned char* command;           
@@ -307,7 +307,7 @@
   DEBUG_PRINT(DEBUG_DVI,("SKIP CMD:\t%s", dvi_commands[*command]));
 }
 
-struct page_list* InitPage(struct dvi_data* dvi)
+static struct page_list* InitPage(struct dvi_data* dvi)
 {
   /* Find page start, return pointer to page_list entry if found */
   struct page_list* tpagelistp=NULL;
@@ -428,7 +428,7 @@
 }
 
 
-void DelPageList(struct dvi_data* dvi)
+static void DelPageList(struct dvi_data* dvi)
 {
   struct page_list* temp;
   
Index: enc.c
===================================================================
--- enc.c	(revision 13607)
+++ enc.c	(working copy)
@@ -26,7 +26,7 @@
 
 struct encoding* encodingp=NULL;
 
-struct encoding* InitEncoding(char* encoding) 
+static struct encoding* InitEncoding(char* encoding) 
 {
   char *pos,*max,*buf,*enc_file;
   int i;
Index: font.c
===================================================================
--- font.c	(revision 13607)
+++ font.c	(working copy)
@@ -38,7 +38,7 @@
 }
 
 
-double ActualFactor(uint32_t unmodsize)
+static double ActualFactor(uint32_t unmodsize)
 /* compute the actual size factor given the approximation */
 /* actually factor * 1000 */
 {
@@ -189,7 +189,7 @@
 }
 
 #ifdef HAVE_FT2_OR_LIBT1
-char* kpse_find_t1_or_tt(char* filename) 
+static char* kpse_find_t1_or_tt(char* filename) 
 {
     char* filepath = kpse_find_file(filename, kpse_type1_format, false);
 #ifdef HAVE_FT2
@@ -200,7 +200,7 @@
 }
 #endif
 
-void FontFind(struct font_entry * tfontptr)
+static void FontFind(struct font_entry * tfontptr)
 {
 #ifdef HAVE_LIBKPATHSEA
   kpse_glyph_file_type font_ret;
@@ -300,7 +300,7 @@
 }
 
 
-void DoneFont(struct font_entry *tfontp)
+static void DoneFont(struct font_entry *tfontp)
 {
   switch (tfontp->type) {
   case FONT_TYPE_PK:
Index: fontmap.c
===================================================================
--- fontmap.c	(revision 13607)
+++ fontmap.c	(working copy)
@@ -30,7 +30,7 @@
 #endif
 static struct psfontmap *psfontmap=NULL;
 
-char* newword(char** buffer, char* end) 
+static char* newword(char** buffer, char* end) 
 {
   char *word,*pos=*buffer;
 
@@ -55,7 +55,7 @@
   return(word);
 }
 
-char* find_format(char* name)
+static char* find_format(char* name)
 {
   /* Cater for both new (first case) and old (second case) kpathsea */
   char* format =
@@ -134,7 +134,7 @@
   return(newentry);
 }
 
-struct psfontmap *SearchPSFontMap(char* fontname,
+static struct psfontmap *SearchPSFontMap(char* fontname,
 				  struct filemmap* search_mmap)
 {
   static char *pos=NULL,*end=NULL;
@@ -196,7 +196,7 @@
 #endif
 }
 
-void ReadPSFontMap(struct psfontmap *entry)
+static void ReadPSFontMap(struct psfontmap *entry)
 {
   char *pos,*end,*psname;
   int nameno = 0;
Index: ft.c
===================================================================
--- ft.c	(revision 13607)
+++ ft.c	(working copy)
@@ -145,7 +145,7 @@
 }
 
 
-void UnLoadFT(struct char_entry *ptr)
+static void UnLoadFT(struct char_entry *ptr)
 {
   if (ptr->data!=NULL)
     free(ptr->data);
Index: papersiz.c
===================================================================
--- papersiz.c	(revision 13607)
+++ papersiz.c	(working copy)
@@ -36,7 +36,7 @@
  *   Advance the passed pointer as well.
  */
 
-int32_t myatodim(char ** p)
+static int32_t myatodim(char ** p)
 { 
   double tmp; /* double accuracy is enough, I think */
   int i=0;
Index: pk.c
===================================================================
--- pk.c	(revision 13607)
+++ pk.c	(working copy)
@@ -35,7 +35,7 @@
 int             repeatcount;
 int             poshalf;
 
-unsigned char getnyb(unsigned char** pos)
+static unsigned char getnyb(unsigned char** pos)
 {
   if (poshalf == 0) {
     poshalf=1;
@@ -46,7 +46,7 @@
   }
 }
 
-uint32_t pk_packed_num(unsigned char** pos)
+static uint32_t pk_packed_num(unsigned char** pos)
 {
   register int    i;
   uint32_t        j;
@@ -77,7 +77,7 @@
   }
 }
 
-unsigned char* skip_specials(unsigned char* pos)
+static unsigned char* skip_specials(unsigned char* pos)
 {
   uint32_t    i;
 
@@ -384,7 +384,7 @@
   }
 }
 
-void UnLoadPK(struct char_entry *ptr)
+static void UnLoadPK(struct char_entry *ptr)
 {
   if (ptr->data!=NULL)
     free(ptr->data);
Index: ppagelist.c
===================================================================
--- ppagelist.c	(revision 13607)
+++ ppagelist.c	(working copy)
@@ -107,7 +107,7 @@
   return(false);
 }
 
-void ListPage(int32_t pslow, int32_t pshigh)
+static void ListPage(int32_t pslow, int32_t pshigh)
 {
   register struct pp_list   *pl;
 
Index: set.c
===================================================================
--- set.c	(revision 13607)
+++ set.c	(working copy)
@@ -84,7 +84,7 @@
 }
 
 
-void ChangeColor(gdImagePtr imagep,int x1,int y1,
+static void ChangeColor(gdImagePtr imagep,int x1,int y1,
 		 int x2,int y2,int color1,int color2)
 /* In the given rectangle, change color1 to color2 */
 {
Index: sfd.c
===================================================================
--- sfd.c	(revision 13607)
+++ sfd.c	(working copy)
@@ -25,7 +25,7 @@
 #include "dvipng.h"
 struct subfont* subfontp=NULL;
 
-struct subfont* ReadSubfont(char* sfdname, char *infix) 
+static struct subfont* ReadSubfont(char* sfdname, char *infix) 
 {
   char *pos,*max,*sfdfile=NULL;
   struct subfont* sfdp=NULL;
Index: special.c
===================================================================
--- special.c	(revision 13607)
+++ special.c	(working copy)
@@ -40,7 +40,7 @@
 
 struct pscode* psheaderp=NULL; /* static, DVI-specific header list */
 
-void PSCodeInit(struct pscode *entry, char *special)
+static void PSCodeInit(struct pscode *entry, char *special)
 {
   entry->next=NULL;
   entry->special=special;
@@ -91,7 +91,7 @@
   }
 }
 
-void writepscode(struct pscode* pscodep, FILE* psstream)
+static void writepscode(struct pscode* pscodep, FILE* psstream)
 {
   while (pscodep!=NULL) {
     if (pscodep->code!=NULL) {
@@ -131,7 +131,7 @@
 }
 
 
-gdImagePtr
+static gdImagePtr
 ps2png(struct pscode* pscodep, char *device, int hresolution, int vresolution, 
        int llx, int lly, int urx, int ury, int bgred, int bggreen, int bgblue)
 {
@@ -274,7 +274,7 @@
   return psimage;
 }
 
-gdImagePtr
+static gdImagePtr
 rescale(gdImagePtr psimage, int pngwidth, int pngheight)
 {
   gdImagePtr scaledimage=psimage;
@@ -305,7 +305,7 @@
   return(scaledimage);
 }
 
-void newpsheader(char* special) {
+static void newpsheader(char* special) {
   struct pscode* tmp;
   char* txt;
 
Index: t1.c
===================================================================
--- t1.c	(revision 13607)
+++ t1.c	(working copy)
@@ -164,7 +164,7 @@
 }
 
 
-void UnLoadT1(struct char_entry *ptr)
+static void UnLoadT1(struct char_entry *ptr)
 {
   if (ptr->data!=NULL)
     free(ptr->data);