diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-01-22 12:20:35 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-01-22 12:20:35 +0000 |
commit | 68267fad21f7506f4613a9f7308e3a7c46d8f8e6 (patch) | |
tree | ba6c54bce6ce66285dd776bd8db92b350517d027 /Build/source | |
parent | 249b1077f09eb70b8d06368e5fde89062bd82050 (diff) |
constify various filename strings
git-svn-id: svn://tug.org/texlive/trunk@16799 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
26 files changed, 69 insertions, 32 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 8493dc1299e..e4a4cf5c80c 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,8 @@ +2010-01-22 Peter Breitenlohner <peb@mppmu.mpg.de> + + * tex-make.c (maketex): Replace kpse_readable_file(fn) by + kpathsea_readable_file(kpse,fn) also for WIN32. + 2010-01-11 Taco Hoekwater <taco@metapost.org> * types.h (kpse_clua_format): new type. diff --git a/Build/source/texk/kpathsea/tex-make.c b/Build/source/texk/kpathsea/tex-make.c index 5ccfd8193e2..5a0fbf2814e 100644 --- a/Build/source/texk/kpathsea/tex-make.c +++ b/Build/source/texk/kpathsea/tex-make.c @@ -1,6 +1,6 @@ /* tex-make.c: run external programs to make TeX-related files. - Copyright 1993, 1994, 1995, 1996, 1997, 2008, 2009 Karl Berry. + Copyright 1993, 1994, 1995, 1996, 1997, 2008, 2009, 2010 Karl Berry. Copyright 1997, 1998, 2001-05 Olaf Weber. This library is free software; you can redistribute it and/or @@ -323,7 +323,7 @@ maketex (kpathsea kpse, kpse_file_format_type format, string* args) len--; } - ret = len == 0 ? NULL : kpse_readable_file (fn); + ret = len == 0 ? NULL : kpathsea_readable_file (kpse, fn); if (!ret && len > 1) { WARNING2 ("kpathsea: %s output `%s' instead of a filename", new_cmd, fn); diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog index f348691e4c8..c2fefdd938d 100644 --- a/Build/source/texk/web2c/ChangeLog +++ b/Build/source/texk/web2c/ChangeLog @@ -1,3 +1,14 @@ +2010-01-22 Peter Breitenlohner <peb@mppmu.mpg.de> + + * dvitype.ch (open_dvi_file): Skip use of cur_name. + (parse_arguments): Rearrange out_mode to avoid compiler warning. + * mft.ch (change_name, tex_name), pltotf.ch (tfm_name, pl_name), + pooltype.ch (pool_name), tftopl.ch (tfm_name, pl_name), + tangle.ch (web_name, chg_name, pascal_name, pool_name), + vftovp.ch (vf_name, vpl_name), vptovf.ch (vpl_name, tfm_name, + vf_name), weave.ch (web_name, chg_name, tex_name): Declare as + const_c_string. + 2009-12-07 Peter Breitenlohner <peb@mppmu.mpg.de> * am/web.am (EXTRA_DIST, TESTS, bibtex_tests, web_tests): diff --git a/Build/source/texk/web2c/dvitype.ch b/Build/source/texk/web2c/dvitype.ch index 1854d8919ec..44c48a05c39 100644 --- a/Build/source/texk/web2c/dvitype.ch +++ b/Build/source/texk/web2c/dvitype.ch @@ -114,8 +114,7 @@ end; @y @p procedure open_dvi_file; {prepares to read packed bytes in |dvi_file|} begin - cur_name := extend_filename (cmdline (optind), 'dvi'); - resetbin (dvi_file, cur_name); + resetbin (dvi_file, extend_filename (cmdline (optind), 'dvi')); cur_loc := 0; end; @# @@ -547,11 +546,11 @@ begin print_version_and_exit (banner, nil, 'D.E. Knuth', nil); end else if argument_is ('output-level') then begin - out_mode := optarg[0] - '0'; - if (out_mode < 0) or (out_mode > 4) or (optarg[1] <> 0) then begin + if (optarg[0] < '0') or (optarg[0] > '4') or (optarg[1] <> 0) then begin write_ln (stderr, 'Value for --output-level must be >= 0 and <= 4.'); uexit (1); end; + out_mode := optarg[0] - '0'; end else if argument_is ('page-start') then begin @<Determine the desired |start_count| values from |optarg|@>; diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index a408bed233d..2f666b8039c 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,11 @@ +2010-01-22 Peter Breitenlohner <peb@mppmu.mpg.de> + + * luatangle.ch: Declare web_name, chg_name, pascal_name, and + pool_name as const_c_string. + + * lua/lkpselib.c (readable_file, lua_kpathsea_readable_file): + Drop non-const cast of {kpse,kpathsea}_readable_file() result. + 2010-01-03 Karl Berry <karl@tug.org> * luatex.ch: propagate "executed safely" wording change. diff --git a/Build/source/texk/web2c/luatexdir/lua/lkpselib.c b/Build/source/texk/web2c/luatexdir/lua/lkpselib.c index d314a8c565f..437f118942b 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lkpselib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lkpselib.c @@ -379,7 +379,7 @@ static int readable_file(lua_State * L) { const char *name = luaL_checkstring(L, 1); TEST_PROGRAM_NAME_SET; - lua_pushstring(L, (char *) kpse_readable_file(name)); + lua_pushstring(L, kpse_readable_file(name)); return 1; } @@ -387,7 +387,7 @@ static int lua_kpathsea_readable_file(lua_State * L) { kpathsea *kp = (kpathsea *) luaL_checkudata(L, 1, KPATHSEA_METATABLE); const char *name = luaL_checkstring(L, 2); - lua_pushstring(L, (char *) kpathsea_readable_file(*kp, name)); + lua_pushstring(L, kpathsea_readable_file(*kp, name)); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/luatangle.ch b/Build/source/texk/web2c/luatexdir/luatangle.ch index 809af366a69..4e1ab58208e 100644 --- a/Build/source/texk/web2c/luatexdir/luatangle.ch +++ b/Build/source/texk/web2c/luatexdir/luatangle.ch @@ -503,6 +503,6 @@ long_options[current_option].val := 0; @ Global filenames. @<Globals...@>= -@!web_name,@!chg_name,@!pascal_name,@!pool_name:c_string; +@!web_name,@!chg_name,@!pascal_name,@!pool_name:const_c_string; @!@!allow_underlines:boolean; @z diff --git a/Build/source/texk/web2c/mft.ch b/Build/source/texk/web2c/mft.ch index 048e9c462ff..1567672dc3a 100644 --- a/Build/source/texk/web2c/mft.ch +++ b/Build/source/texk/web2c/mft.ch @@ -1052,7 +1052,7 @@ files, as UNIX knows them. @d max_style_name = 32 @<Globals...@>= -@!change_name,@!tex_name:c_string; +@!change_name,@!tex_name:const_c_string; @!style_name:array[0..max_style_name-1] of const_c_string; @!n_style_name:c_int_type; {Number of values in |style_name| array.} @!i_style_name:c_int_type; {The next |style_name|.} diff --git a/Build/source/texk/web2c/omegafonts/ChangeLog b/Build/source/texk/web2c/omegafonts/ChangeLog index a653b2aeca1..623d6cb2d06 100644 --- a/Build/source/texk/web2c/omegafonts/ChangeLog +++ b/Build/source/texk/web2c/omegafonts/ChangeLog @@ -1,3 +1,8 @@ +2010-01-22 Peter Breitenlohner <peb@mppmu.mpg.de> + + * omfonts.[ch] (read_in_whole, name_ofm, name_opl, name_ovp, + name_ovf, files): Declare file names as const_string. + 2010-01-12 Peter Breitenlohner <peb@mppmu.mpg.de> * char_routines.c (compute_ofm_character_info): Fix CHARREPEAT. diff --git a/Build/source/texk/web2c/omegafonts/omfonts.c b/Build/source/texk/web2c/omegafonts/omfonts.c index d2a9d8b0288..5a6ec0a6c4e 100644 --- a/Build/source/texk/web2c/omegafonts/omfonts.c +++ b/Build/source/texk/web2c/omegafonts/omfonts.c @@ -56,10 +56,10 @@ int text_format = TEXT_CODE_MIXED; int program; -string name_ofm = NULL; -string name_opl = NULL; -string name_ovp = NULL; -string name_ovf = NULL; +const_string name_ofm = NULL; +const_string name_opl = NULL; +const_string name_ovp = NULL; +const_string name_ovf = NULL; FILE *file_ofm = NULL; FILE *file_opl = NULL; @@ -98,7 +98,7 @@ static const_string names_msg[PROG_NUM] = { }; int no_files=0; -string *files[3] = {NULL, NULL, NULL}; +const_string *files[3] = {NULL, NULL, NULL}; const_string suffixes[3] = {NULL, NULL, NULL}; const_string full_suffixes[3] = {NULL, NULL, NULL}; @@ -321,7 +321,7 @@ void read_in_whole(unsigned char **contents_loc, unsigned *length_loc, FILE *file, - string name) + const_string name) { unsigned no_read; unsigned no_total_read = 0; diff --git a/Build/source/texk/web2c/omegafonts/omfonts.h b/Build/source/texk/web2c/omegafonts/omfonts.h index 79516146e60..006915e3aaa 100644 --- a/Build/source/texk/web2c/omegafonts/omfonts.h +++ b/Build/source/texk/web2c/omegafonts/omfonts.h @@ -43,7 +43,7 @@ extern unsigned char *ofm; extern unsigned char *ovf; extern int main(int, string *); -extern void read_in_whole(unsigned char **, unsigned *, FILE *, string ); +extern void read_in_whole(unsigned char **, unsigned *, FILE *, const_string ); extern void init_tables(void); extern void output_ovf_file(void); extern void output_text_file(FILE *); diff --git a/Build/source/texk/web2c/omegaware/ChangeLog b/Build/source/texk/web2c/omegaware/ChangeLog index 9bfbae39443..63e7397f820 100644 --- a/Build/source/texk/web2c/omegaware/ChangeLog +++ b/Build/source/texk/web2c/omegaware/ChangeLog @@ -1,3 +1,11 @@ +2010-01-22 Peter Breitenlohner <peb@mppmu.mpg.de> + + * odvitype.ch (open_dvi_file): Skip use of cur_name. + * ofm2opl.ch (tfm_name, pl_name), opl2ofm.ch (tfm_name, pl_name), + otangle.ch (web_name, chg_name, pascal_name, pool_name), + ovf2ovp.ch (vf_name, vpl_name), ovp2ovf.ch (vpl_name, tfm_name, + vf_name): Declare as const_c_string. + 2010-01-05 Peter Breitenlohner <peb@mppmu.mpg.de> * repeat.test (new): Shell script to test repeat_char handling. diff --git a/Build/source/texk/web2c/omegaware/odvitype.ch b/Build/source/texk/web2c/omegaware/odvitype.ch index be75e4196f7..cf2893dfc66 100644 --- a/Build/source/texk/web2c/omegaware/odvitype.ch +++ b/Build/source/texk/web2c/omegaware/odvitype.ch @@ -122,8 +122,7 @@ end; @y @p procedure open_dvi_file; {prepares to read packed bytes in |dvi_file|} begin - cur_name := extend_filename (cmdline (optind), 'dvi'); - resetbin (dvi_file, cur_name); + resetbin (dvi_file, extend_filename (cmdline (optind), 'dvi')); cur_loc := 0; end; @# diff --git a/Build/source/texk/web2c/omegaware/ofm2opl.ch b/Build/source/texk/web2c/omegaware/ofm2opl.ch index d9a586bfcd8..fac46b06d80 100644 --- a/Build/source/texk/web2c/omegaware/ofm2opl.ch +++ b/Build/source/texk/web2c/omegaware/ofm2opl.ch @@ -457,5 +457,5 @@ long_options[current_option].val := 0; @ Global filenames. @<Global...@> = -@!tfm_name, @!pl_name:c_string; +@!tfm_name, @!pl_name:const_c_string; @z diff --git a/Build/source/texk/web2c/omegaware/opl2ofm.ch b/Build/source/texk/web2c/omegaware/opl2ofm.ch index 67172f602bd..1e134a69bd3 100644 --- a/Build/source/texk/web2c/omegaware/opl2ofm.ch +++ b/Build/source/texk/web2c/omegaware/opl2ofm.ch @@ -359,5 +359,5 @@ long_options[current_option].val := 0; @ Global filenames. @<Global...@> = -@!tfm_name,@!pl_name:c_string; +@!tfm_name,@!pl_name:const_c_string; @z diff --git a/Build/source/texk/web2c/omegaware/otangle.ch b/Build/source/texk/web2c/omegaware/otangle.ch index 8fc89c42d15..84e5dc406ba 100644 --- a/Build/source/texk/web2c/omegaware/otangle.ch +++ b/Build/source/texk/web2c/omegaware/otangle.ch @@ -485,5 +485,5 @@ long_options[current_option].val := 0; @ Global filenames. @<Globals...@>= -@!web_name,@!chg_name,@!pascal_name,@!pool_name:c_string; +@!web_name,@!chg_name,@!pascal_name,@!pool_name:const_c_string; @z diff --git a/Build/source/texk/web2c/omegaware/ovf2ovp.ch b/Build/source/texk/web2c/omegaware/ovf2ovp.ch index ee8adc26d57..9ab40b511c9 100644 --- a/Build/source/texk/web2c/omegaware/ovf2ovp.ch +++ b/Build/source/texk/web2c/omegaware/ovf2ovp.ch @@ -615,5 +615,6 @@ long_options[current_option].val := 0; @ Global filenames. @<Global...@> = -@!vf_name, @!tfm_name, @!vpl_name:c_string; +@!tfm_name:c_string; +@!vf_name, @!vpl_name:const_c_string; @z diff --git a/Build/source/texk/web2c/omegaware/ovp2ovf.ch b/Build/source/texk/web2c/omegaware/ovp2ovf.ch index 2fa615d0729..62c2b250bae 100644 --- a/Build/source/texk/web2c/omegaware/ovp2ovf.ch +++ b/Build/source/texk/web2c/omegaware/ovp2ovf.ch @@ -342,5 +342,5 @@ long_options[current_option].val := 0; @ Global filenames. @<Global...@> = -@!vpl_name, @!tfm_name, @!vf_name:c_string; +@!vpl_name, @!tfm_name, @!vf_name:const_c_string; @z diff --git a/Build/source/texk/web2c/pltotf.ch b/Build/source/texk/web2c/pltotf.ch index db6946be708..d8259e4ac03 100644 --- a/Build/source/texk/web2c/pltotf.ch +++ b/Build/source/texk/web2c/pltotf.ch @@ -303,5 +303,5 @@ long_options[current_option].val := 0; @ Global filenames. @<Global...@> = -@!tfm_name,@!pl_name:c_string; +@!tfm_name,@!pl_name:const_c_string; @z diff --git a/Build/source/texk/web2c/pooltype.ch b/Build/source/texk/web2c/pooltype.ch index f93b7bb7c46..55e8a65bd8b 100644 --- a/Build/source/texk/web2c/pooltype.ch +++ b/Build/source/texk/web2c/pooltype.ch @@ -68,7 +68,7 @@ end. @y @!pool_file:packed file of text_char; {the string-pool file output by \.{TANGLE}} -@!pool_name:^char; +@!pool_name:const_c_string; @z % The name of the pool file is dynamically determined. We open it at the diff --git a/Build/source/texk/web2c/tangle.ch b/Build/source/texk/web2c/tangle.ch index ca409cc0825..f25eadec12b 100644 --- a/Build/source/texk/web2c/tangle.ch +++ b/Build/source/texk/web2c/tangle.ch @@ -829,7 +829,7 @@ long_options[current_option].val := 0; @ Global filenames. @<Globals...@>= -@!web_name,@!chg_name,@!pascal_name,@!pool_name:c_string; +@!web_name,@!chg_name,@!pascal_name,@!pool_name:const_c_string; @!force_uppercase,@!force_lowercase,@!allow_underlines,@!strict_mode:boolean; @!unambig_length:0..max_id_length; @z diff --git a/Build/source/texk/web2c/tangleboot.pin b/Build/source/texk/web2c/tangleboot.pin index d0cceafb590..b0709eeb67a 100644 --- a/Build/source/texk/web2c/tangleboot.pin +++ b/Build/source/texk/web2c/tangleboot.pin @@ -45,7 +45,7 @@ scanninghex:boolean;{:143}{156:}nextcontrol:eightbits; {:156}{164:}currepltext:textpointer;{:164}{171:}modulecount:0..12287; {:171}{179:}{troubleshooting:boolean;ddt:integer;dd:integer; debugcycle:integer;debugskipped:integer;}{:179}{185:}{wo:0..2;} -{:185}{199:}webname,chgname,pascalname,poolname:cstring; +{:185}{199:}webname,chgname,pascalname,poolname:constcstring; forceuppercase,forcelowercase,allowunderlines,strictmode:boolean; unambiglength:0..maxidlength;{:199}{30:}{procedure debughelp;forward;} {:30}{31:}procedure error;var j:0..outbufsize;k,l:0..bufsize; diff --git a/Build/source/texk/web2c/tftopl.ch b/Build/source/texk/web2c/tftopl.ch index 670811f3f18..233c2821d8d 100644 --- a/Build/source/texk/web2c/tftopl.ch +++ b/Build/source/texk/web2c/tftopl.ch @@ -435,5 +435,5 @@ long_options[current_option].val := 0; @ Global filenames. @<Global...@> = -@!tfm_name, @!pl_name:c_string; +@!tfm_name, @!pl_name:const_c_string; @z diff --git a/Build/source/texk/web2c/vftovp.ch b/Build/source/texk/web2c/vftovp.ch index 44d36c1a62f..c2b8d6ed174 100644 --- a/Build/source/texk/web2c/vftovp.ch +++ b/Build/source/texk/web2c/vftovp.ch @@ -668,5 +668,6 @@ long_options[current_option].val := 0; @ Global filenames. @<Global...@> = -@!vf_name, @!tfm_name, @!vpl_name:c_string; +@!tfm_name:c_string; +@!vf_name, @!vpl_name:const_c_string; @z diff --git a/Build/source/texk/web2c/vptovf.ch b/Build/source/texk/web2c/vptovf.ch index c5b7dd65ad9..d394d210b3d 100644 --- a/Build/source/texk/web2c/vptovf.ch +++ b/Build/source/texk/web2c/vptovf.ch @@ -304,5 +304,5 @@ long_options[current_option].val := 0; @ Global filenames. @<Global...@> = -@!vpl_name, @!tfm_name, @!vf_name:c_string; +@!vpl_name, @!tfm_name, @!vf_name:const_c_string; @z diff --git a/Build/source/texk/web2c/weave.ch b/Build/source/texk/web2c/weave.ch index 9a48f5bb1f7..94aa30229e8 100644 --- a/Build/source/texk/web2c/weave.ch +++ b/Build/source/texk/web2c/weave.ch @@ -433,5 +433,5 @@ long_options[current_option].val := 0; @ Global filenames. @<Global...@> = -@!web_name,@!chg_name,@!tex_name:c_string; +@!web_name,@!chg_name,@!tex_name:const_c_string; @z |