summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2015-05-04 10:16:49 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2015-05-04 10:16:49 +0000
commitecc04b80c526d2f9827b706bfd5608a757ff2c40 (patch)
treed7426150e1e7d1adfe1d22a206c502e00f6cf72b
parent32759493c1668ec0a8263d8682882a5dc57ba2b0 (diff)
texk/dvipdfm-x: Minor cleanup (avoid compiler warnings)
git-svn-id: svn://tug.org/texlive/trunk@37180 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/dvipdfm-x/ChangeLog9
-rw-r--r--Build/source/texk/dvipdfm-x/cidtype0.c25
2 files changed, 22 insertions, 12 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog
index 7c10bd589e4..0b1231c250a 100644
--- a/Build/source/texk/dvipdfm-x/ChangeLog
+++ b/Build/source/texk/dvipdfm-x/ChangeLog
@@ -1,3 +1,12 @@
+2015-05-04 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * cidtype0.c: Avoid compiler warnings:
+ (CIDFont_type0_get_used_chars, CIDType0Error_Show,
+ CIDFontInfo_init, CIDFontInfo_close, -CIDType0Error,
+ CIDFont_type0_add_CIDSet): Declare as static.
+ (CIDFont_type0_add_CIDSet): Initialize num_glyphs, last_cid.
+ (CIDFont_type0_open): Always initialize sfont, drop unused.
+
2015-05-01 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* cidtype0.c: Support old compilers.
diff --git a/Build/source/texk/dvipdfm-x/cidtype0.c b/Build/source/texk/dvipdfm-x/cidtype0.c
index 8bdcf4d7a29..16c218de837 100644
--- a/Build/source/texk/dvipdfm-x/cidtype0.c
+++ b/Build/source/texk/dvipdfm-x/cidtype0.c
@@ -473,7 +473,8 @@ write_fontfile (CIDFont *font, cff_font *cffont)
return destlen;
}
-char *CIDFont_type0_get_used_chars(CIDFont *font) {
+static char *
+CIDFont_type0_get_used_chars(CIDFont *font) {
int parent_id;
char *used_chars;
@@ -505,7 +506,8 @@ typedef enum {
CID_OPEN_ERROR_IS_CIDFONT = -6,
} CIDType0Error;
-void CIDType0Error_Show (CIDType0Error error, const char *name)
+static void
+CIDType0Error_Show (CIDType0Error error, const char *name)
{
switch (error) {
case CID_OPEN_ERROR_CANNOT_OPEN_FILE:
@@ -525,12 +527,14 @@ void CIDType0Error_Show (CIDType0Error error, const char *name)
}
}
-void CIDFontInfo_init (CIDType0Info *info)
+static void
+CIDFontInfo_init (CIDType0Info *info)
{
memset(info, 0, sizeof(CIDType0Info));
}
-void CIDFontInfo_close (CIDType0Info *info)
+static void
+CIDFontInfo_close (CIDType0Info *info)
{
if (info->cffont)
cff_close(info->cffont);
@@ -544,7 +548,7 @@ void CIDFontInfo_close (CIDType0Info *info)
CIDFontInfo_init(info);
}
-CIDType0Error
+static CIDType0Error
CIDFont_type0_try_open (const char *name,
int index,
int required_cid,
@@ -591,7 +595,7 @@ CIDFont_type0_try_open (const char *name,
return CID_OPEN_ERROR_NO_ERROR;
}
-void
+static void
CIDFont_type0_add_CIDSet(CIDFont *font, char *used_chars, card16 last_cid) {
/*
* CIDSet:
@@ -617,9 +621,9 @@ CIDFont_type0_dofont (CIDFont *font)
long destlen = 0;
long size, offset = 0;
card8 *data;
- card16 num_glyphs, gid;
+ card16 num_glyphs = 0, gid;
long cid;
- card16 cs_count, last_cid;
+ card16 cs_count, last_cid = 0;
int fd, prev_fd;
char *used_chars;
unsigned char *CIDToGIDMap = NULL;
@@ -677,7 +681,6 @@ CIDFont_type0_dofont (CIDFont *font)
CIDToGIDMap = NEW(2 * cid_count, unsigned char);
memset(CIDToGIDMap, 0, 2 * cid_count);
add_to_used_chars2(used_chars, 0); /* .notdef */
- cid = 0; last_cid = 0; num_glyphs = 0;
for (cid = 0; cid <= CID_MAX; cid++) {
if (is_used_char2(used_chars, cid)) {
gid = cff_charsets_lookup(cffont, (card16)cid);
@@ -830,7 +833,7 @@ CIDFont_type0_open (CIDFont *font, const char *name,
{
CIDSysInfo *csi;
char *fontname;
- sfnt *sfont;
+ sfnt *sfont = NULL;
cff_font *cffont;
FILE *fp = NULL;
unsigned long offset = 0;
@@ -894,8 +897,6 @@ CIDFont_type0_open (CIDFont *font, const char *name,
cffont->charsets = NULL;
}
} else {
- char *shortname;
-
if (!fp)
return -1;