summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/web2c/cpascal.h13
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c6
-rw-r--r--Build/source/texk/web2c/tex.ch6
-rw-r--r--Build/source/texk/web2c/web2c/common.defines2
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp2
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeX_ext.c8
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeX_ext.h3
-rw-r--r--Build/source/texk/web2c/xetexdir/appleGlyphNames.c2
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex.ch4
9 files changed, 25 insertions, 21 deletions
diff --git a/Build/source/texk/web2c/cpascal.h b/Build/source/texk/web2c/cpascal.h
index 4ee02aac7fc..9330f0695cb 100644
--- a/Build/source/texk/web2c/cpascal.h
+++ b/Build/source/texk/web2c/cpascal.h
@@ -124,6 +124,7 @@ typedef FILE *text;
/* To work around casting problems. */
#define intcast(x) ((integer) (x))
#define stringcast(x) ((string) (x))
+#define conststringcast(x) ((const_string) (x))
/* For throwing away input from the file F. */
#define vgetc(f) (void) getc (f)
@@ -177,6 +178,8 @@ typedef unsigned char *pointertobyte;
-- var2 lacks the *. */
#define cstring string
+#define constcstring const_string
+
/* Not all C libraries have fabs, so we'll roll our own. */
#undef fabs
#define fabs(x) ((x) >= 0.0 ? (x) : -(x))
@@ -200,11 +203,11 @@ typedef unsigned char *pointertobyte;
/* We use this rather than a simple fputs so that the string will end up
in the .log file, too. */
-#define printcstring(STR) \
- do { \
- char *ch_ptr = (STR); \
- while (*ch_ptr) \
- printchar(*(ch_ptr++)); \
+#define printcstring(STR) \
+ do { \
+ const_string ch_ptr = (STR); \
+ while (*ch_ptr) \
+ printchar(*(ch_ptr++)); \
} while (0)
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 1bb31f9dc05..acc6fddc4fd 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -609,7 +609,7 @@ ipcpage P1C(int, is_eof)
{
static boolean begun = false;
unsigned len = 0;
- string p = "";
+ string p = (string)"";
if (!begun) {
string name; /* Just the filename. */
@@ -970,8 +970,10 @@ parse_options P2C(int, argc, string *, argv)
#ifdef XeTeX
} else if (ARGUMENT_IS ("papersize")) {
+ extern const_string papersize;
papersize = optarg;
} else if (ARGUMENT_IS ("output-driver")) {
+ extern const_string outputdriver;
outputdriver = optarg;
#endif
@@ -1645,7 +1647,7 @@ input_line P1C(FILE *, f)
/* This string specifies what the `e' option does in response to an
error message. */
-static char *edit_value = EDITOR;
+static const_string edit_value = EDITOR;
/* This procedure originally due to sjc@s1-c. TeX & Metafont call it when
the user types `e' in response to an error, invoking a text editor on
diff --git a/Build/source/texk/web2c/tex.ch b/Build/source/texk/web2c/tex.ch
index be8ff7b6e0c..99bf668123b 100644
--- a/Build/source/texk/web2c/tex.ch
+++ b/Build/source/texk/web2c/tex.ch
@@ -549,7 +549,7 @@ We define |input_ln| in C, for efficiency. Nevertheless we quote the module
tini@/
@#
@!bound_default:integer; {temporary for setup}
-@!bound_name:^char; {temporary for setup}
+@!bound_name:const_cstring; {temporary for setup}
@#
@!mem_bot:integer;{smallest index in the |mem| array dumped by \.{INITEX};
must not be less than |mem_min|}
@@ -2319,7 +2319,7 @@ else
@x [29.534] l.10285 - Adjust for C string conventions.
@!months:packed array [1..36] of char; {abbreviations of month names}
@y
-@!months:^char;
+@!months:const_cstring;
@z
@x [29.534] l.10300 - Filename change for the recorder.
@@ -5048,7 +5048,7 @@ if j=18 then
if clobbered then print("clobbered")
else begin {We have the string; run system(3). We don't have anything
reasonable to do with the return status, unfortunately discard it.}
- system(stringcast(address_of(str_pool[str_start[str_ptr]])));
+ system(conststringcast(address_of(str_pool[str_start[str_ptr]])));
print("executed");
end;
end
diff --git a/Build/source/texk/web2c/web2c/common.defines b/Build/source/texk/web2c/web2c/common.defines
index 8184325e48b..86cffa7a2bb 100644
--- a/Build/source/texk/web2c/web2c/common.defines
+++ b/Build/source/texk/web2c/web2c/common.defines
@@ -137,6 +137,7 @@
@define function round ();
@define function strcmp ();
@define function stringcast ();
+@define function conststringcast ();
@define function strlen ();
@define function strtol ();
@define function trunc ();
@@ -191,6 +192,7 @@
@define type boolean = 0..1;
@define type cinttype;
@define type cstring;
+@define type constcstring;
@define type char = 0..255;
@define type getoptstruct;
@define type integer;
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp b/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
index c3dd0d2b695..26936bc9d66 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
+++ b/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
@@ -694,7 +694,7 @@ findGlyphInPostTable(const char* buffer, int tableSize, const char* glyphName)
switch (SWAP(p->format)) {
case 0x00010000:
{
- char* cp;
+ const char* cp;
while ((cp = appleGlyphNames[g]) != 0) {
if (strcmp(glyphName, cp) == 0)
return g;
diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c
index e49cb8abe06..2dfae15fa7f 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c
+++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c
@@ -169,8 +169,8 @@ const UInt32 byteMark = 0x00000080UL;
/* if the user specifies a paper size or output driver program */
-string papersize;
-string outputdriver = "xdvipdfmx -q -E"; /* default to portable xdvipdfmx driver */
+const_string papersize;
+const_string outputdriver = "xdvipdfmx -q -E"; /* default to portable xdvipdfmx driver */
void initversionstring(char **versions)
@@ -181,7 +181,7 @@ void initversionstring(char **versions)
extern FT_Library gFreeTypeLibrary; /* in XeTeXFontInst_FT2 */
FT_Int ftMajor, ftMinor, ftPatch;
- char* fmt =
+ const_string fmt =
"Compiled with ICU version %s [with modifications for XeTeX]\n"
"Compiled with zlib version %s; using %s\n"
"Compiled with FreeType2 version %d.%d.%d; using %d.%d.%d\n"
@@ -348,7 +348,7 @@ static char* byteBuffer = NULL;
return true;
}
-static void die(char*s, int i)
+static void die(const_string s, int i)
{
fprintf(stderr, s, i);
fprintf(stderr, " - exiting\n");
diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.h b/Build/source/texk/web2c/xetexdir/XeTeX_ext.h
index e019569969e..4c7e22fad60 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.h
+++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.h
@@ -188,9 +188,6 @@ typedef struct
} GlyphBBox;
-extern char *outputdriver;
-extern char *papersize;
-
/* For Unicode encoding form interpretation... */
extern const UInt32 offsetsFromUTF8[6];
extern const UInt8 bytesFromUTF8[256];
diff --git a/Build/source/texk/web2c/xetexdir/appleGlyphNames.c b/Build/source/texk/web2c/xetexdir/appleGlyphNames.c
index 21fe6cc6719..a036fb9c393 100644
--- a/Build/source/texk/web2c/xetexdir/appleGlyphNames.c
+++ b/Build/source/texk/web2c/xetexdir/appleGlyphNames.c
@@ -28,7 +28,7 @@ use or other dealings in this Software without prior written
authorization from SIL International.
\****************************************************************************/
-char* appleGlyphNames[] = {
+const char* appleGlyphNames[] = {
".notdef",
".null",
"nonmarkingreturn",
diff --git a/Build/source/texk/web2c/xetexdir/xetex.ch b/Build/source/texk/web2c/xetexdir/xetex.ch
index 559c9b10c60..564887f0ddc 100644
--- a/Build/source/texk/web2c/xetexdir/xetex.ch
+++ b/Build/source/texk/web2c/xetexdir/xetex.ch
@@ -7335,14 +7335,14 @@ token_show(def_ref); print_ln;
@z
@x
- system(stringcast(address_of(str_pool[str_start[str_ptr]])));
+ system(conststringcast(address_of(str_pool[str_start[str_ptr]])));
@y
if name_of_file then libc_free(name_of_file);
name_of_file := xmalloc(cur_length * 3 + 2);
k := 0;
for d:=0 to cur_length-1 do append_to_name(str_pool[str_start_macro(str_ptr)+d]);
name_of_file[k+1] := 0;
- system(name_of_file + 1);
+ system(conststringcast(name_of_file+1));
@z
@x