summaryrefslogtreecommitdiff
path: root/Build/source/texk/ptexenc
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-04-15 09:05:21 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-04-15 09:05:21 +0000
commitf9a686d424f912154ffe8b7d5eb235032777a16f (patch)
treed0080bb63d613a4a64dc476c5c58e3ffbe8c241c /Build/source/texk/ptexenc
parent32912d37dba67d5dc461a98e4444d5ea7723d2e3 (diff)
pTeX: avoid compiler warnings
git-svn-id: svn://tug.org/texlive/trunk@17875 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ptexenc')
-rw-r--r--Build/source/texk/ptexenc/ChangeLog.TL12
-rw-r--r--Build/source/texk/ptexenc/ptexenc.c20
-rw-r--r--Build/source/texk/ptexenc/ptexenc.h6
-rw-r--r--Build/source/texk/ptexenc/unicode.c2
4 files changed, 27 insertions, 13 deletions
diff --git a/Build/source/texk/ptexenc/ChangeLog.TL b/Build/source/texk/ptexenc/ChangeLog.TL
index 2f555a9d273..ba856685c8f 100644
--- a/Build/source/texk/ptexenc/ChangeLog.TL
+++ b/Build/source/texk/ptexenc/ChangeLog.TL
@@ -1,6 +1,18 @@
ChangeLog.TL: TeX Live (TL) changes for ptexenc
===============================================
+2010-04-15 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Avoid compiler warnings.
+ * ptexenc.[ch]: Declare ptexenc_version_string, get_enc_string,
+ and set_enc_string's params as const.
+ * ptexenc.c (enc_to_string): Declare return value as const.
+ (string_to_enc): Declare param as const.
+ (in_filter): Declare as const.
+ (getc4, ungetc4): Declare as static.
+ (get_terminal_enc): Declare as static and string var s as const.
+ * unicode.c (UCStoUTF8S): Skip unused function.
+
2010-04-14 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am (rebuild): New target for forced (re-)build.
diff --git a/Build/source/texk/ptexenc/ptexenc.c b/Build/source/texk/ptexenc/ptexenc.c
index 613044341fd..bf8378c0044 100644
--- a/Build/source/texk/ptexenc/ptexenc.c
+++ b/Build/source/texk/ptexenc/ptexenc.c
@@ -31,14 +31,14 @@
# define NOFILE OPEN_MAX
#endif
-char *ptexenc_version_string = "ptetex " PTEXENC_VERSION;
+const char *ptexenc_version_string = "ptetex " PTEXENC_VERSION;
static int file_enc = ENC_UNKNOWN;
static int internal_enc = ENC_UNKNOWN;
static int terminal_enc = ENC_UNKNOWN;
-static string enc_to_string(int enc)
+static const_string enc_to_string(int enc)
{
switch (enc) {
case ENC_JIS: return "jis";
@@ -49,7 +49,7 @@ static string enc_to_string(int enc)
}
}
-static int string_to_enc(string str)
+static int string_to_enc(const_string str)
{
if (str == NULL) return ENC_UNKNOWN;
if (strcasecmp(str, "default")== 0) return DEFAULT_KANJI_ENC;
@@ -99,11 +99,11 @@ static int get_internal_enc(void)
return internal_enc;
}
-int get_terminal_enc(void)
+static int get_terminal_enc(void)
{
if (terminal_enc == ENC_UNKNOWN) {
char lang[16]; /* enough large space */
- char *s = getenv("LC_ALL");
+ const char *s = getenv("LC_ALL");
if (s == NULL) s = getenv("LC_MESSAGES");
if (s == NULL) s = getenv("LANG");
if (s == NULL) s = getenv("LANGUAGE");
@@ -124,7 +124,7 @@ int get_terminal_enc(void)
return terminal_enc;
}
-string get_enc_string(void)
+const_string get_enc_string(void)
{
static char buffer[20]; /* enough large space */
@@ -138,7 +138,7 @@ string get_enc_string(void)
}
}
-boolean set_enc_string(string file_str, string internal_str)
+boolean set_enc_string(const_string file_str, const_string internal_str)
{
int file = string_to_enc(file_str);
int internal = string_to_enc(internal_str);
@@ -344,7 +344,7 @@ static struct unget_st {
int buff[4];
} ungetbuff[NOFILE];
-int getc4(FILE *fp)
+static int getc4(FILE *fp)
{
struct unget_st *p = &ungetbuff[fileno(fp)];
@@ -352,7 +352,7 @@ int getc4(FILE *fp)
return p->buff[--p->size];
}
-int ungetc4(int c, FILE *fp)
+static int ungetc4(int c, FILE *fp)
{
struct unget_st *p = &ungetbuff[fileno(fp)];
@@ -592,7 +592,7 @@ long input_line3(FILE *fp, string buff, long pos, const long buffsize)
}
-static string in_filter = NULL;
+static const_string in_filter = NULL;
static FILE *piped_fp[NOFILE];
static int piped_num = 0;
diff --git a/Build/source/texk/ptexenc/ptexenc.h b/Build/source/texk/ptexenc/ptexenc.h
index b7a6e2c1dcf..32dd464cb70 100644
--- a/Build/source/texk/ptexenc/ptexenc.h
+++ b/Build/source/texk/ptexenc/ptexenc.h
@@ -7,13 +7,13 @@
#include <kpathsea/types.h>
-extern KPSEDLL char *ptexenc_version_string;
+extern KPSEDLL const char *ptexenc_version_string;
#define KANJI_OPTS "{jis|euc|sjis|utf8}"
/* get/set Kanji encoding by string */
-extern KPSEDLL string get_enc_string(void);
-extern KPSEDLL int set_enc_string(string file, string inter);
+extern KPSEDLL const_string get_enc_string(void);
+extern KPSEDLL int set_enc_string(const_string file, const_string inter);
#define getencstring get_enc_string
#define setencstring set_enc_string
diff --git a/Build/source/texk/ptexenc/unicode.c b/Build/source/texk/ptexenc/unicode.c
index 2e723f6cd31..275ebd75d40 100644
--- a/Build/source/texk/ptexenc/unicode.c
+++ b/Build/source/texk/ptexenc/unicode.c
@@ -69,6 +69,7 @@ long UTF8StoUCS(string s)
}
}
+#if 0 /* not used */
int UCStoUTF8S(long ucs, string s)
{
if (ucs < 0x80) {
@@ -92,6 +93,7 @@ int UCStoUTF8S(long ucs, string s)
}
return 0; /* unsupported */
}
+#endif /* 0 */
long UCStoUTF8(long ucs)