summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog46
-rw-r--r--Build/source/texk/web2c/pdftexdir/am/libpdftex.am7
-rw-r--r--Build/source/texk/web2c/pdftexdir/am/pdftex.am2
-rw-r--r--Build/source/texk/web2c/pdftexdir/avl.c6
-rw-r--r--Build/source/texk/web2c/pdftexdir/avlstuff.c10
-rw-r--r--Build/source/texk/web2c/pdftexdir/epdf.c3
-rw-r--r--Build/source/texk/web2c/pdftexdir/epdf.h16
-rw-r--r--Build/source/texk/web2c/pdftexdir/inc-epdf.h20
-rw-r--r--Build/source/texk/web2c/pdftexdir/inc-extra.h7
-rw-r--r--Build/source/texk/web2c/pdftexdir/mapfile.c14
-rw-r--r--Build/source/texk/web2c/pdftexdir/ptexlib.h29
-rw-r--r--Build/source/texk/web2c/pdftexdir/utils.c43
-rw-r--r--Build/source/texk/web2c/pdftexdir/vfpacket.c6
-rw-r--r--Build/source/texk/web2c/pdftexdir/writeenc.c15
-rw-r--r--Build/source/texk/web2c/pdftexdir/writefont.c32
-rw-r--r--Build/source/texk/web2c/pdftexdir/writeimg.c4
-rw-r--r--Build/source/texk/web2c/pdftexdir/writejbig2.c14
-rw-r--r--Build/source/texk/web2c/pdftexdir/writejbig2.h6
-rw-r--r--Build/source/texk/web2c/pdftexdir/writepng.c12
-rw-r--r--Build/source/texk/web2c/pdftexdir/writet1.c24
-rw-r--r--Build/source/texk/web2c/pdftexdir/writettf.c25
21 files changed, 207 insertions, 134 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index 5fe23fec6b8..26e327442da 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,49 @@
+2010-01-25 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * am/libpdftex.am (libpdftex_a_CFLAGS): Enable compiler warnings.
+
+ Avoid most compiler warnings:
+
+ * ptexlib.h, writejbig2.h: ANSI C function prototypes.
+ * avlstuff.c, mapfile.c, utils.c, vfpacket.c, writeenc.c,
+ writefont.c, writeimg.c, writejbig2.c, writet1.c, writettf.c:
+ ANSI C function definitions.
+
+ * avlstuff.c, mapfile.c, utils.c, writeenc.c, writefont.c,
+ writejbig2.c, writepng.c, writet1.c, writettf.c: Declare
+ functions as static.
+
+ * ptexlib.h: Add prototype for imagecolor().
+ * inc-epdf.h: New file with prototypes for is_subsetable(),
+ epdf_check_mem(), epdf_create_fontdescriptor(),
+ epdf_mark_glyphs(), get_fd_objnum(), get_fn_objnum(), and
+ embed_whole_font() ...
+ * epdf.[ch]: ... removed from here.
+ * epdf.[ch]: #include "inc-epdf.h".
+ * inc-extra.h: New file with prototypes for stripzeros() and
+ epdf_write_enc() ...
+ * epdf.h: ... removed from here.
+ * epdf.c, utils.c, writeenc.c: #include "inc-extra.h".
+ * am/libpdftex.am (libpdftex_a_SOURCES): Add the new files.
+
+ * writejbig2.c: Avoid use of possibly uninitialized variables.
+
+ * utils.c, writefont.c, writet1.c, writettf.c:
+ Declare various function params and args, local vars, and struct
+ members as const.
+
+ * writet1.c (append_cs_return): Drop unused local variable 'k'.
+
+ * avlstuff.c (destroy_oentry, PdfObjTree_free),
+ writet1.c (free_glyph_names):
+ Skip unused static functions (via #if 0 ... #endif).
+
+ * utils.c (newcolorstack): Don't use value of xretalloc(),
+ xretalloc(addr, n, t) already assigns the new pointer to addr.
+
+ * avl.c (avl_delete): Don't reuse const input param for
+ non-const return value.
+
2010-01-19 Peter Breitenlohner <peb@mppmu.mpg.de>
* am/libpdftex.am: Add dependency on $(XPDF_DEPEND).
diff --git a/Build/source/texk/web2c/pdftexdir/am/libpdftex.am b/Build/source/texk/web2c/pdftexdir/am/libpdftex.am
index d3abf434616..77773d2f0c2 100644
--- a/Build/source/texk/web2c/pdftexdir/am/libpdftex.am
+++ b/Build/source/texk/web2c/pdftexdir/am/libpdftex.am
@@ -8,7 +8,7 @@
EXTRA_LIBRARIES += libpdftex.a
libpdftex_a_CPPFLAGS = $(pdftex_cppflags)
-libpdftex_a_CFLAGS = # $(WARNING_CFLAGS)
+libpdftex_a_CFLAGS = $(WARNING_CFLAGS)
libpdftex_a_CXXFLAGS = # $(WARNING_CXXFLAGS)
libpdftex_a_SOURCES = \
@@ -48,6 +48,11 @@ libpdftex_a_SOURCES += \
pdftexdir/regex/regex.h
endif MINGW32
+## FIXME: temporary additional headers:
+libpdftex_a_SOURCES += \
+ pdftexdir/inc-epdf.h \
+ pdftexdir/inc-extra.h
+
# We must create pdftexd.h (and xpdf) before building the libpdftex_a_OBJECTS.
$(libpdftex_a_OBJECTS): pdftexd.h $(XPDF_DEPEND)
diff --git a/Build/source/texk/web2c/pdftexdir/am/pdftex.am b/Build/source/texk/web2c/pdftexdir/am/pdftex.am
index 755759ad2b8..98528582528 100644
--- a/Build/source/texk/web2c/pdftexdir/am/pdftex.am
+++ b/Build/source/texk/web2c/pdftexdir/am/pdftex.am
@@ -1,6 +1,6 @@
## texk/web2c/pdftexdir/am/pdftex.am: Makefile fragment for pdfTeX.
##
-## Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+## Copyright (C) 2009, 2010 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
pdftex_cppflags = $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) $(XPDF_INCLUDES)
diff --git a/Build/source/texk/web2c/pdftexdir/avl.c b/Build/source/texk/web2c/pdftexdir/avl.c
index 79c746cd10d..0241ebd3e6b 100644
--- a/Build/source/texk/web2c/pdftexdir/avl.c
+++ b/Build/source/texk/web2c/pdftexdir/avl.c
@@ -216,6 +216,8 @@ void *avl_delete(struct avl_table *tree, const void *item)
struct avl_node *p; /* Traverses tree to find node to delete. */
int cmp; /* Result of comparison between |item| and |p|. */
+ void *res;
+
assert(tree != NULL && item != NULL);
k = 0;
@@ -231,7 +233,7 @@ void *avl_delete(struct avl_table *tree, const void *item)
if (p == NULL)
return NULL;
}
- item = p->avl_data;
+ res = p->avl_data;
if (p->avl_link[1] == NULL)
pa[k - 1]->avl_link[da[k - 1]] = p->avl_link[0];
@@ -347,7 +349,7 @@ void *avl_delete(struct avl_table *tree, const void *item)
tree->avl_count--;
tree->avl_generation++;
- return (void *) item;
+ return res;
}
/* Refreshes the stack of parent pointers in |trav|
diff --git a/Build/source/texk/web2c/pdftexdir/avlstuff.c b/Build/source/texk/web2c/pdftexdir/avlstuff.c
index 59abcab1db5..ec50c3ecbc3 100644
--- a/Build/source/texk/web2c/pdftexdir/avlstuff.c
+++ b/Build/source/texk/web2c/pdftexdir/avlstuff.c
@@ -27,13 +27,13 @@ static struct avl_table *PdfObjTree[pdfobjtypemax + 1] =
/**********************************************************************/
/* memory management functions for AVL */
-void *avl_xmalloc(struct libavl_allocator *allocator, size_t size)
+static void *avl_xmalloc(struct libavl_allocator *allocator, size_t size)
{
assert(allocator != NULL && size > 0);
return xmalloc(size);
}
-void avl_xfree(struct libavl_allocator *allocator, void *block)
+static void avl_xfree(struct libavl_allocator *allocator, void *block)
{
assert(allocator != NULL && block != NULL);
xfree(block);
@@ -69,7 +69,7 @@ typedef struct oentry_ {
/* AVL sort oentry into avl_table[] */
-int compare_info(const void *pa, const void *pb, void *param)
+static int compare_info(const void *pa, const void *pb, void *param)
{
integer a, b;
int as, ae, bs, be, al, bl;
@@ -152,13 +152,14 @@ typedef struct {
/**********************************************************************/
/* cleaning up... */
+#if 0 /* unused */
static void destroy_oentry(void *pa, void *pb)
{
oentry *p = (oentry *) pa;
xfree(p);
}
-void PdfObjTree_free()
+static void PdfObjTree_free(void)
{
int i;
@@ -167,5 +168,6 @@ void PdfObjTree_free()
avl_destroy(PdfObjTree[i], destroy_oentry);
}
}
+#endif
/**********************************************************************/
diff --git a/Build/source/texk/web2c/pdftexdir/epdf.c b/Build/source/texk/web2c/pdftexdir/epdf.c
index a4404c45e60..8d3849c60b8 100644
--- a/Build/source/texk/web2c/pdftexdir/epdf.c
+++ b/Build/source/texk/web2c/pdftexdir/epdf.c
@@ -19,10 +19,9 @@ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "ptexlib.h"
+#include "inc-epdf.h"
#include <string.h>
-extern void epdf_check_mem(void);
-
int is_subsetable(fm_entry * fm)
{
diff --git a/Build/source/texk/web2c/pdftexdir/epdf.h b/Build/source/texk/web2c/pdftexdir/epdf.h
index 8255639167c..28c146e67eb 100644
--- a/Build/source/texk/web2c/pdftexdir/epdf.h
+++ b/Build/source/texk/web2c/pdftexdir/epdf.h
@@ -74,15 +74,12 @@ extern "C" {
extern char notdef[];
- extern int is_subsetable(struct fm_entry *);
extern struct fm_entry *lookup_fontmap(char *);
extern integer get_fontfile(struct fm_entry *);
extern integer get_fontname(struct fm_entry *);
extern integer pdfnewobjnum(void);
extern integer read_pdf_info(char *, char *, integer, integer, integer,
integer);
- extern void embed_whole_font(struct fd_entry *);
- extern void epdf_check_mem(void);
extern void epdf_delete(void);
extern void epdf_free(void);
__attribute__ ((format(printf, 1, 2)))
@@ -106,18 +103,8 @@ extern "C" {
extern void zpdfnewdict(integer, integer, bool);
extern void zpdfosgetosbuf(integer);
-/* epdf.c */
- extern void epdf_mark_glyphs(struct fd_entry *, char *);
- extern struct fd_entry *epdf_create_fontdescriptor(struct fm_entry *, int);
- extern int get_fd_objnum(struct fd_entry *);
- extern int get_fn_objnum(struct fd_entry *);
-
-/* write_enc.c */
- extern void epdf_write_enc(char **, integer);
-
/* utils.c */
extern char *convertStringToPDFString(char *in, int len);
- extern char *stripzeros(char *a);
/* config.c */
extern integer cfgpar(integer);
@@ -125,4 +112,7 @@ extern "C" {
/* avlstuff.c */
extern void avl_put_obj(integer, integer);
extern integer avl_find_obj(integer, integer, integer);
+
+#include "inc-epdf.h"
+#include "inc-extra.h"
}
diff --git a/Build/source/texk/web2c/pdftexdir/inc-epdf.h b/Build/source/texk/web2c/pdftexdir/inc-epdf.h
new file mode 100644
index 00000000000..30e5ae954f5
--- /dev/null
+++ b/Build/source/texk/web2c/pdftexdir/inc-epdf.h
@@ -0,0 +1,20 @@
+/* prototypes used in epdf.c and pdftoepdf.cc */
+
+/* epdf.c */
+#ifdef __cplusplus
+# define fd_entry struct fd_entry
+# define fm_entry struct fm_entry
+# define integer int
+#endif
+ extern int is_subsetable(fm_entry *);
+ extern fd_entry *epdf_create_fontdescriptor(fm_entry *, int);
+ extern void epdf_mark_glyphs(fd_entry *, char *);
+ extern integer get_fd_objnum(fd_entry *);
+ extern integer get_fn_objnum(fd_entry *);
+ extern void embed_whole_font(fd_entry *);
+#undef fd_entry
+#undef fm_entry
+#undef integer
+
+/* pdftoepdf.cc */
+ extern void epdf_check_mem(void);
diff --git a/Build/source/texk/web2c/pdftexdir/inc-extra.h b/Build/source/texk/web2c/pdftexdir/inc-extra.h
new file mode 100644
index 00000000000..2e2e6b38b33
--- /dev/null
+++ b/Build/source/texk/web2c/pdftexdir/inc-extra.h
@@ -0,0 +1,7 @@
+/* prototypes used in pdftoepdf.cc and in C code */
+
+/* utils.c */
+ extern char *stripzeros(char *a);
+
+/* writeenc.c */
+ extern void epdf_write_enc(char **, integer);
diff --git a/Build/source/texk/web2c/pdftexdir/mapfile.c b/Build/source/texk/web2c/pdftexdir/mapfile.c
index e0851e1f2a1..825d72205fa 100644
--- a/Build/source/texk/web2c/pdftexdir/mapfile.c
+++ b/Build/source/texk/web2c/pdftexdir/mapfile.c
@@ -108,7 +108,7 @@ static void delete_ff_entry(ff_entry * ff)
xfree(ff);
}
-static fm_entry *dummy_fm_entry()
+static fm_entry *dummy_fm_entry(void)
{
static const fm_entry const_fm_entry;
return (fm_entry *) & const_fm_entry;
@@ -151,7 +151,7 @@ static int comp_ff_entry(const void *pa, const void *pb, void *p)
((const ff_entry *) pb)->ff_name);
}
-static void create_avl_trees()
+static void create_avl_trees(void)
{
assert(tfm_tree == NULL);
tfm_tree = avl_create(comp_fm_entry_tfm, NULL, &avl_xallocator);
@@ -256,7 +256,7 @@ int avl_do_entry(fm_entry * fm, int mode)
/* add the encoding name to an AVL tree. this has nothing to do with writeenc.c */
-char *add_encname(char *s)
+static char *add_encname(char *s)
{
char *p;
void **aa;
@@ -273,7 +273,7 @@ char *add_encname(char *s)
/**********************************************************************/
/* consistency check for map entry, with warn flag */
-int check_fm_entry(fm_entry * fm, boolean warn)
+static int check_fm_entry(fm_entry * fm, boolean warn)
{
int a = 0;
assert(fm != NULL);
@@ -398,7 +398,7 @@ int check_std_t1font(char *s)
/**********************************************************************/
-static void fm_scan_line()
+static void fm_scan_line(void)
{
int a, b, c, j, u = 0, v = 0;
float d;
@@ -555,7 +555,7 @@ static void fm_scan_line()
/**********************************************************************/
-void fm_read_info()
+void fm_read_info(void)
{
if (tfm_tree == NULL)
create_avl_trees();
@@ -742,7 +742,7 @@ fm_entry *lookup_fontmap(char *ps_name)
* ignored.
*/
-void process_map_item(char *s, int type)
+static void process_map_item(char *s, int type)
{
char *p;
int mode;
diff --git a/Build/source/texk/web2c/pdftexdir/ptexlib.h b/Build/source/texk/web2c/pdftexdir/ptexlib.h
index 227645d3f92..4adda8a455c 100644
--- a/Build/source/texk/web2c/pdftexdir/ptexlib.h
+++ b/Build/source/texk/web2c/pdftexdir/ptexlib.h
@@ -232,13 +232,13 @@ extern void tex_printf(const char *, ...);
extern void writestreamlength(integer, longinteger);
extern char *convertStringToPDFString(const char *in, int len);
extern void printID(strnumber);
-extern void printcreationdate();
-extern void printmoddate();
+extern void printcreationdate(void);
+extern void printmoddate(void);
extern void escapename(poolpointer in);
extern void escapestring(poolpointer in);
extern void escapehex(poolpointer in);
extern void unescapehex(poolpointer in);
-extern void getcreationdate();
+extern void getcreationdate(void);
extern void getfilemoddate(strnumber s);
extern void getfilesize(strnumber s);
extern void getmd5sum(strnumber s, boolean file);
@@ -246,12 +246,12 @@ extern void getfiledump(strnumber s, int offset, int length);
extern void matchstrings(strnumber s, strnumber t, int subcount, boolean icase);
extern void getmatch(int i);
extern void makepdftexbanner(void);
-extern void initstarttime();
+extern void initstarttime(void);
extern void removepdffile(void);
extern void garbagewarning(void);
extern void initversionstring(char **versions);
extern int newcolorstack(integer s, integer literal_mode, boolean pagestart);
-extern int colorstackused();
+extern int colorstackused(void);
extern integer colorstackset(int colstack_no, integer s);
extern integer colorstackpush(int colstack_no, integer s);
extern integer colorstackpop(int colstack_no);
@@ -264,13 +264,13 @@ extern void pdfshipoutend(boolean shipping_page);
extern void pdfsetmatrix(poolpointer in, scaled cur_h, scaled cur_v);
extern void matrixtransformpoint(scaled x, scaled y);
extern void matrixtransformrect(scaled llx, scaled lly, scaled urx, scaled ury);
-extern boolean matrixused();
+extern boolean matrixused(void);
extern void matrixrecalculate(scaled urx);
-extern scaled getllx();
-extern scaled getlly();
-extern scaled geturx();
-extern scaled getury();
-extern void allocvffnts();
+extern scaled getllx(void);
+extern scaled getlly(void);
+extern scaled geturx(void);
+extern scaled getury(void);
+extern void allocvffnts(void);
/* vfpacket.c */
extern integer newvfpacket(internalfontnumber);
@@ -290,7 +290,7 @@ extern void write_fontencodings(void);
extern void dopdffont(integer, internalfontnumber);
extern fd_entry *lookup_fd_entry(char *, integer, integer);
extern fd_entry *new_fd_entry(void);
-extern void writefontstuff();
+extern void writefontstuff(void);
extern void register_fd_entry(fd_entry *);
/* writeimg.c */
@@ -301,6 +301,7 @@ extern boolean ispdfimage(integer);
extern boolean ispngimage(integer);
extern integer epdforigx(integer);
extern integer epdforigy(integer);
+extern integer imagecolor(integer);
extern integer imageheight(integer);
extern integer imagepages(integer);
extern integer imagewidth(integer);
@@ -314,11 +315,11 @@ extern void deleteimage(integer);
extern void img_free(void);
extern void updateimageprocset(integer);
extern void writeimage(integer);
-extern void dumpimagemeta();
+extern void dumpimagemeta(void);
extern void undumpimagemeta(integer, integer);
/* writejbig2.c */
-extern void flushjbig2page0objects();
+extern void flushjbig2page0objects(void);
/* writet1.c */
extern boolean t1_subset(char *, char *, unsigned char *);
diff --git a/Build/source/texk/web2c/pdftexdir/utils.c b/Build/source/texk/web2c/pdftexdir/utils.c
index fa06410e1bd..1253e8d07ab 100644
--- a/Build/source/texk/web2c/pdftexdir/utils.c
+++ b/Build/source/texk/web2c/pdftexdir/utils.c
@@ -41,6 +41,7 @@ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include "md5.h"
#include "zlib.h"
#include "ptexlib.h"
+#include "inc-extra.h"
#include "png.h"
#ifdef POPPLER_VERSION
#include "poppler-config.h"
@@ -136,7 +137,7 @@ void make_subset_tag(fd_entry * fd)
for (glyph = (char *) avl_t_first(&t, fd->gl_tree); glyph != NULL;
glyph = (char *) avl_t_next(&t)) {
md5_append(&pms, (md5_byte_t *) glyph, strlen(glyph));
- md5_append(&pms, (md5_byte_t *) " ", 1);
+ md5_append(&pms, (const md5_byte_t *) " ", 1);
}
md5_append(&pms, (md5_byte_t *) fd->fontname, strlen(fd->fontname));
md5_append(&pms, (md5_byte_t *) & j, sizeof(int)); /* to resolve collision */
@@ -433,7 +434,7 @@ scaled extxnoverd(scaled x, scaled n, scaled d)
return (scaled) r;
}
-void libpdffinish()
+void libpdffinish(void)
{
xfree(fb_array);
xfree(char_array);
@@ -883,7 +884,7 @@ static void makepdftime(time_t t, char *time_str)
}
}
-void initstarttime()
+void initstarttime(void)
{
if (start_time == 0) {
start_time = time((time_t *) NULL);
@@ -891,19 +892,19 @@ void initstarttime()
}
}
-void printcreationdate()
+void printcreationdate(void)
{
initstarttime();
pdf_printf("/CreationDate (%s)\n", start_time_str);
}
-void printmoddate()
+void printmoddate(void)
{
initstarttime();
pdf_printf("/ModDate (%s)\n", start_time_str);
}
-void getcreationdate()
+void getcreationdate(void)
{
/* put creation date on top of string pool and update poolptr */
size_t len = strlen(start_time_str);
@@ -1338,7 +1339,7 @@ static int colstacks_used = 0;
procedure calls.
*/
#define init_colorstacks() if (colstacks_size == 0) colstacks_first_init();
-void colstacks_first_init()
+static void colstacks_first_init(void)
{
colstacks_size = STACK_INCREMENT;
colstacks = xtalloc(colstacks_size, colstack_type);
@@ -1356,7 +1357,7 @@ void colstacks_first_init()
colstacks[0].page_start = true;
}
-int colorstackused()
+int colorstackused(void)
{
init_colorstacks();
return colstacks_used;
@@ -1383,7 +1384,7 @@ int newcolorstack(integer s, integer literal_mode, boolean page_start)
colstacks_size += STACK_INCREMENT;
/* If (MAX_COLORSTACKS mod STACK_INCREMENT = 0) then we don't
need to check the case that size overruns MAX_COLORSTACKS. */
- colstacks = xretalloc(colstacks, colstacks_size, colstack_type);
+ xretalloc(colstacks, colstacks_size, colstack_type);
}
/* claim new color stack */
colstack_num = colstacks_used++;
@@ -1415,7 +1416,7 @@ int newcolorstack(integer s, integer literal_mode, boolean page_start)
/*
Puts a string on top of the string pool and updates poolptr.
*/
-void put_cstring_on_strpool(poolpointer start, char *str)
+static void put_cstring_on_strpool(poolpointer start, char *str)
{
size_t len;
@@ -1467,8 +1468,7 @@ integer colorstackpush(int colstack_no, integer s)
if (page_mode) {
if (colstack->page_used == colstack->page_size) {
colstack->page_size += STACK_INCREMENT;
- colstack->page_stack = xretalloc(colstack->page_stack,
- colstack->page_size, char *);
+ xretalloc(colstack->page_stack, colstack->page_size, char *);
}
colstack->page_stack[colstack->page_used++] = colstack->page_current;
str = makecstring(s);
@@ -1480,8 +1480,7 @@ integer colorstackpush(int colstack_no, integer s)
} else {
if (colstack->form_used == colstack->form_size) {
colstack->form_size += STACK_INCREMENT;
- colstack->form_stack = xretalloc(colstack->form_stack,
- colstack->form_size, char *);
+ xretalloc(colstack->form_stack, colstack->form_size, char *);
}
colstack->form_stack[colstack->form_used++] = colstack->form_current;
str = makecstring(s);
@@ -1520,7 +1519,7 @@ integer colorstackpop(int colstack_no)
return colstack->literal_mode;
}
-void colorstackpagestart()
+static void colorstackpagestart(void)
{
int i, j;
colstack_type *colstack;
@@ -1576,7 +1575,7 @@ static matrix_entry *matrix_stack = 0;
static int matrix_stack_size = 0;
static int matrix_stack_used = 0;
-boolean matrixused()
+boolean matrixused(void)
{
return matrix_stack_used > 0;
}
@@ -1591,7 +1590,7 @@ static pos_entry *pos_stack = 0; /* the stack */
static int pos_stack_size = 0; /* initially empty */
static int pos_stack_used = 0; /* used entries */
-void matrix_stack_room()
+static void matrix_stack_room(void)
{
matrix_entry *new_stack;
@@ -1746,22 +1745,22 @@ static scaled ret_lly;
static scaled ret_urx;
static scaled ret_ury;
-scaled getllx()
+scaled getllx(void)
{
return ret_llx;
}
-scaled getlly()
+scaled getlly(void)
{
return ret_lly;
}
-scaled geturx()
+scaled geturx(void)
{
return ret_urx;
}
-scaled getury()
+scaled getury(void)
{
return ret_ury;
}
@@ -1775,7 +1774,7 @@ static int last_ury;
#define DO_MIN(a, b) ((a < b) ? a : b)
#define DO_MAX(a, b) ((a > b) ? a : b)
-void do_matrixtransform(scaled x, scaled y, scaled * retx, scaled * rety)
+static void do_matrixtransform(scaled x, scaled y, scaled * retx, scaled * rety)
{
matrix_entry *m = &matrix_stack[matrix_stack_used - 1];
double x_old = x;
diff --git a/Build/source/texk/web2c/pdftexdir/vfpacket.c b/Build/source/texk/web2c/pdftexdir/vfpacket.c
index 7bc551bfc65..4a546fb3ac6 100644
--- a/Build/source/texk/web2c/pdftexdir/vfpacket.c
+++ b/Build/source/texk/web2c/pdftexdir/vfpacket.c
@@ -68,13 +68,13 @@ void startpacket(internalfontnumber f, eightbits c)
vfpacketlength = vf_array[vfpacketbase[f]].len[c - fontbc[f]];
}
-eightbits packetbyte()
+eightbits packetbyte(void)
{
vfpacketlength--;
return *packet_data_ptr++;
}
-void pushpacketstate()
+void pushpacketstate(void)
{
alloc_array(packet, 1, SMALL_ARRAY_SIZE);
packet_ptr->dataptr = packet_data_ptr;
@@ -82,7 +82,7 @@ void pushpacketstate()
packet_ptr++;
}
-void poppacketstate()
+void poppacketstate(void)
{
if (packet_ptr == packet_array)
pdftex_fail("packet stack empty, impossible to pop");
diff --git a/Build/source/texk/web2c/pdftexdir/writeenc.c b/Build/source/texk/web2c/pdftexdir/writeenc.c
index 1eb942a36a3..aae0a1a9f1a 100644
--- a/Build/source/texk/web2c/pdftexdir/writeenc.c
+++ b/Build/source/texk/web2c/pdftexdir/writeenc.c
@@ -19,6 +19,7 @@ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "ptexlib.h"
+#include "inc-extra.h"
/**********************************************************************/
/* All encoding entries go into AVL tree for fast search by name. */
@@ -32,7 +33,7 @@ static int comp_fe_entry(const void *pa, const void *pb, void *p)
return strcmp(((const fe_entry *) pa)->name, ((const fe_entry *) pb)->name);
}
-fe_entry *new_fe_entry()
+static fe_entry *new_fe_entry(void)
{
fe_entry *fe;
fe = xtalloc(1, fe_entry);
@@ -43,7 +44,7 @@ fe_entry *new_fe_entry()
return fe;
}
-fe_entry *lookup_fe_entry(char *s)
+static fe_entry *lookup_fe_entry(char *s)
{
fe_entry fe;
assert(s != NULL);
@@ -55,7 +56,7 @@ fe_entry *lookup_fe_entry(char *s)
return (fe_entry *) avl_find(fe_tree, &fe);
}
-void register_fe_entry(fe_entry * fe)
+static void register_fe_entry(fe_entry * fe)
{
void **aa;
if (fe_tree == NULL) {
@@ -108,7 +109,7 @@ void epdf_write_enc(char **glyph_names, integer fe_objnum)
pdfenddict();
}
-void write_enc(char **glyph_names, struct avl_table *tx_tree, integer fe_objnum)
+static void write_enc(char **glyph_names, struct avl_table *tx_tree, integer fe_objnum)
{
int i_old, *p;
struct avl_traverser t;
@@ -135,13 +136,13 @@ void write_enc(char **glyph_names, struct avl_table *tx_tree, integer fe_objnum)
pdfenddict();
}
-void write_fontencoding(fe_entry * fe)
+static void write_fontencoding(fe_entry * fe)
{
assert(fe != NULL);
write_enc(fe->glyph_names, fe->tx_tree, fe->fe_objnum);
}
-void write_fontencodings()
+void write_fontencodings(void)
{
fe_entry *fe;
struct avl_traverser t;
@@ -171,7 +172,7 @@ static void destroy_fe_entry(void *pa, void *pb)
xfree(p);
}
-void enc_free()
+void enc_free(void)
{
if (fe_tree != NULL)
avl_destroy(fe_tree, destroy_fe_entry);
diff --git a/Build/source/texk/web2c/pdftexdir/writefont.c b/Build/source/texk/web2c/pdftexdir/writefont.c
index 30ed172bad0..5752b968120 100644
--- a/Build/source/texk/web2c/pdftexdir/writefont.c
+++ b/Build/source/texk/web2c/pdftexdir/writefont.c
@@ -47,7 +47,7 @@ static int comp_fd_entry(const void *pa, const void *pb, void *p)
/**********************************************************************/
/* initialize data structure for /Type /Font */
-fo_entry *new_fo_entry(void)
+static fo_entry *new_fo_entry(void)
{
fo_entry *fo;
fo = xtalloc(1, fo_entry);
@@ -92,7 +92,7 @@ fd_entry *new_fd_entry(void)
/* initialize data structure for /Widths array object */
-cw_entry *new_cw_entry(void)
+static cw_entry *new_cw_entry(void)
{
cw_entry *cw;
cw = xtalloc(1, cw_entry);
@@ -183,7 +183,7 @@ static void preset_fontname(fo_entry * fo)
fo->fd->fontname = xstrdup(fo->fm->tfm_name);
}
-static void write_fontname(fd_entry * fd, char *key)
+static void write_fontname(fd_entry * fd, const char *key)
{
assert(fd->fontname != NULL);
pdf_puts("/");
@@ -220,7 +220,7 @@ fd_entry *lookup_fd_entry(char *s, integer slant, integer extend)
return (fd_entry *) avl_find(fd_tree, &fd);
}
-fd_entry *lookup_fontdescriptor(fo_entry * fo)
+static fd_entry *lookup_fontdescriptor(fo_entry * fo)
{
assert(fo != NULL);
assert(fo->fm != NULL);
@@ -241,7 +241,7 @@ void register_fd_entry(fd_entry * fd)
assert(aa != NULL);
}
-void create_fontdescriptor(fo_entry * fo, internalfontnumber f)
+static void create_fontdescriptor(fo_entry * fo, internalfontnumber f)
{
assert(fo != NULL);
assert(fo->fm != NULL);
@@ -262,7 +262,7 @@ void create_fontdescriptor(fo_entry * fo, internalfontnumber f)
* tree gl_tree of font descriptor fd referenced by font dictionary fo.
*/
-void mark_reenc_glyphs(fo_entry * fo, internalfontnumber f)
+static void mark_reenc_glyphs(fo_entry * fo, internalfontnumber f)
{
int i;
char **g;
@@ -288,7 +288,7 @@ void mark_reenc_glyphs(fo_entry * fo, internalfontnumber f)
* 2. Mark encoding pairs used by TeX to optimize encoding vector.
*/
-struct avl_table *mark_chars(fo_entry * fo, struct avl_table *tx_tree,
+static struct avl_table *mark_chars(fo_entry * fo, struct avl_table *tx_tree,
internalfontnumber f)
{
int i, *j;
@@ -310,7 +310,7 @@ struct avl_table *mark_chars(fo_entry * fo, struct avl_table *tx_tree,
/**********************************************************************/
-void get_char_range(fo_entry * fo, internalfontnumber f)
+static void get_char_range(fo_entry * fo, internalfontnumber f)
{
int i;
assert(fo != NULL);
@@ -329,7 +329,7 @@ void get_char_range(fo_entry * fo, internalfontnumber f)
}
}
-void create_charwidth_array(fo_entry * fo, internalfontnumber f)
+static void create_charwidth_array(fo_entry * fo, internalfontnumber f)
{
int i;
assert(fo != NULL);
@@ -369,7 +369,7 @@ static void write_charwidth_array(fo_entry * fo)
* into fo_tree; they are individually written out.
*/
-fo_entry *lookup_fo_entry(char *s)
+static fo_entry *lookup_fo_entry(char *s)
{
fo_entry fo;
fm_entry fm;
@@ -383,7 +383,7 @@ fo_entry *lookup_fo_entry(char *s)
return (fo_entry *) avl_find(fo_tree, &fo);
}
-void register_fo_entry(fo_entry * fo)
+static void register_fo_entry(fo_entry * fo)
{
void **aa;
if (fo_tree == NULL) {
@@ -507,7 +507,7 @@ static void write_fontdescriptor(fd_entry * fd)
pdfenddict();
}
-void write_fontdescriptors()
+static void write_fontdescriptors(void)
{
fd_entry *fd;
struct avl_traverser t;
@@ -521,7 +521,7 @@ void write_fontdescriptors()
/**********************************************************************/
-void write_fontdictionary(fo_entry * fo)
+static void write_fontdictionary(fo_entry * fo)
{
assert(fo != NULL);
assert(fo->fm != NULL);
@@ -569,7 +569,7 @@ void write_fontdictionary(fo_entry * fo)
pdfenddict();
}
-void write_fontdictionaries()
+static void write_fontdictionaries(void)
{
fo_entry *fo;
struct avl_traverser t;
@@ -587,7 +587,7 @@ void write_fontdictionaries()
* @<Output fonts definition@>= in pdftex.web.
*/
-void writefontstuff()
+void writefontstuff(void)
{
write_fontdescriptors();
write_fontencodings(); /* see writeenc.c */
@@ -596,7 +596,7 @@ void writefontstuff()
/**********************************************************************/
-void create_fontdictionary(fm_entry * fm, integer font_objnum,
+static void create_fontdictionary(fm_entry * fm, integer font_objnum,
internalfontnumber f)
{
fo_entry *fo = new_fo_entry();
diff --git a/Build/source/texk/web2c/pdftexdir/writeimg.c b/Build/source/texk/web2c/pdftexdir/writeimg.c
index f8285b64a49..cc638926746 100644
--- a/Build/source/texk/web2c/pdftexdir/writeimg.c
+++ b/Build/source/texk/web2c/pdftexdir/writeimg.c
@@ -405,7 +405,7 @@ void deleteimage(integer img)
return;
}
-void img_free()
+void img_free(void)
{
xfree(image_array);
}
@@ -466,7 +466,7 @@ void img_free()
-void dumpimagemeta()
+void dumpimagemeta(void)
{
int cur_image, img;
diff --git a/Build/source/texk/web2c/pdftexdir/writejbig2.c b/Build/source/texk/web2c/pdftexdir/writejbig2.c
index cc26cdfe1db..e724a3cab3c 100644
--- a/Build/source/texk/web2c/pdftexdir/writejbig2.c
+++ b/Build/source/texk/web2c/pdftexdir/writejbig2.c
@@ -118,7 +118,7 @@ int ygetc(FILE * stream)
/**********************************************************************/
-FILEINFO *new_fileinfo()
+FILEINFO *new_fileinfo(void)
{
FILEINFO *fip;
fip = xtalloc(1, FILEINFO);
@@ -136,7 +136,7 @@ FILEINFO *new_fileinfo()
return fip;
}
-PAGEINFO *new_pageinfo()
+PAGEINFO *new_pageinfo(void)
{
PAGEINFO *pip;
pip = xtalloc(1, PAGEINFO);
@@ -152,7 +152,7 @@ PAGEINFO *new_pageinfo()
return pip;
}
-void init_seginfo(SEGINFO * sip)
+static void init_seginfo(SEGINFO * sip)
{
sip->segnum = 0;
sip->isrefered = false;
@@ -375,7 +375,7 @@ boolean readseghdr(FILEINFO * fip, SEGINFO * sip)
void writeseghdr(FILEINFO * fip, SEGINFO * sip)
{
unsigned int i;
- unsigned long referedseg;
+ unsigned long referedseg = 0;
/* 7.2.2 Segment number */
/* 7.2.3 Segment header flags */
/* 7.2.4 Referred-to segment count and retention flags */
@@ -426,7 +426,7 @@ void writeseghdr(FILEINFO * fip, SEGINFO * sip)
void checkseghdr(FILEINFO * fip, SEGINFO * sip)
{
unsigned int i;
- unsigned long referedseg;
+ unsigned long referedseg = 0;
/* 7.2.2 Segment number */
/* 7.2.3 Segment header flags */
/* 7.2.4 Referred-to segment count and retention flags */
@@ -544,7 +544,7 @@ void rd_jbig2_info(FILEINFO * fip)
unsigned long currentpage = 0;
boolean sipavail = false;
PAGEINFO *pip;
- SEGINFO *sip;
+ SEGINFO *sip = NULL;
LIST *plp, *slp;
fip->file = xfopen(fip->filename, FOPEN_RBIN_MODE);
readfilehdr(fip);
@@ -730,7 +730,7 @@ void write_jbig2(integer img)
/**********************************************************************/
-void flushjbig2page0objects()
+void flushjbig2page0objects(void)
{
FILEINFO *fip;
struct avl_traverser t;
diff --git a/Build/source/texk/web2c/pdftexdir/writejbig2.h b/Build/source/texk/web2c/pdftexdir/writejbig2.h
index aa43c2620d5..4e47d29717d 100644
--- a/Build/source/texk/web2c/pdftexdir/writejbig2.h
+++ b/Build/source/texk/web2c/pdftexdir/writejbig2.h
@@ -122,8 +122,8 @@ static int comp_file_entry(const void *, const void *, void *);
static int comp_page_entry(const void *, const void *, void *);
static int comp_segment_entry(const void *, const void *, void *);
int ygetc(FILE *);
-FILEINFO *new_fileinfo();
-PAGEINFO *new_pageinfo();
+FILEINFO *new_fileinfo(void);
+PAGEINFO *new_pageinfo(void);
void initseginfo(SEGINFO *);
void initlinkedlist(LIST *);
LIST *litem_append(LIST *);
@@ -145,6 +145,6 @@ void rd_jbig2_info(FILEINFO *);
void wr_jbig2(FILEINFO *, unsigned long);
void read_jbig2_info(integer);
void write_jbig2(integer);
-void flushjbig2page0objects();
+void flushjbig2page0objects(void);
/**********************************************************************/
diff --git a/Build/source/texk/web2c/pdftexdir/writepng.c b/Build/source/texk/web2c/pdftexdir/writepng.c
index 22e2f3a3639..249bb96d933 100644
--- a/Build/source/texk/web2c/pdftexdir/writepng.c
+++ b/Build/source/texk/web2c/pdftexdir/writepng.c
@@ -155,7 +155,7 @@ void read_png_info(integer img)
}
-void write_png_palette(integer img)
+static void write_png_palette(integer img)
{
int i, j, k, l;
png_bytep row, r, *rows;
@@ -199,7 +199,7 @@ void write_png_palette(integer img)
}
}
-void write_png_gray(integer img)
+static void write_png_gray(integer img)
{
int i, j, k, l;
png_bytep row, r, *rows;
@@ -229,7 +229,7 @@ void write_png_gray(integer img)
-void write_png_gray_alpha(integer img)
+static void write_png_gray_alpha(integer img)
{
int i, j, k, l;
png_bytep row, r, *rows;
@@ -297,7 +297,7 @@ void write_png_gray_alpha(integer img)
}
}
-void write_png_rgb(integer img)
+static void write_png_rgb(integer img)
{
int i, j, k, l;
png_bytep row, r, *rows;
@@ -325,7 +325,7 @@ void write_png_rgb(integer img)
pdfendstream();
}
-void write_png_rgb_alpha(integer img)
+static void write_png_rgb_alpha(integer img)
{
int i, j, k, l;
png_bytep row, r, *rows;
@@ -418,7 +418,7 @@ static int spng_getint(FILE * fp)
#define SPNG_CHUNK_IDAT 0x49444154
#define SPNG_CHUNK_IEND 0x49454E44
-void copy_png(integer img)
+static void copy_png(integer img)
{
FILE *fp = (FILE *) png_ptr(img)->io_ptr;
int i, len, type, streamlength = 0;
diff --git a/Build/source/texk/web2c/pdftexdir/writet1.c b/Build/source/texk/web2c/pdftexdir/writet1.c
index 2ea62fe1727..76f4ea51f9e 100644
--- a/Build/source/texk/web2c/pdftexdir/writet1.c
+++ b/Build/source/texk/web2c/pdftexdir/writet1.c
@@ -291,7 +291,8 @@ char **load_enc_file(char *enc_name)
return glyph_names;
}
-void free_glyph_names(char **glyph_names)
+#if 0 /* unused */
+static void free_glyph_names(char **glyph_names)
{
int i;
assert(glyph_names != NULL);
@@ -300,6 +301,7 @@ void free_glyph_names(char **glyph_names)
xfree(glyph_names[i]);
xfree(glyph_names);
}
+#endif
static void t1_check_pfa(void)
{
@@ -683,7 +685,7 @@ static void t1_scan_keys(void)
{
int i, k;
char *p, *q, *r;
- key_entry *key;
+ const key_entry *key;
if (fm_extend(fd_cur->fm) != 0 || fm_slant(fd_cur->fm) != 0) {
if (t1_prefix("/FontMatrix")) {
t1_modify_fm();
@@ -700,7 +702,7 @@ static void t1_scan_keys(void)
pdftex_fail("Type%d fonts unsupported by pdfTeX", i);
return;
}
- for (key = (key_entry *) font_key; key - font_key < FONT_KEYS_NUM; key++) {
+ for (key = font_key; key - font_key < FONT_KEYS_NUM; key++) {
if (key->t1name[0] != '\0' &&
str_prefix(t1_line_array + 1, key->t1name))
break;
@@ -780,7 +782,7 @@ static void copy_glyph_names(char **glyph_names, int a, int b)
/* read encoding from Type1 font file, return glyph_names array, or pdffail() */
-char **t1_builtin_enc(void)
+static char **t1_builtin_enc(void)
{
int i, a, b, c, counter = 0;
char *r, *p, **glyph_names;
@@ -967,7 +969,7 @@ static void t1_include(void)
if (subr >= subr_size || subr < 0) \
pdftex_fail("Subrs array: entry index out of range (%i)", subr);
-static const char **check_cs_token_pair()
+static const char **check_cs_token_pair(void)
{
const char **p = (const char **) cs_token_pairs_list;
for (; p[0] != NULL; ++p)
@@ -1120,7 +1122,7 @@ static void cs_fail(const char *cs_name, int subr, const char *fmt, ...)
static void append_cs_return(cs_entry *ptr)
{
unsigned short cr;
- int i, k;
+ int i;
byte *p, *q, *data, *new_data;
assert(ptr != NULL && ptr->valid && ptr->used);
@@ -1297,10 +1299,10 @@ static void cs_mark(const char *cs_name, int subr)
static int comp_t1_glyphs(const void *pa, const void *pb, void *p)
{
- return strcmp(*((const char **) pa), *((const char **) pb));
+ return strcmp(*((const char * const *) pa), *((const char * const *) pb));
}
-struct avl_table *create_t1_glyph_tree(char **glyph_names)
+static struct avl_table *create_t1_glyph_tree(char **glyph_names)
{
int i;
void **aa;
@@ -1318,7 +1320,7 @@ struct avl_table *create_t1_glyph_tree(char **glyph_names)
return gl_tree;
}
-void destroy_t1_glyph_tree(struct avl_table *gl_tree)
+static void destroy_t1_glyph_tree(struct avl_table *gl_tree)
{
assert(gl_tree != NULL);
avl_destroy(gl_tree, NULL);
@@ -1415,7 +1417,7 @@ static void init_cs_entry(cs_entry * cs)
cs->valid = false;
}
-static void t1_read_subrs()
+static void t1_read_subrs(void)
{
int i, s;
cs_entry *ptr;
@@ -1694,7 +1696,7 @@ void writet1(fd_entry * fd)
t1_close_font_file(">");
}
-void t1_free()
+void t1_free(void)
{
xfree(t1_line_array);
xfree(t1_buf_array);
diff --git a/Build/source/texk/web2c/pdftexdir/writettf.c b/Build/source/texk/web2c/pdftexdir/writettf.c
index 8dcaf80e06d..5125d9d82f5 100644
--- a/Build/source/texk/web2c/pdftexdir/writettf.c
+++ b/Build/source/texk/web2c/pdftexdir/writettf.c
@@ -42,16 +42,15 @@ typedef struct {
TTF_LONG newoffset;
TTF_UFWORD advWidth;
TTF_FWORD lsb;
- char *name; /* name of glyph */
+ const char *name; /* name of glyph */
TTF_SHORT newindex; /* new index of glyph in output file */
TTF_USHORT name_index; /* index of name as read from font file */
} glyph_entry;
typedef struct {
- char *name; /* name of glyph */
+ const char *name; /* name of glyph */
long code; /* charcode in case of subfonts */
- long newindex; /* new index of glyph in output file */
-
+ long newindex; /* new index of glyph in output file */
} ttfenc_entry;
typedef struct {
@@ -123,7 +122,7 @@ static const char *newtabnames[] = {
"prep"
};
-ttf_cmap_entry *new_ttf_cmap_entry(void)
+static ttf_cmap_entry *new_ttf_cmap_entry(void)
{
ttf_cmap_entry *e;
e = xtalloc(1, ttf_cmap_entry);
@@ -263,7 +262,7 @@ static void ttf_copy_encoding(void)
assert(glyph_names != NULL);
for (i = 0; i < 256; i++)
- ttfenc_tab[i].name = (char *) notdef;
+ ttfenc_tab[i].name = notdef;
/* a workaround for a bug of AcroReader 4.0 */
if (strcmp(glyph_names[97], "a") == 0) {
@@ -398,7 +397,7 @@ static void ttf_read_mapx(void)
glyph->newindex = -1;
glyph->newoffset = 0;
glyph->name_index = 0;
- glyph->name = (char *) notdef;
+ glyph->name = notdef;
}
glyph_index = xtalloc(glyphs_count + 1, long);
glyph_index[0] = 0; /* index of ".notdef" glyph */
@@ -492,7 +491,7 @@ static void ttf_read_post(void)
switch (post_format) {
case 0x10000:
for (glyph = glyph_tab; glyph - glyph_tab < NMACGLYPHS; glyph++) {
- glyph->name = (char *) mac_glyph_names[glyph - glyph_tab];
+ glyph->name = mac_glyph_names[glyph - glyph_tab];
glyph->name_index = glyph - glyph_tab;
}
break;
@@ -509,7 +508,7 @@ static void ttf_read_post(void)
}
for (glyph = glyph_tab; glyph - glyph_tab < nnames; glyph++) {
if (glyph->name_index < NMACGLYPHS)
- glyph->name = (char *) mac_glyph_names[glyph->name_index];
+ glyph->name = mac_glyph_names[glyph->name_index];
else {
p = glyph_name_buf;
k = glyph->name_index - NMACGLYPHS;
@@ -542,7 +541,7 @@ static void ttf_read_loca(void)
glyph->offset = get_ushort() << 1;
}
-static void ttf_read_tabdir()
+static void ttf_read_tabdir(void)
{
int i;
dirtab_entry *tab;
@@ -1126,7 +1125,7 @@ static void ttf_reindex_glyphs(void)
}
}
-static void ttf_write_head()
+static void ttf_write_head(void)
{
dirtab_entry *tab;
tab = ttf_seek_tab("head", 0);
@@ -1230,7 +1229,7 @@ static void ttf_write_OS2(void)
ttf_set_chksm(tab);
}
-static boolean unsafe_name(char *s)
+static boolean unsafe_name(const char *s)
{
const char **p;
for (p = ambiguous_names; *p != NULL; p++)
@@ -1243,7 +1242,7 @@ static void ttf_write_post(void)
{
dirtab_entry *tab = ttf_seek_tab("post", TTF_FIXED_SIZE);
glyph_entry *glyph;
- char *s;
+ const char *s;
long *id;
int l;
ttf_reset_chksm(tab);