summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipng
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-11-09 16:08:58 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-11-09 16:08:58 +0000
commit2c92c64be5afdf033f8d21178b02950a379c1fb4 (patch)
treea2a0365e0fc42c4b7a1a854da9d4074643a7ff1b /Build/source/texk/dvipng
parentbfbe81796df41ce30c05a1dc88bb3147f28837b5 (diff)
update build system
git-svn-id: svn://tug.org/texlive/trunk@15951 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipng')
-rw-r--r--Build/source/texk/dvipng/dvipng-1.12-PATCHES/ChangeLog24
-rw-r--r--Build/source/texk/dvipng/dvipng-1.12-PATCHES/TL-Changes16
-rw-r--r--Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-01-portability16
-rw-r--r--Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-02-use-ifdef159
-rw-r--r--Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-03-have-ft221
-rw-r--r--Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-04-static341
-rw-r--r--Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-05-warnings382
7 files changed, 959 insertions, 0 deletions
diff --git a/Build/source/texk/dvipng/dvipng-1.12-PATCHES/ChangeLog b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/ChangeLog
new file mode 100644
index 00000000000..7dd3700d32c
--- /dev/null
+++ b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/ChangeLog
@@ -0,0 +1,24 @@
+2009-06-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-05-warnings (new): Avoid more compiler warnings.
+
+2009-06-09 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-04-static (new): Avoid warnings when compiling with
+ 'gcc --Wmissing-prototypes'.
+
+2009-02-22 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-03-have-ft2 (new): Bug fix - skip FT2 code when
+ compiling without FT2 library.
+
+2009-03-25 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-02-use-ifdef (new): Use #ifdef instead of #if to avoid
+ preprocessor warnings.
+
+2009-03-24 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-01-portability (new): Portability fix - put variable
+ declarations at the beginning of the block.
+
diff --git a/Build/source/texk/dvipng/dvipng-1.12-PATCHES/TL-Changes b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/TL-Changes
new file mode 100644
index 00000000000..ae2e8817223
--- /dev/null
+++ b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/TL-Changes
@@ -0,0 +1,16 @@
+Changes applied to the dvipng-1.12 tree as obtained from:
+ http://mirror.cinquix.com/pub/savannah/dvipng/dvipng-1.12.tar.gz
+
+Removed:
+ install-sh
+ mkinstalldirs
+
+Created Autoconf macro files ../m4/gs-device.m4 and ../m4/makeinfo.m4
+ adapting code in aclocal.m4.
+
+Moved these files to ../doc/:
+ dvipng.texi
+ install.texi
+ macros.texi
+ readme.texi
+
diff --git a/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-01-portability b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-01-portability
new file mode 100644
index 00000000000..3b789c9d4a4
--- /dev/null
+++ b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-01-portability
@@ -0,0 +1,16 @@
+ Avoid declaration after statement.
+
+diff -ur dvipng-1.12.orig/special.c dvipng-1.12/special.c
+--- dvipng-1.12.orig/special.c 2009-02-23 14:48:50.000000000 +0100
++++ dvipng-1.12/special.c 2009-03-24 15:03:27.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 --git a/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-02-use-ifdef b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-02-use-ifdef
new file mode 100644
index 00000000000..4729518dc5c
--- /dev/null
+++ b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-02-use-ifdef
@@ -0,0 +1,159 @@
+ Use "#if HAVE_ALLOCA_H" instead of "#ifdef HAVE_ALLOCA_H"
+ and similar, to avoid preprocessor warnings.
+
+diff -ur dvipng-1.12.orig/color.c dvipng-1.12/color.c
+--- dvipng-1.12.orig/color.c 2008-06-03 19:29:31.000000000 +0200
++++ dvipng-1.12/color.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
+
+diff -ur dvipng-1.12.orig/dvipng.h dvipng-1.12/dvipng.h
+--- dvipng-1.12.orig/dvipng.h 2008-06-03 19:30:18.000000000 +0200
++++ dvipng-1.12/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.orig/fontmap.c dvipng-1.12/fontmap.c
+--- dvipng-1.12.orig/fontmap.c 2008-05-05 20:58:00.000000000 +0200
++++ dvipng-1.12/fontmap.c 2009-03-25 14:04:41.000000000 +0100
+@@ -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;
+diff -ur dvipng-1.12.orig/ft.c dvipng-1.12/ft.c
+--- dvipng-1.12.orig/ft.c 2008-02-08 14:45:24.000000000 +0100
++++ dvipng-1.12/ft.c 2009-03-25 14:04: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.orig/misc.c dvipng-1.12/misc.c
+--- dvipng-1.12.orig/misc.c 2008-06-02 21:29:33.000000000 +0200
++++ dvipng-1.12/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.orig/pk.c dvipng-1.12/pk.c
+--- dvipng-1.12.orig/pk.c 2008-05-05 20:58:00.000000000 +0200
++++ dvipng-1.12/pk.c 2009-03-25 14:05:54.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.orig/set.c dvipng-1.12/set.c
+--- dvipng-1.12.orig/set.c 2008-02-08 14:45:23.000000000 +0100
++++ dvipng-1.12/set.c 2009-03-25 14:06:04.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.orig/t1.c dvipng-1.12/t1.c
+--- dvipng-1.12.orig/t1.c 2008-02-08 14:45:23.000000000 +0100
++++ dvipng-1.12/t1.c 2009-03-25 14:06:12.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.orig/tfm.c dvipng-1.12/tfm.c
+--- dvipng-1.12.orig/tfm.c 2008-05-05 20:58:00.000000000 +0200
++++ dvipng-1.12/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
+
diff --git a/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-03-have-ft2 b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-03-have-ft2
new file mode 100644
index 00000000000..20f7a451802
--- /dev/null
+++ b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-03-have-ft2
@@ -0,0 +1,21 @@
+ Put "#ifdef HAVE_FT2" ... "#endif" around code using FT2.
+
+diff -ur dvipng-1.12.orig/fontmap.c dvipng-1.12/fontmap.c
+--- dvipng-1.12.orig/fontmap.c 2009-03-25 14:04:41.000000000 +0100
++++ dvipng-1.12/fontmap.c 2009-04-22 14:14:06.000000000 +0200
+@@ -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 --git a/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-04-static b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-04-static
new file mode 100644
index 00000000000..dd14dce5d29
--- /dev/null
+++ b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-04-static
@@ -0,0 +1,341 @@
+ Declare all functions used in only one file as static.
+
+diff -ur dvipng-1.12.orig/color.c dvipng-1.12/color.c
+--- dvipng-1.12.orig/color.c 2009-03-25 14:06:21.000000000 +0100
++++ dvipng-1.12/color.c 2009-06-09 12:58:51.000000000 +0200
+@@ -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;
+diff -ur dvipng-1.12.orig/draw.c dvipng-1.12/draw.c
+--- dvipng-1.12.orig/draw.c 2008-05-05 22:54:51.000000000 +0200
++++ dvipng-1.12/draw.c 2009-06-09 12:37:32.000000000 +0200
+@@ -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.
+ */
+diff -ur dvipng-1.12.orig/dvi.c dvipng-1.12/dvi.c
+--- dvipng-1.12.orig/dvi.c 2008-05-05 22:54:51.000000000 +0200
++++ dvipng-1.12/dvi.c 2009-06-09 12:36:50.000000000 +0200
+@@ -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;
+
+diff -ur dvipng-1.12.orig/enc.c dvipng-1.12/enc.c
+--- dvipng-1.12.orig/enc.c 2008-05-05 20:58:00.000000000 +0200
++++ dvipng-1.12/enc.c 2009-06-09 12:53:02.000000000 +0200
+@@ -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;
+diff -ur dvipng-1.12.orig/font.c dvipng-1.12/font.c
+--- dvipng-1.12.orig/font.c 2008-02-08 14:45:24.000000000 +0100
++++ dvipng-1.12/font.c 2009-06-09 12:40:10.000000000 +0200
+@@ -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:
+diff -ur dvipng-1.12.orig/fontmap.c dvipng-1.12/fontmap.c
+--- dvipng-1.12.orig/fontmap.c 2009-04-22 14:14:06.000000000 +0200
++++ dvipng-1.12/fontmap.c 2009-06-09 12:55:27.000000000 +0200
+@@ -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;
+diff -ur dvipng-1.12.orig/ft.c dvipng-1.12/ft.c
+--- dvipng-1.12.orig/ft.c 2009-03-25 14:04:41.000000000 +0100
++++ dvipng-1.12/ft.c 2009-06-09 12:56:39.000000000 +0200
+@@ -145,7 +145,7 @@
+ }
+
+
+-void UnLoadFT(struct char_entry *ptr)
++static void UnLoadFT(struct char_entry *ptr)
+ {
+ if (ptr->data!=NULL)
+ free(ptr->data);
+diff -ur dvipng-1.12.orig/papersiz.c dvipng-1.12/papersiz.c
+--- dvipng-1.12.orig/papersiz.c 2008-02-08 14:45:24.000000000 +0100
++++ dvipng-1.12/papersiz.c 2009-06-09 12:59:23.000000000 +0200
+@@ -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;
+diff -ur dvipng-1.12.orig/pk.c dvipng-1.12/pk.c
+--- dvipng-1.12.orig/pk.c 2009-03-25 14:05:54.000000000 +0100
++++ dvipng-1.12/pk.c 2009-06-09 12:47:48.000000000 +0200
+@@ -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);
+diff -ur dvipng-1.12.orig/ppagelist.c dvipng-1.12/ppagelist.c
+--- dvipng-1.12.orig/ppagelist.c 2008-02-08 14:45:23.000000000 +0100
++++ dvipng-1.12/ppagelist.c 2009-06-09 12:45:06.000000000 +0200
+@@ -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;
+
+diff -ur dvipng-1.12.orig/set.c dvipng-1.12/set.c
+--- dvipng-1.12.orig/set.c 2009-03-25 14:06:04.000000000 +0100
++++ dvipng-1.12/set.c 2009-06-09 12:45:07.000000000 +0200
+@@ -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 */
+ {
+diff -ur dvipng-1.12.orig/sfd.c dvipng-1.12/sfd.c
+--- dvipng-1.12.orig/sfd.c 2008-05-05 20:58:00.000000000 +0200
++++ dvipng-1.12/sfd.c 2009-06-09 12:49:29.000000000 +0200
+@@ -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;
+diff -ur dvipng-1.12.orig/special.c dvipng-1.12/special.c
+--- dvipng-1.12.orig/special.c 2009-03-24 15:03:27.000000000 +0100
++++ dvipng-1.12/special.c 2009-06-09 13:01:45.000000000 +0200
+@@ -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;
+
+diff -ur dvipng-1.12.orig/t1.c dvipng-1.12/t1.c
+--- dvipng-1.12.orig/t1.c 2009-03-25 14:06:12.000000000 +0100
++++ dvipng-1.12/t1.c 2009-06-09 12:56:08.000000000 +0200
+@@ -164,7 +164,7 @@
+ }
+
+
+-void UnLoadT1(struct char_entry *ptr)
++static void UnLoadT1(struct char_entry *ptr)
+ {
+ if (ptr->data!=NULL)
+ free(ptr->data);
diff --git a/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-05-warnings b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-05-warnings
new file mode 100644
index 00000000000..2de4ce3a696
--- /dev/null
+++ b/Build/source/texk/dvipng/dvipng-1.12-PATCHES/patch-05-warnings
@@ -0,0 +1,382 @@
+ Avoid compiler warnings:
+ ANSI C function definitions.
+ Declare various (param and other) strings as const.
+ * special.c (SetSpecial): Avoid assigning a literal string to
+ the non-const string variable 'special' (somewhat clumsy).
+
+diff -ur dvipng-1.12.orig/color.c dvipng-1.12/color.c
+--- dvipng-1.12.orig/color.c 2009-06-09 12:58:51.000000000 +0200
++++ dvipng-1.12/color.c 2009-10-01 11:14:12.000000000 +0200
+@@ -39,11 +39,11 @@
+ char name[1];
+ } *colornamep=NULL,*xcp=NULL;
+
+-char *colordef[]={"xcolor.sty","dvipsnam.def",
+- "svgnam.def","x11nam.def",NULL};
++const char *colordef[]={"xcolor.sty","dvipsnam.def",
++ "svgnam.def","x11nam.def",NULL};
+ char *xcpname=NULL;
+
+-void initcolor()
++void initcolor(void)
+ {
+ csp = 1;
+ cstack[0].red=255;
+@@ -54,7 +54,7 @@
+ cstack[1].blue=0;
+ }
+
+-static struct colorname * NewColor(char* prefix, int nprefix,
++static struct colorname * NewColor(const char* prefix, int nprefix,
+ char* name, int nname,
+ char* model, int nmodel,
+ char* values, int nvalues)
+@@ -92,11 +92,12 @@
+ #define FINDPSNAMEEND(s,n) n=0; while(s<max && *s!='{') { s++; n++; }
+ #define BLANKCOMMAS(s)
+
+-static struct colorname* LoadColornameFile(char* filename)
++static struct colorname* LoadColornameFile(const char* filename)
+ {
+ struct colorname *list=NULL,*tmp=NULL;
+ char *filepath,*pos,*max;
+- char *prefix="",*name,*values,*model;
++ const char *prefix="";
++ char *name,*values,*model;
+ int nprefix=0,nname,nvalues,nmodel;
+ struct filemmap fmmap;
+
+@@ -190,7 +191,7 @@
+ ClearXColorPrologue();
+ }
+
+-void InitXColorPrologue(char* name)
++void InitXColorPrologue(const char* name)
+ {
+ ClearXColorPrologue();
+ xcpname=malloc(strlen(name)+1);
+@@ -203,7 +204,8 @@
+ {
+ struct colorname *list=NULL,*tmp=NULL;
+ char *filepath,*pos,*max;
+- char *prefix="",*name,*values,*model;
++ const char *prefix="";
++ char *name,*values,*model;
+ int nprefix=0,nname,nvalues,nmodel;
+ struct filemmap fmmap;
+
+@@ -244,7 +246,7 @@
+ #define NEXTINT(c) strtol(c,&end,10); WARN_IF_FAILED(c,end); c=end
+ #define NEXTHEX(c) strtol(c,&end,16); WARN_IF_FAILED(c,end); c=end
+
+-void stringrgb(char* color,int *r,int *g,int *b)
++void stringrgb(const char* color,int *r,int *g,int *b)
+ {
+ char* end;
+ static int unloaded=1;
+@@ -364,14 +366,14 @@
+ DEBUG_PRINT(DEBUG_COLOR,("%d %d %d) ",*r,*g,*b))
+ }
+
+-void background(char* p)
++void background(const char* p)
+ {
+ stringrgb(p, &cstack[0].red, &cstack[0].green, &cstack[0].blue);
+ DEBUG_PRINT(DEBUG_COLOR,("\n BACKGROUND:\t(%d %d %d) ",
+ cstack[0].red, cstack[0].green, cstack[0].blue));
+ }
+
+-void pushcolor(char * p)
++void pushcolor(const char * p)
+ {
+ if ( ++csp == STACK_SIZE )
+ Fatal("out of color stack space") ;
+@@ -380,13 +382,13 @@
+ cstack[csp].red, cstack[csp].green, cstack[csp].blue))
+ }
+
+-void popcolor()
++void popcolor(void)
+ {
+ if (csp > 1) csp--; /* Last color is global */
+ DEBUG_PRINT(DEBUG_COLOR,("\n COLOR POP\t"))
+ }
+
+-void resetcolorstack(char * p)
++void resetcolorstack(const char * p)
+ {
+ if ( csp > 1 )
+ Warning("global color change within nested colors");
+diff -ur dvipng-1.12.orig/dvi.c dvipng-1.12/dvi.c
+--- dvipng-1.12.orig/dvi.c 2009-06-09 12:36:50.000000000 +0200
++++ dvipng-1.12/dvi.c 2009-10-01 00:45:04.000000000 +0200
+@@ -38,7 +38,7 @@
+
+ bool followmode=0;
+
+-bool DVIFollowToggle()
++bool DVIFollowToggle(void)
+ {
+ return followmode = ! followmode;
+ }
+diff -ur dvipng-1.12.orig/dvipng.h dvipng-1.12/dvipng.h
+--- dvipng-1.12.orig/dvipng.h 2009-03-25 14:04:41.000000000 +0100
++++ dvipng-1.12/dvipng.h 2009-10-01 11:14:10.000000000 +0200
+@@ -223,9 +223,9 @@
+ bool MmapFile (char *filename,struct filemmap *fmmap);
+ void UnMmapFile(struct filemmap* fmmap);
+
+-void Message(int, char *fmt, ...);
+-void Warning(char *fmt, ...);
+-void Fatal(char *fmt, ...);
++void Message(int, const char *fmt, ...);
++void Warning(const char *fmt, ...);
++void Fatal(const char *fmt, ...);
+
+ int32_t SNumRead(unsigned char*, register int);
+ uint32_t UNumRead(unsigned char*, register int);
+@@ -354,10 +354,10 @@
+ #endif
+
+ /********************************************************/
+-/********************* pplist.h ***********************/
++/********************* ppagelist.h ********************/
+ /********************************************************/
+
+-bool ParsePages(char*);
++bool ParsePages(const char*);
+ void FirstPage(int32_t,bool);
+ void LastPage(int32_t,bool);
+ void ClearPpList(void);
+@@ -396,19 +396,19 @@
+ void EndVFMacro(void);
+
+ /**************************************************/
+-void handlepapersize(char*,int32_t*,int32_t*);
++void handlepapersize(const char*,int32_t*,int32_t*);
+
+-void stringrgb(char* colorstring,int *r,int *g,int *b);
+-void background(char *);
++void stringrgb(const char* colorstring,int *r,int *g,int *b);
++void background(const char *);
+ void initcolor(void);
+ void popcolor(void);
+-void pushcolor(char *);
+-void resetcolorstack(char *);
++void pushcolor(const char *);
++void resetcolorstack(const char *);
+ void StoreColorStack(struct page_list *tpagep);
+ void ReadColorStack(struct page_list *tpagep);
+ void StoreBackgroundColor(struct page_list *tpagep);
+ void ClearColorNames(void);
+-void InitXColorPrologue(char* prologuename);
++void InitXColorPrologue(const char* prologuename);
+
+ /**********************************************************************/
+ /************************* Global Variables *************************/
+diff -ur dvipng-1.12.orig/fontmap.c dvipng-1.12/fontmap.c
+--- dvipng-1.12.orig/fontmap.c 2009-06-09 12:55:27.000000000 +0200
++++ dvipng-1.12/fontmap.c 2009-10-01 00:44:57.000000000 +0200
+@@ -55,7 +55,7 @@
+ return(word);
+ }
+
+-static char* find_format(char* name)
++static char* find_format(const char* name)
+ {
+ /* Cater for both new (first case) and old (second case) kpathsea */
+ char* format =
+diff -ur dvipng-1.12.orig/misc.c dvipng-1.12/misc.c
+--- dvipng-1.12.orig/misc.c 2009-03-25 14:05:54.000000000 +0100
++++ dvipng-1.12/misc.c 2009-10-01 00:39:28.000000000 +0200
+@@ -690,7 +690,7 @@
+ /**********************************************************************/
+ /****************************** Fatal *******************************/
+ /**********************************************************************/
+-void Fatal (char *fmt, ...)
++void Fatal (const char *fmt, ...)
+ {
+ va_list args;
+
+@@ -719,7 +719,7 @@
+ /**********************************************************************/
+ /***************************** Warning ******************************/
+ /**********************************************************************/
+-void Warning(char *fmt, ...)
++void Warning(const char *fmt, ...)
+ {
+ va_list args;
+
+@@ -738,7 +738,7 @@
+ /**********************************************************************/
+ /***************************** Message ******************************/
+ /**********************************************************************/
+-void Message(int activeflags, char *fmt, ...)
++void Message(int activeflags, const char *fmt, ...)
+ {
+ va_list args;
+
+diff -ur dvipng-1.12.orig/papersiz.c dvipng-1.12/papersiz.c
+--- dvipng-1.12.orig/papersiz.c 2009-06-09 12:59:23.000000000 +0200
++++ dvipng-1.12/papersiz.c 2009-10-01 01:49:36.000000000 +0200
+@@ -36,20 +36,21 @@
+ * Advance the passed pointer as well.
+ */
+
+-static int32_t myatodim(char ** p)
++static int32_t myatodim(const char ** p)
+ {
+ double tmp; /* double accuracy is enough, I think */
+ int i=0;
++ char *q;
+
+- tmp = strtod(*p,p);
+- while (**p == ' ')
+- (*p)++;
+- while (i<8 && ((*p)[0]!=lengthnames[i][0] || (*p)[1]!=lengthnames[i][1]))
++ tmp = strtod(*p,&q);
++ while (*q == ' ')
++ q++;
++ while (i<8 && (q[0]!=lengthnames[i][0] || q[1]!=lengthnames[i][1]))
+ i++;
+- if (i==8 && ((*p)[0]!=lengthnames[i][0] || (*p)[1]!=lengthnames[i][1]))
+- Warning("unrecognized length unit \"%.2s\", assuming inches",*p);
+- while (**p != ',' && **p !='\0')
+- (*p)++;
++ if (i==8 && (q[0]!=lengthnames[i][0] || q[1]!=lengthnames[i][1]))
++ Warning("unrecognized length unit \"%.2s\", assuming inches",q);
++ while (*q != ',' && *q !='\0')
++ q++;
+ tmp = tmp*lengthsp[i]*dpi/4736286L; /* sp * dots/in / (sp/in), convert sp to pixels */
+ return((int32_t) tmp);
+ }
+@@ -60,7 +61,7 @@
+ * the string after the `papersize=' specification.
+ */
+
+-void handlepapersize(char * p, int32_t * x, int32_t * y)
++void handlepapersize(const char * p, int32_t * x, int32_t * y)
+ {
+ while (*p == ' ')
+ p++ ;
+diff -ur dvipng-1.12.orig/ppagelist.c dvipng-1.12/ppagelist.c
+--- dvipng-1.12.orig/ppagelist.c 2009-06-09 12:45:06.000000000 +0200
++++ dvipng-1.12/ppagelist.c 2009-10-01 10:40:01.000000000 +0200
+@@ -130,9 +130,10 @@
+ /* Parse a string representing a list of pages. Return 0 iff ok. As a
+ side effect, the page selection(s) is (are) prepended to ppages. */
+
+-bool ParsePages(char *s)
++bool ParsePages(const char *s)
+ {
+- char *c; /* conversion start */
++ const char *c; /* conversion start */
++ char *t;
+ long int ps_low = PAGE_MINPAGE, ps_high = PAGE_MAXPAGE;
+
+ while (*s==' ' || *s=='\t') s++;
+@@ -140,23 +141,27 @@
+ if (*s=='-' || *s==':') { /* range with no starting value */
+ ps_low = PAGE_MINPAGE;
+ c=s+1;
+- ps_high = strtol(c,&s,10);
++ ps_high = strtol(c,&t,10);
++ s = t;
+ if (c==s) ps_high=PAGE_MAXPAGE; /* no number */
+ while (*s==' ' || *s=='\t') s++;
+ if (*s=='-' || *s==':') { /* Oh, range with negative starting value */
+ ps_low = -ps_high;
+ c=s+1;
+- ps_high = strtol(c,&s,10);
++ ps_high = strtol(c,&t,10);
++ s = t;
+ if (c==s) ps_high=PAGE_MAXPAGE; /* no number */
+ }
+ } else { /* range with starting value, or singleton */
+ c=s;
+- ps_low = ps_high = strtol(c,&s,10);
++ ps_low = ps_high = strtol(c,&t,10);
++ s = t;
+ if (c==s)
+ return(true);
+ if (*s=='-' || *s==':') { /* range */
+ c=s+1;
+- ps_high = strtol(c,&s,10);
++ ps_high = strtol(c,&t,10);
++ s = t;
+ if (c==s) ps_high=PAGE_MAXPAGE; /* no number */
+ }
+ }
+diff -ur dvipng-1.12.orig/special.c dvipng-1.12/special.c
+--- dvipng-1.12.orig/special.c 2009-06-09 13:01:45.000000000 +0200
++++ dvipng-1.12/special.c 2009-10-01 14:43:06.000000000 +0200
+@@ -132,7 +132,7 @@
+
+
+ static gdImagePtr
+-ps2png(struct pscode* pscodep, char *device, int hresolution, int vresolution,
++ps2png(struct pscode* pscodep, const char *device, int hresolution, int vresolution,
+ int llx, int lly, int urx, int ury, int bgred, int bggreen, int bgblue)
+ {
+ #ifndef MIKTEX
+@@ -305,7 +305,7 @@
+ return(scaledimage);
+ }
+
+-static void newpsheader(char* special) {
++static void newpsheader(const char* special) {
+ struct pscode* tmp;
+ char* txt;
+
+@@ -669,6 +669,7 @@
+ struct pscode *tmp;
+ gdImagePtr psimage=NULL;
+ char *txt;
++ const char *newspecial=NULL; /* Avoid warning from special="..." */
+
+ /* Some packages split their literal PostScript code into
+ several specials. Check for those, and concatenate them so
+@@ -694,9 +695,9 @@
+ specials. The first numbers are generally valid for the bop
+ instruction, and the latter code is to move the origin to
+ the right place. */
+- special="ps:: 39139632 55387786 1000 600 600 (tikzdefault.dvi) @start 1 0 bop pgfo 0 0 matrix defaultmatrix transform itransform translate";
++ newspecial="ps:: 39139632 55387786 1000 600 600 (tikzdefault.dvi) @start 1 0 bop pgfo 0 0 matrix defaultmatrix transform itransform translate";
+ else if (strcmp(special,"ps:: pgfc")==0)
+- special="ps:: pgfc eop end";
++ newspecial="ps:: pgfc eop end";
+ nextisps=DVIIsNextPSSpecial(dvi);
+ if (psenvironment || nextisps) {
+ if (!nextisps) {
+@@ -705,12 +706,20 @@
+ }
+ /* Don't use alloca, we do not want to run out of stack space */
+ DEBUG_PRINT(DEBUG_GS,("\n PS SPECIAL "));
+- txt=malloc(strlen(special)+1);
+- strcpy(txt,special);
++ if (newspecial == NULL)
++ newspecial=special;
++ if ((txt=malloc(strlen(newspecial)+1))==NULL)
++ Fatal("cannot allocate space for raw PostScript special");
++ strcpy(txt,newspecial);
+ PSCodeInit(tmp,txt);
+ return;
+ }
+ DEBUG_PRINT(DEBUG_DVI,("\n LAST PS SPECIAL "));
++ if (newspecial != NULL) {
++ if ((special=malloc(strlen(newspecial)+1))==NULL)
++ Fatal("cannot allocate space for raw PostScript special");
++ strcpy(special,newspecial);
++ }
+ PSCodeInit(tmp,special);
+ /* Now, render image */
+ if (option_flags & NO_GHOSTSCRIPT)
+@@ -752,6 +761,8 @@
+ }
+ free(pscodep);
+ pscodep=NULL;
++ if (newspecial != NULL)
++ free(special);
+ if (psimage==NULL)
+ page_flags |= PAGE_GAVE_WARN;
+ Message(BE_NONQUIET,">");