From 63e707366de19030dbbdb9382b2df454f63f8a7c Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Tue, 26 Jul 2011 16:24:38 +0000 Subject: kpathsea: More changes to reduce diffs with W32TeX git-svn-id: svn://tug.org/texlive/trunk@23233 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/ChangeLog | 7 ++++--- Build/source/texk/kpathsea/tex-file.c | 16 +++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'Build/source') diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 981844422b8..b479d4fb0b4 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -9,9 +9,10 @@ variable.c, xdirname.c, xgetcwd.c: Test for 2-Byte Kanji (CP 932, SJIS) codes. - * db.c (kpathsea_db_search, kpathsea_db_search_list): Cast - aliases to `void *' because MSVC warns for a `const_string *' - argument when expecting `void *'. + * db.c (kpathsea_db_search, kpathsea_db_search_list), + tex-file.c (kpathsea_set_suffixes_va_list, init_maketex): + Cast arg to `void *' because MSVC warns for a `const_string *' + arg when expecting `void *'. * config.h, db.c, hash.c: #define and use TRANSFORM. diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c index 3bbd259d98d..293bca1b729 100644 --- a/Build/source/texk/kpathsea/tex-file.c +++ b/Build/source/texk/kpathsea/tex-file.c @@ -342,7 +342,11 @@ kpathsea_set_suffixes_va_list (kpathsea kpse, kpse_file_format_type format, while ((s = va_arg (ap, string)) != NULL) { count++; + /* This is essentially XRETALLOC (*list, count + 1, const_string); + except that MSVC warns without the cast to `void *'. */ + *list = (const_string *) xrealloc ((void *) *list, + (count + 1) * sizeof(const_string)); (*list)[count - 1] = s; } (*list)[count] = NULL; @@ -413,7 +417,8 @@ init_maketex (kpathsea kpse, kpse_file_format_type fmt, va_start (ap, dflt_prog); while ((arg = va_arg (ap, string)) != NULL) { f->argc++; - XRETALLOC (f->argv, f->argc + 1, const_string); + f->argv = (const_string *) xrealloc ((void *) f->argv, + (f->argc + 1) * sizeof(const_string)); f->argv[f->argc - 1] = arg; } va_end (ap); @@ -880,7 +885,7 @@ kpse_init_format (kpse_file_format_type format) static void target_fontmaps (kpathsea kpse, string **target, unsigned *count, - const_string name) + const_string name) { const_string *mapped_names = kpathsea_fontmap_lookup (kpse, name); @@ -976,7 +981,8 @@ kpse_find_file (const_string name, kpse_file_format_type format, string * kpathsea_find_file_generic (kpathsea kpse, const_string const_name, - kpse_file_format_type format, boolean must_exist, boolean all) + kpse_file_format_type format, + boolean must_exist, boolean all) { string *target, name; const_string *ext; @@ -1062,7 +1068,7 @@ kpathsea_find_file_generic (kpathsea kpse, const_string const_name, /* Search, trying to minimize disk-pounding. */ ret = kpathsea_path_search_list_generic (kpse, FMT_INFO.path, - (const_string*) target, false, all); + (const_string*) target, false, all); /* Do we need to pound the disk? */ if (! *ret && must_exist) { @@ -1081,7 +1087,7 @@ kpathsea_find_file_generic (kpathsea kpse, const_string const_name, } target[count] = NULL; ret = kpathsea_path_search_list_generic (kpse, FMT_INFO.path, - (const_string*) target, true, all); + (const_string*) target, true, all); } /* Free the list we created. */ -- cgit v1.2.3