summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-04-19 13:44:09 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-04-19 13:44:09 +0000
commit129c1c0ef9266468d65fbcf846132b4329cad994 (patch)
tree0aeb7c371bb33f4fb69501b7715c82b769957896 /Build/source/texk/web2c
parent880a5b0998e88b6c3a3c50b3058f0139bf9b1211 (diff)
Avoid Mac OS X compiler warnings, mainly 'differ in signedness'
git-svn-id: svn://tug.org/texlive/trunk@22123 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/ChangeLog22
-rw-r--r--Build/source/texk/web2c/alephdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/alephdir/com16bit.ch2
-rw-r--r--Build/source/texk/web2c/bibtex.ch4
-rw-r--r--Build/source/texk/web2c/cpascal.h1
-rw-r--r--Build/source/texk/web2c/cwebdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/cwebdir/cweav-w2c.ch52
-rw-r--r--Build/source/texk/web2c/dvicopy.ch4
-rw-r--r--Build/source/texk/web2c/gftodvi.ch4
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog5
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c2
-rw-r--r--Build/source/texk/web2c/mf.ch28
-rw-r--r--Build/source/texk/web2c/omegaware/ChangeLog6
-rw-r--r--Build/source/texk/web2c/omegaware/odvicopy.ch4
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog13
-rw-r--r--Build/source/texk/web2c/ptexdir/pbibtex.ch4
-rw-r--r--Build/source/texk/web2c/ptexdir/ppltotf.ch8
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch30
-rw-r--r--Build/source/texk/web2c/tex.ch30
-rw-r--r--Build/source/texk/web2c/web2c/ChangeLog5
-rw-r--r--Build/source/texk/web2c/web2c/common.defines1
-rw-r--r--Build/source/texk/web2c/xetexdir/ChangeLog6
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex.ch8
23 files changed, 175 insertions, 74 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index cd32a87da6b..4ee8aea1eae 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,25 @@
+2011-04-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Avoid 'differ in signedness' warnings.
+ * cpascal.h: Define ucharcast().
+
+ * bibtex.ch (pds_type): Do not declare as unsigned.
+ (pre_define): Apply ucharcast() to xord[] index.
+
+ * dvicopy.ch (comment): Do not declare as unsigned.
+ (do_pre): Apply ucharcast() to xord[] index.
+
+ * gftodvi.ch (start_gf): Do not declare arg_buffer as unsigned
+ and apply ucharcast() to xord[] index.
+
+ * mf.ch (MF_base_default): Do not declare as unsigned.
+ (pack_buffered_name): Apply ucharcast() to xord[] index.
+ (storebasefile, loadbasefile): cast base_engine to string.
+
+ * tex.ch (TEX_format_default): Do not declare as unsigned.
+ (pack_buffered_name): Apply ucharcast() to xord[] index.
+ (storefmtfile, loadfmtfile): Cast format_engine to string.
+
2011-03-28 Peter Breitenlohner <peb@mppmu.mpg.de>
* configure.ac: LuaTeX needs poppler at least 0.12, no reason
diff --git a/Build/source/texk/web2c/alephdir/ChangeLog b/Build/source/texk/web2c/alephdir/ChangeLog
index 91102817b28..693b013585b 100644
--- a/Build/source/texk/web2c/alephdir/ChangeLog
+++ b/Build/source/texk/web2c/alephdir/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Avoid 'differ in signedness' warnings.
+ * com16bit.ch: Cast runsystem() arg to string.
+
2011-03-28 Peter Breitenlohner <peb@mppmu.mpg.de>
* am/aleph.am: Use AM_CFLAGS instead of aleph_CFLAGS.
diff --git a/Build/source/texk/web2c/alephdir/com16bit.ch b/Build/source/texk/web2c/alephdir/com16bit.ch
index 60486cd66bc..369624148ca 100644
--- a/Build/source/texk/web2c/alephdir/com16bit.ch
+++ b/Build/source/texk/web2c/alephdir/com16bit.ch
@@ -2660,7 +2660,7 @@ if j=18 then
outside_string_array[d]:=xchr[str_pool[str_start(str_ptr)+d]];
end;
outside_string_array[cur_length]:=null_code;
- runsystem_ret := runsystem(outside_string_array);
+ runsystem_ret := runsystem(stringcast(outside_string_array));
if runsystem_ret = -1 then print("quotation error in system command")
else if runsystem_ret = 0 then print("disabled (restricted)")
else if runsystem_ret = 1 then print("executed")
diff --git a/Build/source/texk/web2c/bibtex.ch b/Build/source/texk/web2c/bibtex.ch
index 1832185d6a7..162ffcf252c 100644
--- a/Build/source/texk/web2c/bibtex.ch
+++ b/Build/source/texk/web2c/bibtex.ch
@@ -642,7 +642,7 @@ if (str_num>0) then {it's an already encountered string}
@x [74] Pascal Web's char
@!pds_type = packed array [pds_loc] of char;
@y
-@!pds_type = const_w2c_u_string;
+@!pds_type = const_cstring;
@z
@x [78] C strings start at zero instead of one.
@@ -650,7 +650,7 @@ for i:=1 to len do
buffer[i] := xord[pds[i]];
@y
for i:=1 to len do
- buffer[i] := xord[pds[i-1]];
+ buffer[i] := xord[ucharcast(pds[i-1])];
@z
@x [98] Can't do this tangle-time arithmetic with file_name_size.
diff --git a/Build/source/texk/web2c/cpascal.h b/Build/source/texk/web2c/cpascal.h
index 9064e3ce1ed..ce83bc53be3 100644
--- a/Build/source/texk/web2c/cpascal.h
+++ b/Build/source/texk/web2c/cpascal.h
@@ -122,6 +122,7 @@ typedef FILE *text;
FATAL1 ("putbyte(%ld) failed", (long) x); } while (0)
/* To work around casting problems. */
+#define ucharcast(x) ((unsigned char) (x))
#define intcast(x) ((integer) (x))
#define stringcast(x) ((string) (x))
#define conststringcast(x) ((const_string) (x))
diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog
index 74ba38427b7..0848bfed769 100644
--- a/Build/source/texk/web2c/cwebdir/ChangeLog
+++ b/Build/source/texk/web2c/cwebdir/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Avoid 'differ in signedness' warnings.
+ * cweav-w2c.ch: cast strcpy() arg collate to 'char *'.
+
2010-01-18 Peter Breitenlohner <peb@mppmu.mpg.de>
* {comm,ctang,cweav}-w2c.ch: Move extern declaration of
diff --git a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
index c41711237e0..723daaf585e 100644
--- a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
@@ -891,6 +891,58 @@ static void
phase_three (void) {
@z
+Section 235.
+
+@x
+strcpy(collate+1," \1\2\3\4\5\6\7\10\11\12\13\14\15\16\17");
+/* 16 characters + 1 = 17 */
+strcpy(collate+17,"\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37");
+/* 16 characters + 17 = 33 */
+strcpy(collate+33,"!\42#$%&'()*+,-./:;<=>?@@[\\]^`{|}~_");
+/* 32 characters + 33 = 65 */
+strcpy(collate+65,"abcdefghijklmnopqrstuvwxyz0123456789");
+/* (26 + 10) characters + 65 = 101 */
+strcpy(collate+101,"\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217");
+/* 16 characters + 101 = 117 */
+strcpy(collate+117,"\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237");
+/* 16 characters + 117 = 133 */
+strcpy(collate+133,"\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257");
+/* 16 characters + 133 = 149 */
+strcpy(collate+149,"\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277");
+/* 16 characters + 149 = 165 */
+strcpy(collate+165,"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317");
+/* 16 characters + 165 = 181 */
+strcpy(collate+181,"\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337");
+/* 16 characters + 181 = 197 */
+strcpy(collate+197,"\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357");
+/* 16 characters + 197 = 213 */
+strcpy(collate+213,"\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377");
+@y
+strcpy((char *)collate+1," \1\2\3\4\5\6\7\10\11\12\13\14\15\16\17");
+/* 16 characters + 1 = 17 */
+strcpy((char *)collate+17,"\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37");
+/* 16 characters + 17 = 33 */
+strcpy((char *)collate+33,"!\42#$%&'()*+,-./:;<=>?@@[\\]^`{|}~_");
+/* 32 characters + 33 = 65 */
+strcpy((char *)collate+65,"abcdefghijklmnopqrstuvwxyz0123456789");
+/* (26 + 10) characters + 65 = 101 */
+strcpy((char *)collate+101,"\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217");
+/* 16 characters + 101 = 117 */
+strcpy((char *)collate+117,"\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237");
+/* 16 characters + 117 = 133 */
+strcpy((char *)collate+133,"\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257");
+/* 16 characters + 133 = 149 */
+strcpy((char *)collate+149,"\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277");
+/* 16 characters + 149 = 165 */
+strcpy((char *)collate+165,"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317");
+/* 16 characters + 165 = 181 */
+strcpy((char *)collate+181,"\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337");
+/* 16 characters + 181 = 197 */
+strcpy((char *)collate+197,"\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357");
+/* 16 characters + 197 = 213 */
+strcpy((char *)collate+213,"\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377");
+@z
+
Section 237.
@x l.4474
diff --git a/Build/source/texk/web2c/dvicopy.ch b/Build/source/texk/web2c/dvicopy.ch
index 5060d215ebe..81f51d9d18a 100644
--- a/Build/source/texk/web2c/dvicopy.ch
+++ b/Build/source/texk/web2c/dvicopy.ch
@@ -508,13 +508,13 @@ rewrite(out_file); {prepares to write packed bytes to |out_file|}
@x [250] String declaration.
@!comment:packed array[1..comm_length] of char; {preamble comment prefix}
@y
-@!comment:const_w2c_u_string; {preamble comment prefix}
+@!comment:const_c_string; {preamble comment prefix}
@z
@x [251] Output the string from 0 to len-1, not 1 to len.
for k:=1 to comm_length do append_byte(xord[comment[k]]);
@y
-for k:=0 to comm_length - 1 do append_byte(xord[comment[k]]);
+for k:=0 to comm_length - 1 do append_byte(xord[ucharcast(comment[k])]);
@z
@x [] System-dependent changes.
diff --git a/Build/source/texk/web2c/gftodvi.ch b/Build/source/texk/web2c/gftodvi.ch
index 623350021f0..01f689a02c8 100644
--- a/Build/source/texk/web2c/gftodvi.ch
+++ b/Build/source/texk/web2c/gftodvi.ch
@@ -435,14 +435,14 @@ some input is present; then it opens the output file.
@p procedure start_gf;
label done;
-var arg_buffer: w2c_u_string;
+var arg_buffer: c_string;
arg_buf_ptr: integer;
begin
arg_buffer := cmdline (optind);
arg_buf_ptr := 0;
while (line_length < terminal_line_length)
and (arg_buffer[arg_buf_ptr] <> 0) do begin
- buffer[line_length] := xord[arg_buffer[arg_buf_ptr]];
+ buffer[line_length] := xord[ucharcast(arg_buffer[arg_buf_ptr])];
incr(line_length);
incr(arg_buf_ptr);
end;
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index b9ec0871440..c7bcc4ec459 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Avoid 'differ in signedness' warnings.
+ texmfmp.c (input_line): Caat input_line2() arg2 to 'char *'.
+
2011-03-07 Peter Breitenlohner <peb@mppmu.mpg.de>
* setupvar.c (setupboundvariable): `program_invocation_name' has
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index de5ec885faa..c35cda389ce 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -1924,7 +1924,7 @@ input_line (FILE *f)
/* Recognize either LF or CR as a line terminator. */
#if defined(pTeX) || defined(epTeX)
- last = input_line2(f, buffer, first, bufsize, &i);
+ last = input_line2(f, (char *)buffer, first, bufsize, &i);
#else /* pTeX || epTeX */
last = first;
while (last < bufsize && (i = getc (f)) != EOF && i != '\n' && i != '\r')
diff --git a/Build/source/texk/web2c/mf.ch b/Build/source/texk/web2c/mf.ch
index b9fe0dfffaf..e82053a1b41 100644
--- a/Build/source/texk/web2c/mf.ch
+++ b/Build/source/texk/web2c/mf.ch
@@ -1601,7 +1601,7 @@ name_of_file[name_length + 1] := 0;
MF_base_default:='MFbases:plain.base';
@y
@!base_default_length: integer;
-@!MF_base_default: w2c_u_string;
+@!MF_base_default: cstring;
@ We set the name of the default format file and the length of that name
in \.{texmfmp.c}, since we want them to depend on the name of the
@@ -1610,21 +1610,19 @@ program.
@x [38.778] Change to pack_buffered_name as with pack_file_name.
for j:=1 to n do append_to_name(xord[MF_base_default[j]]);
+for j:=a to b do append_to_name(buffer[j]);
+for j:=base_default_length-base_ext_length+1 to base_default_length do
+ append_to_name(xord[MF_base_default[j]]);
+if k<=file_name_size then name_length:=k@+else name_length:=file_name_size;
+for k:=name_length+1 to file_name_size do name_of_file[k]:=' ';
@y
if name_of_file then libc_free (name_of_file);
name_of_file := xmalloc_array (ASCII_code, n + (b-a+1) + base_ext_length + 1);
-for j:=1 to n do append_to_name(xord[MF_base_default[j]]);
-@z
-% @x [38.778] Set program name to match format.
-% for j:=a to b do append_to_name(buffer[j]);
-% @y
-% for j:=a to b do append_to_name(buffer[j]);
-% name_of_file[k+1]:=0;
-% kpse_reset_program_name(name_of_file+1);
-% @z
-@x [38.778] Change to pack_buffered_name as with pack_file_name.
-for k:=name_length+1 to file_name_size do name_of_file[k]:=' ';
-@y
+for j:=1 to n do append_to_name(xord[ucharcast(MF_base_default[j])]);
+for j:=a to b do append_to_name(buffer[j]);
+for j:=base_default_length-base_ext_length+1 to base_default_length do
+ append_to_name(xord[ucharcast(MF_base_default[j])]);
+if k<=file_name_size then name_length:=k@+else name_length:=file_name_size;
name_of_file[name_length + 1] := 0;
@z
@@ -2021,7 +2019,7 @@ dump_int(@"57324D46); {Web2C \MF's magic constant: "W2MF"}
{Align engine to 4 bytes with one or more trailing NUL}
x:=strlen(engine_name);
base_engine:=xmalloc_array(text_char,x+4);
-strcpy(base_engine, engine_name);
+strcpy(stringcast(base_engine), engine_name);
for k:=x to x+3 do base_engine[k]:=0;
x:=x+4-(x mod 4);
dump_int(x);dump_things(base_engine[0], x);
@@ -2045,7 +2043,7 @@ if (x<0) or (x>256) then goto off_base; {corrupted base file}
base_engine:=xmalloc_array(text_char, x);
undump_things(base_engine[0], x);
base_engine[x-1]:=0; {force string termination, just in case}
-if strcmp(engine_name, base_engine) then
+if strcmp(engine_name, stringcast(base_engine)) then
begin wake_up_terminal;
wterm_ln('---! ', stringcast(name_of_file+1), ' was written by ', base_engine);
libc_free(base_engine);
diff --git a/Build/source/texk/web2c/omegaware/ChangeLog b/Build/source/texk/web2c/omegaware/ChangeLog
index bc60822e75f..324ffe226e3 100644
--- a/Build/source/texk/web2c/omegaware/ChangeLog
+++ b/Build/source/texk/web2c/omegaware/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Avoid 'differ in signedness' warnings.
+ * odvicopy.ch (comment): Do not declare as unsigned.
+ (do_pre): Apply ucharcast() to xord[] index.
+
2010-04-22 Peter Breitenlohner <peb@mppmu.mpg.de>
* opl2ofm.ch, ovp2ovf.ch: Bug fix, from ../ptexdir/ppltotf.ch by
diff --git a/Build/source/texk/web2c/omegaware/odvicopy.ch b/Build/source/texk/web2c/omegaware/odvicopy.ch
index 2aee5338492..57f73b00071 100644
--- a/Build/source/texk/web2c/omegaware/odvicopy.ch
+++ b/Build/source/texk/web2c/omegaware/odvicopy.ch
@@ -584,13 +584,13 @@ rewrite(out_file); {prepares to write packed bytes to |out_file|}
@x [250] String declaration.
@!comment:packed array[1..comm_length] of char; {preamble comment prefix}
@y
-@!comment:const_w2c_u_string; {preamble comment prefix}
+@!comment:const_c_string; {preamble comment prefix}
@z
@x [251] Output the string from 0 to len-1, not 1 to len.
for k:=1 to comm_length do append_byte(xord[comment[k]]);
@y
-for k:=0 to comm_length - 1 do append_byte(xord[comment[k]]);
+for k:=0 to comm_length - 1 do append_byte(xord[ucharcast(comment[k])]);
@z
@x [] System-dependent changes.
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index 5dd7bb4cefb..7c7790a62e8 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,16 @@
+2011-04-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Avoid 'differ in signedness' warnings.
+ * ptex-base.ch: Cast buffer and str_pool to string when used as
+ arg of multistrlen() or fromBUFF().
+ (pack_buffered_name): Drop change already done in ../tex.ch.
+
+ * pbibtex.ch: Cast buffer to string when used as a arg of
+ input_line2().
+
+ * ppltotf.ch: Cast buffer to string when used as a arg of
+ input_line2() or multistrlen().
+
2011-04-15 Peter Breitenlohner <peb@mppmu.mpg.de>
* ptex-base.ch: Add \ifdbox and \ifddir,
diff --git a/Build/source/texk/web2c/ptexdir/pbibtex.ch b/Build/source/texk/web2c/ptexdir/pbibtex.ch
index 3475e14a365..ee2cd84682f 100644
--- a/Build/source/texk/web2c/ptexdir/pbibtex.ch
+++ b/Build/source/texk/web2c/ptexdir/pbibtex.ch
@@ -203,11 +203,11 @@ var i:c_int_type;
end;
vgetc (f); {skip the eol}
@y
- last := input_line2(f,buffer,last,buf_size,address_of(i));
+ last := input_line2(f,stringcast(buffer),last,buf_size,address_of(i));
while (not eof(f)) and (last > 0) and (i <> 10) and (i <> 13) do
begin
buffer_overflow;
- last := input_line2(f,buffer,last,buf_size,address_of(i));
+ last := input_line2(f,stringcast(buffer),last,buf_size,address_of(i));
end;
@z
diff --git a/Build/source/texk/web2c/ptexdir/ppltotf.ch b/Build/source/texk/web2c/ptexdir/ppltotf.ch
index f050a64d9db..bdba99662ba 100644
--- a/Build/source/texk/web2c/ptexdir/ppltotf.ch
+++ b/Build/source/texk/web2c/ptexdir/ppltotf.ch
@@ -60,7 +60,7 @@ else begin while (limit<buf_size-2)and(not eoln(pl_file)) do
begin incr(limit); read(pl_file,buffer[limit]);
end;
@y
-else begin limit:=input_line2(pl_file,buffer,limit+1,buf_size-1)-1;
+else begin limit:=input_line2(pl_file,stringcast(buffer),limit+1,buf_size-1)-1;
@z
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -647,7 +647,7 @@ The |jis_to_index| is called from |chars_in_type| command.
function get_next_raw:byte; {get next rawdata in buffer}
begin while loc=limit do fill_buffer;
incr(loc); get_next_raw:=buffer[loc];
-if multistrlen(buffer,loc+2,loc)=2 then cur_char:=" "
+if multistrlen(stringcast(buffer),loc+2,loc)=2 then cur_char:=" "
else cur_char:=xord[buffer[loc]];
end;
@#
@@ -718,8 +718,8 @@ else if (ch='J')or(ch='j') then
if not valid_jis_code(jis_code) then
err_print('jis code ', jis_code:1, ' is invalid');
end
-else if multistrlen(buffer, loc+2, loc)=2 then
- begin jis_code:=toDVI(fromBUFF(buffer, loc+2, loc));
+else if multistrlen(stringcast(buffer), loc+2, loc)=2 then
+ begin jis_code:=toDVI(fromBUFF(stringcast(buffer), loc+2, loc));
incr(loc); cur_char:=" ";
if not valid_jis_code(jis_code) then
err_print('jis code ', jis_code:1, ' is invalid');
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index ca0028a7cd8..acbcf143a81 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -1546,8 +1546,8 @@ begin switch: if loc<=limit then {current line not yet finished}
@^inner loop@>
begin switch: if loc<=limit then {current line not yet finished}
begin cur_chr:=buffer[loc]; incr(loc);
- if multistrlen(buffer, limit+1, loc-1)=2 then
- begin cur_chr:=fromBUFF(buffer, limit+1, loc-1);
+ if multistrlen(stringcast(buffer), limit+1, loc-1)=2 then
+ begin cur_chr:=fromBUFF(stringcast(buffer), limit+1, loc-1);
cur_cmd:=kcat_code(kcatcodekey(cur_chr));
incr(loc);
end
@@ -1636,8 +1636,8 @@ end
@<Scan a control...@>=
begin if loc>limit then cur_cs:=null_cs {|state| is irrelevant in this case}
else begin k:=loc; cur_chr:=buffer[k]; incr(k);
- if multistrlen(buffer, limit+1, k-1)=2 then
- begin cat:=kcat_code(kcatcodekey(fromBUFF(buffer, limit+1, k-1))); incr(k);
+ if multistrlen(stringcast(buffer), limit+1, k-1)=2 then
+ begin cat:=kcat_code(kcatcodekey(fromBUFF(stringcast(buffer), limit+1, k-1))); incr(k);
end
else cat:=cat_code(cur_chr);
start_cs:
@@ -1720,8 +1720,8 @@ end
@y
@ @<Scan ahead in the buffer...@>=
begin repeat cur_chr:=buffer[k]; incr(k);
- if multistrlen(buffer, limit+1, k-1)=2 then
- begin cat:=kcat_code(kcatcodekey(fromBUFF(buffer, limit+1, k-1))); incr(k);
+ if multistrlen(stringcast(buffer), limit+1, k-1)=2 then
+ begin cat:=kcat_code(kcatcodekey(fromBUFF(stringcast(buffer), limit+1, k-1))); incr(k);
end
else cat:=cat_code(cur_chr);
while (buffer[k]=cur_chr)and(cat=sup_mark)and(k<limit) do
@@ -2154,8 +2154,8 @@ else if scan_keyword("sp") then goto done
if t=" " then t:=space_token
else t:=other_token+t;
@y
- if multistrlen(str_pool, pool_ptr, k)=2 then
- begin t:=fromBUFF(str_pool, pool_ptr, k); incr(k);
+ if multistrlen(stringcast(str_pool), pool_ptr, k)=2 then
+ begin t:=fromBUFF(stringcast(str_pool), pool_ptr, k); incr(k);
end
else if t=" " then t:=space_token
else t:=other_token+t;
@@ -2369,20 +2369,6 @@ else if (cur_cmd>active_char)or(cur_chr>255) then
end;
@z
-@x [29.523] l.10571 - pTeX: xord
-for j:=1 to n do append_to_name(xord[TEX_format_default[j]]);
-for j:=a to b do append_to_name(buffer[j]);
-for j:=format_default_length-format_ext_length+1 to format_default_length do
- append_to_name(xord[TEX_format_default[j]]);
-@y
-if name_of_file then libc_free (name_of_file);
-name_of_file := xmalloc (1 + n + (b - a + 1) + format_ext_length + 1);
-for j:=1 to n do append_to_name(xord[TEX_format_default[j]]);
-for j:=a to b do append_to_name(buffer[j]);
-for j:=format_default_length-format_ext_length+1 to format_default_length do
- append_to_name(xord[TEX_format_default[j]]);
-@z
-
@x [29.526] l.10668 - pTeX: scan file name
loop@+begin if (cur_cmd>other_char)or(cur_chr>255) then {not a character}
begin back_input; goto done;
diff --git a/Build/source/texk/web2c/tex.ch b/Build/source/texk/web2c/tex.ch
index 3b2a86348b9..861d89818a6 100644
--- a/Build/source/texk/web2c/tex.ch
+++ b/Build/source/texk/web2c/tex.ch
@@ -1828,7 +1828,7 @@ length will be set in the main program.
TEX_format_default:='TeXformats:plain.fmt';
@y
@!format_default_length: integer;
-@!TEX_format_default: w2c_u_string;
+@!TEX_format_default: cstring;
@ We set the name of the default format file and the length of that name
in C, instead of Pascal, since we want them to depend on the name of the
@@ -1837,23 +1837,19 @@ program.
@x [29.523] l.10095 - Change to pack_buffered_name as with pack_file_name.
for j:=1 to n do append_to_name(xord[TEX_format_default[j]]);
+for j:=a to b do append_to_name(buffer[j]);
+for j:=format_default_length-format_ext_length+1 to format_default_length do
+ append_to_name(xord[TEX_format_default[j]]);
+if k<=file_name_size then name_length:=k@+else name_length:=file_name_size;
+for k:=name_length+1 to file_name_size do name_of_file[k]:=' ';
@y
if name_of_file then libc_free (name_of_file);
name_of_file := xmalloc_array (ASCII_code, n+(b-a+1)+format_ext_length+1);
-for j:=1 to n do append_to_name(xord[TEX_format_default[j]]);
-@z
-
-% @x [29.523] l.10097 - Set program name to match format.
-% for j:=a to b do append_to_name(buffer[j]);
-% @y
-% for j:=a to b do append_to_name(buffer[j]);
-% name_of_file[k+1]:=0;
-% kpse_reset_program_name(name_of_file+1);
-% @z
-
-@x [29.523] l.10100 - Change to pack_buffered_name as with pack_file_name.
-for k:=name_length+1 to file_name_size do name_of_file[k]:=' ';
-@y
+for j:=1 to n do append_to_name(xord[ucharcast(TEX_format_default[j])]);
+for j:=a to b do append_to_name(buffer[j]);
+for j:=format_default_length-format_ext_length+1 to format_default_length do
+ append_to_name(xord[ucharcast(TEX_format_default[j])]);
+if k<=file_name_size then name_length:=k@+else name_length:=file_name_size;
name_of_file[name_length+1]:=0;
@z
@@ -3481,7 +3477,7 @@ dump_int(@"57325458); {Web2C \TeX's magic constant: "W2TX"}
{Align engine to 4 bytes with one or more trailing NUL}
x:=strlen(engine_name);
format_engine:=xmalloc_array(text_char,x+4);
-strcpy(format_engine, engine_name);
+strcpy(stringcast(format_engine), engine_name);
for k:=x to x+3 do format_engine[k]:=0;
x:=x+4-(x mod 4);
dump_int(x);dump_things(format_engine[0], x);
@@ -3516,7 +3512,7 @@ if (x<0) or (x>256) then goto bad_fmt; {corrupted format file}
format_engine:=xmalloc_array(text_char, x);
undump_things(format_engine[0], x);
format_engine[x-1]:=0; {force string termination, just in case}
-if strcmp(engine_name, format_engine) then
+if strcmp(engine_name, stringcast(format_engine)) then
begin wake_up_terminal;
wterm_ln('---! ', stringcast(name_of_file+1), ' was written by ', format_engine);
libc_free(format_engine);
diff --git a/Build/source/texk/web2c/web2c/ChangeLog b/Build/source/texk/web2c/web2c/ChangeLog
index 2e345297193..60b83732544 100644
--- a/Build/source/texk/web2c/web2c/ChangeLog
+++ b/Build/source/texk/web2c/web2c/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-18 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Avoid 'differ in signedness' warnings.
+ * common.defines: Define ucharcast().
+
2011-01-11 Peter Breitenlohner <peb@mppmu.mpg.de>
* convert, splitup.c: Add e-pTeX.
diff --git a/Build/source/texk/web2c/web2c/common.defines b/Build/source/texk/web2c/web2c/common.defines
index b6eab2398d0..453d6cce7aa 100644
--- a/Build/source/texk/web2c/web2c/common.defines
+++ b/Build/source/texk/web2c/web2c/common.defines
@@ -144,6 +144,7 @@
@define function strlen ();
@define function strtol ();
@define function trunc ();
+@define function ucharcast ();
@define function xcalloc ();
@define function xcallocarray ();
@define function xftell ();
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog
index dd03a2887df..24bb3d9c8bb 100644
--- a/Build/source/texk/web2c/xetexdir/ChangeLog
+++ b/Build/source/texk/web2c/xetexdir/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Avoid 'differ in signedness' warnings.
+ * xetex.ch (pack_buffered_name): Adapt to modified ../tex.ch.
+ (read_font_info): Cast print_c_string() arg to string.
+
2011-04-11 Karl Berry <karl@tug.org>
* xetex.ch (XeTeX_version_string): bump to .5.
diff --git a/Build/source/texk/web2c/xetexdir/xetex.ch b/Build/source/texk/web2c/xetexdir/xetex.ch
index 83d0f13a79e..0139d24e8bb 100644
--- a/Build/source/texk/web2c/xetexdir/xetex.ch
+++ b/Build/source/texk/web2c/xetexdir/xetex.ch
@@ -3201,14 +3201,14 @@ for j:=str_start_macro(e) to str_start_macro(e+1)-1 do append_to_name(so(str_poo
@x
name_of_file := xmalloc_array (ASCII_code, n+(b-a+1)+format_ext_length+1);
-for j:=1 to n do append_to_name(xord[TEX_format_default[j]]);
+for j:=1 to n do append_to_name(xord[ucharcast(TEX_format_default[j])]);
@y
name_of_file := xmalloc_array (UTF8_code, n+(b-a+1)+format_ext_length+1);
for j:=1 to n do append_to_name(TEX_format_default[j]);
@z
@x
- append_to_name(xord[TEX_format_default[j]]);
+ append_to_name(xord[ucharcast(TEX_format_default[j])]);
@y
append_to_name(TEX_format_default[j]);
@z
@@ -3428,7 +3428,7 @@ pack_file_name(nom,aire,cur_ext);
if XeTeX_tracing_fonts_state>0 then begin
begin_diagnostic;
print_nl("Requested font """);
- print_c_string(name_of_file+1);
+ print_c_string(stringcast(name_of_file+1));
print('"');
if s < 0 then begin
print(" scaled ");
@@ -3477,7 +3477,7 @@ if XeTeX_tracing_fonts_state>0 then begin
end else if file_opened then begin
begin_diagnostic;
print_nl(" -> ");
- print_c_string(name_of_file+1);
+ print_c_string(stringcast(name_of_file+1));
end_diagnostic(false);
end;
end;