# HG changeset patch # User bartv # Date 1032645908 0 # Node ID fbfd52cf797661a8e9464c772120388bb7154cb2 # Parent cac491d76066b42521a7dcb870a93d7f600d9512 Try to resolve problems caused by API changes in Tcl 8.4, related to the use of const diff --git a/host/libcdl/ChangeLog b/host/libcdl/ChangeLog --- a/host/libcdl/ChangeLog +++ b/host/libcdl/ChangeLog @@ -1,3 +1,11 @@ +2002-09-21 Bart Veer + + * cdlcore.hxx, cdl.hxx, build.cxx, component.cxx, config.cxx, + database.cxx, dialog.cxx, interface.cxx, interp.cxx, + option.cxx, package.cxx, parse.cxx, property.cxx, + value.cxx, wizards.cxx + Avoid const compatibility problems with Tcl 8.4 + 2002-08-03 Bart Veer * acinclude.m4, configure.in, Makefile.am, testsuite/Makefile.am, diff --git a/host/libcdl/base.cxx b/host/libcdl/base.cxx --- a/host/libcdl/base.cxx +++ b/host/libcdl/base.cxx @@ -10,6 +10,7 @@ //####COPYRIGHTBEGIN#### // // ---------------------------------------------------------------------------- +// Copyright (C) 2002 Bart Veer // Copyright (C) 1999, 2000 Red Hat, Inc. // // This file is part of the eCos host tools. @@ -2748,7 +2749,7 @@ CdlToplevelBody::get_savefile_subcommand // start of savefiles. The command takes two arguments, a primary // command name and a set of subcommand names. int -CdlToplevelBody::savefile_handle_command(CdlInterpreter interp, int argc, char** argv) +CdlToplevelBody::savefile_handle_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_command"); CYG_REPORT_FUNCARG2XV(interp, argc); @@ -2800,12 +2801,12 @@ CdlToplevelBody::savefile_handle_command // Now take care of all the subcommands. if (2 != argc) { - int list_count = 0; - char** list_entries = 0; + int list_count = 0; + const char** list_entries = 0; try { Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, argv[2], &list_count, &list_entries)) { + if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[2]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { CdlParse::report_error(interp, "", std::string("Invalid subcommand list for `cdl_command ") + argv[1] + "'."); } @@ -2871,7 +2872,7 @@ CdlToplevelBody::savefile_handle_command // interpreter somehow. Currently this data is not readily available, // and the resulting string may not match the original data exactly. int -CdlToplevelBody::savefile_handle_unsupported(CdlInterpreter interp, int argc, char** argv) +CdlToplevelBody::savefile_handle_unsupported(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlNode::savefile_handle_unsupported"); CYG_REPORT_FUNCARG2XV(interp, argc); @@ -2931,7 +2932,7 @@ CdlToplevelBody::save_unsupported_comman // ---------------------------------------------------------------------------- int -CdlToplevelBody::savefile_handle_unknown(CdlInterpreter interp, int argc, char** argv) +CdlToplevelBody::savefile_handle_unknown(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_unknown"); CYG_REPORT_FUNCARG2XV(interp, argc); @@ -2966,7 +2967,7 @@ CdlToplevelBody::get_library_savefile_ve // version number with the interpreter, allowing it to be retrieved // by other commands. int -CdlToplevelBody::savefile_handle_version(CdlInterpreter interp, int argc, char** argv) +CdlToplevelBody::savefile_handle_version(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_version"); CYG_REPORT_FUNCARG2XV(interp, argc); @@ -3328,7 +3329,7 @@ CdlUserVisibleBody::check_properties(Cdl // Syntax: description int -CdlUserVisibleBody::parse_description(CdlInterpreter interp, int argc, char** argv) +CdlUserVisibleBody::parse_description(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_description", "result %d"); @@ -3343,7 +3344,7 @@ CdlUserVisibleBody::parse_description(Cd // Syntax: display int -CdlUserVisibleBody::parse_display(CdlInterpreter interp, int argc, char** argv) +CdlUserVisibleBody::parse_display(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_display", "result %d"); @@ -3357,7 +3358,7 @@ CdlUserVisibleBody::parse_display(CdlInt // Syntax: doc int -CdlUserVisibleBody::parse_doc(CdlInterpreter interp, int argc, char** argv) +CdlUserVisibleBody::parse_doc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_doc", "result %d"); @@ -3694,7 +3695,7 @@ CdlParentableBody::update_handler(CdlTra } int -CdlParentableBody::parse_parent(CdlInterpreter interp, int argc, char** argv) +CdlParentableBody::parse_parent(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_parent", "result %d"); diff --git a/host/libcdl/build.cxx b/host/libcdl/build.cxx --- a/host/libcdl/build.cxx +++ b/host/libcdl/build.cxx @@ -10,6 +10,7 @@ //####COPYRIGHTBEGIN#### // // ---------------------------------------------------------------------------- +// Copyright (C) 2002 Bart Veer // Copyright (C) 1999, 2000, 2001 Red Hat, Inc. // // This file is part of the eCos host tools. @@ -208,7 +209,7 @@ CdlBuildableBody::check_properties(CdlIn // scheme. int -CdlBuildableBody::parse_compile(CdlInterpreter interp, int argc, char** argv) +CdlBuildableBody::parse_compile(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_compile", "result %d"); static char* options[] = { @@ -387,7 +388,7 @@ parse_make_final_check(CdlInterpreter in } int -CdlBuildableBody::parse_make(CdlInterpreter interp, int argc, char** argv) +CdlBuildableBody::parse_make(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_make", "result %d"); static char* options[] = { @@ -441,7 +442,7 @@ parse_make_object_final_check(CdlInterpr } int -CdlBuildableBody::parse_make_object(CdlInterpreter interp, int argc, char** argv) +CdlBuildableBody::parse_make_object(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_make_object", "result %d"); static char* options[] = { @@ -462,7 +463,7 @@ CdlBuildableBody::parse_make_object(CdlI // Syntax: object ... int -CdlBuildableBody::parse_object(CdlInterpreter interp, int argc, char** argv) +CdlBuildableBody::parse_object(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_object", "result %d"); static char* options[] = { @@ -480,7 +481,7 @@ CdlBuildableBody::parse_object(CdlInterp // Syntax: build_proc { tcl code } int -CdlBuildableBody::parse_build_proc(CdlInterpreter interp, int argc, char** argv) +CdlBuildableBody::parse_build_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_build_proc", "result %d"); @@ -816,7 +817,7 @@ CdlBuildLoadableBody::check_properties(C // a valid format, i.e. libxxx.a int -CdlBuildLoadableBody::parse_library(CdlInterpreter interp, int argc, char** argv) +CdlBuildLoadableBody::parse_library(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_library", "result %d"); @@ -832,7 +833,7 @@ CdlBuildLoadableBody::parse_library(CdlI // NOTE: possibly there should be a check that the makefile exists. // Do we want to allow build_proc's to generate makefiles? int -CdlBuildLoadableBody::parse_makefile(CdlInterpreter interp, int argc, char** argv) +CdlBuildLoadableBody::parse_makefile(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_makefile", "result %d"); @@ -845,7 +846,7 @@ CdlBuildLoadableBody::parse_makefile(Cdl // ---------------------------------------------------------------------------- // syntax: include_dir int -CdlBuildLoadableBody::parse_include_dir(CdlInterpreter interp, int argc, char** argv) +CdlBuildLoadableBody::parse_include_dir(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_include_dir", "result %d"); @@ -866,7 +867,7 @@ CdlBuildLoadableBody::parse_include_dir( // NOTE: add a finalizer to check that the files exist or get created. int -CdlBuildLoadableBody::parse_include_files(CdlInterpreter interp, int argc, char** argv) +CdlBuildLoadableBody::parse_include_files(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_include_files", "result %d"); @@ -1376,7 +1377,7 @@ CdlDefinableBody::check_properties(CdlIn // ---------------------------------------------------------------------------- // Syntax: no_define int -CdlDefinableBody::parse_no_define(CdlInterpreter interp, int argc, char** argv) +CdlDefinableBody::parse_no_define(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_no_define", "result %d"); @@ -1416,7 +1417,7 @@ parse_define_final_check(CdlInterpreter } int -CdlDefinableBody::parse_define(CdlInterpreter interp, int argc, char** argv) +CdlDefinableBody::parse_define(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_define", "result %d"); @@ -1444,7 +1445,7 @@ CdlDefinableBody::parse_define(CdlInterp // FIXME: enforce mutual exclusion with no_define int -CdlDefinableBody::parse_define_format(CdlInterpreter interp, int argc, char** argv) +CdlDefinableBody::parse_define_format(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_format", "result %d"); @@ -1456,7 +1457,7 @@ CdlDefinableBody::parse_define_format(Cd // ---------------------------------------------------------------------------- // syntax: define_proc int -CdlDefinableBody::parse_define_proc(CdlInterpreter interp, int argc, char** argv) +CdlDefinableBody::parse_define_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_define_proc", "result %d"); @@ -1499,7 +1500,7 @@ parse_if_define_final_check(CdlInterpret } int -CdlDefinableBody::parse_if_define(CdlInterpreter interp, int argc, char** argv) +CdlDefinableBody::parse_if_define(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_if_define", "result %d"); @@ -1804,7 +1805,7 @@ CdlDefineLoadableBody::check_properties( // ---------------------------------------------------------------------------- // syntax: define_header
int -CdlDefineLoadableBody::parse_define_header(CdlInterpreter interp, int argc, char** argv) +CdlDefineLoadableBody::parse_define_header(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_define_header", "result %d"); diff --git a/host/libcdl/cdl.hxx b/host/libcdl/cdl.hxx --- a/host/libcdl/cdl.hxx +++ b/host/libcdl/cdl.hxx @@ -13,6 +13,7 @@ //####COPYRIGHTBEGIN#### // // ---------------------------------------------------------------------------- +// Copyright (C) 2002 Bart Veer // Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. // // This file is part of the eCos host tools. @@ -392,11 +393,11 @@ class CdlConfigurationBody : public virt // The internal implementation of the persistence support virtual void save(CdlInterpreter, Tcl_Channel, int, bool); - static int savefile_configuration_command(CdlInterpreter, int, char**); - static int savefile_description_command(CdlInterpreter, int, char**); - static int savefile_hardware_command(CdlInterpreter, int, char**); - static int savefile_template_command(CdlInterpreter, int, char**); - static int savefile_package_command(CdlInterpreter, int, char**); + static int savefile_configuration_command(CdlInterpreter, int, const char*[]); + static int savefile_description_command(CdlInterpreter, int, const char*[]); + static int savefile_hardware_command(CdlInterpreter, int, const char*[]); + static int savefile_template_command(CdlInterpreter, int, const char*[]); + static int savefile_package_command(CdlInterpreter, int, const char*[]); std::string current_hardware; std::string current_template; @@ -445,10 +446,10 @@ class CdlPackageBody : public virtual Cd ~CdlPackageBody(); - static int parse_package(CdlInterpreter, int, char**); - static int parse_hardware(CdlInterpreter, int, char**); - static int parse_install_proc(CdlInterpreter, int, char**); - static int parse_license_proc(CdlInterpreter, int, char**); + static int parse_package(CdlInterpreter, int, const char*[]); + static int parse_hardware(CdlInterpreter, int, const char*[]); + static int parse_install_proc(CdlInterpreter, int, const char*[]); + static int parse_license_proc(CdlInterpreter, int, const char*[]); // Override the CdlDefineLoadable member. Hardware packages always // send their configuration options to hardware.h @@ -468,7 +469,7 @@ class CdlPackageBody : public virtual Cd // Persistence support. virtual void save(CdlInterpreter, Tcl_Channel, int, bool); static void initialize_savefile_support(CdlToplevel); - static int savefile_package_command(CdlInterpreter, int, char**); + static int savefile_package_command(CdlInterpreter, int, const char*[]); // Was this package loaded because of a template or hardware setting? bool belongs_to_template() const; @@ -516,8 +517,8 @@ class CdlComponentBody : public virtual public: ~CdlComponentBody(); - static int parse_component(CdlInterpreter, int, char**); - static int parse_script(CdlInterpreter, int, char**); + static int parse_component(CdlInterpreter, int, const char*[]); + static int parse_script(CdlInterpreter, int, const char*[]); // Propagation support. Because of multiple virtual inheritance // it is necessary to invoke the container and valuable @@ -527,7 +528,7 @@ class CdlComponentBody : public virtual // Persistence support. virtual void save(CdlInterpreter, Tcl_Channel, int, bool); static void initialize_savefile_support(CdlToplevel); - static int savefile_component_command(CdlInterpreter, int, char**); + static int savefile_component_command(CdlInterpreter, int, const char*[]); virtual std::string get_class_name() const; bool check_this(cyg_assert_class_zeal = cyg_quick) const; @@ -567,12 +568,12 @@ class CdlOptionBody : public virtual Cdl public: ~CdlOptionBody(); - static int parse_option(CdlInterpreter, int, char**); + static int parse_option(CdlInterpreter, int, const char*[]); // Persistence support. virtual void save(CdlInterpreter, Tcl_Channel, int, bool); static void initialize_savefile_support(CdlToplevel); - static int savefile_option_command(CdlInterpreter, int, char**); + static int savefile_option_command(CdlInterpreter, int, const char*[]); virtual std::string get_class_name() const; bool check_this(cyg_assert_class_zeal = cyg_quick) const; diff --git a/host/libcdl/cdlcore.hxx b/host/libcdl/cdlcore.hxx --- a/host/libcdl/cdlcore.hxx +++ b/host/libcdl/cdlcore.hxx @@ -15,6 +15,7 @@ //####COPYRIGHTBEGIN#### // // ---------------------------------------------------------------------------- +// Copyright (C) 2002 Bart Veer // Copyright (C) 1999, 2000, 2001 Red Hat, Inc. // // This file is part of the eCos host tools. @@ -826,7 +827,7 @@ typedef CdlInferenceCallbackResult (*Cdl // the CdlInterpreterCommand, and the CdlInterpreter is accessible via // AssocData. This does result in some overheads, but none of these // should be in performance-critical code. -typedef int (*CdlInterpreterCommand)(CdlInterpreter, int, char*[]); +typedef int (*CdlInterpreterCommand)(CdlInterpreter, int, const char*[]); // ---------------------------------------------------------------------------- // In the libcdl world it is often convenient to swap whole sets of @@ -1058,6 +1059,16 @@ class Cdl { // interpreters need to be sandboxes, there are issues such as // doing the equivalent of autoconf tests. +// Tcl 8.4 involved various incompatible API changes related to +// const vs. non-const data. #define'ing USE_NON_CONST or +// USE_COMPAT_CONST avoids some of the problems, but does not +// help much for C++. +#if (TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) +# define CDL_TCL_CONST_CAST(type,var) (var) +#else +# define CDL_TCL_CONST_CAST(type,var) const_cast(var) +#endif + class CdlInterpreterBody { friend class CdlTest; @@ -1327,7 +1338,7 @@ class CdlInterpreterBody private: // This is the Tcl command proc that gets registered for all // CdlInterpreterCommand instances. - static int tcl_command_proc(ClientData, Tcl_Interp*, int, char*[]); + static int tcl_command_proc(ClientData, Tcl_Interp*, int, const char*[]); // This key is used to access the CdlInterpreter assoc data. static char* cdlinterpreter_assoc_data_key; @@ -2957,7 +2968,7 @@ class CdlPropertyBody { // as -library=libextras.a. It consists of a vector of // pairs, and is usually obtained via // CdlParse::parse_options(). - CdlPropertyBody(CdlNode, std::string, int argc, char** argv, std::vector >&); + CdlPropertyBody(CdlNode, std::string, int argc, const char* argv[], std::vector >&); private: // This string indicates the command used to define this property, @@ -2994,7 +3005,7 @@ class CdlProperty_MinimalBody : public C friend class CdlTest; public: - static CdlProperty_Minimal make(CdlNode, std::string, int, char**, std::vector >&); + static CdlProperty_Minimal make(CdlNode, std::string, int, const char*[], std::vector >&); virtual ~CdlProperty_MinimalBody( ); bool check_this( cyg_assert_class_zeal = cyg_quick ) const; CYGDBG_DECLARE_MEMLEAK_COUNTER(); @@ -3004,7 +3015,7 @@ class CdlProperty_MinimalBody : public C private: typedef CdlPropertyBody inherited; - CdlProperty_MinimalBody(CdlNode, std::string, int, char**, std::vector >&); + CdlProperty_MinimalBody(CdlNode, std::string, int, const char*[], std::vector >&); enum { CdlProperty_MinimalBody_Invalid = 0, CdlProperty_MinimalBody_Magic = 0x25625b8c @@ -3027,7 +3038,7 @@ class CdlProperty_StringBody : public Cd friend class CdlTest; public: - static CdlProperty_String make(CdlNode, std::string, std::string, int, char**, + static CdlProperty_String make(CdlNode, std::string, std::string, int, const char*[], std::vector >&); virtual ~CdlProperty_StringBody(); @@ -3040,7 +3051,7 @@ class CdlProperty_StringBody : public Cd private: typedef CdlPropertyBody inherited; - CdlProperty_StringBody(CdlNode, std::string /* id */, std::string /* data */, int, char**, + CdlProperty_StringBody(CdlNode, std::string /* id */, std::string /* data */, int, const char*[], std::vector >&); std::string data; enum { @@ -3072,9 +3083,9 @@ class CdlProperty_TclCodeBody : public C friend class CdlTest; public: - static CdlProperty_TclCode make(CdlNode, std::string, cdl_tcl_code, int, char**, + static CdlProperty_TclCode make(CdlNode, std::string, cdl_tcl_code, int, const char*[], std::vector >&); - static CdlProperty_TclCode make(CdlNode, std::string, cdl_int, cdl_tcl_code, int, char**, + static CdlProperty_TclCode make(CdlNode, std::string, cdl_int, cdl_tcl_code, int, const char*[], std::vector >&); virtual ~CdlProperty_TclCodeBody(); @@ -3086,7 +3097,7 @@ class CdlProperty_TclCodeBody : public C private: typedef CdlPropertyBody inherited; - CdlProperty_TclCodeBody(CdlNode, std::string, cdl_int, cdl_tcl_code, int, char**, + CdlProperty_TclCodeBody(CdlNode, std::string, cdl_int, cdl_tcl_code, int, const char*[], std::vector >&); cdl_int number; @@ -3115,7 +3126,7 @@ class CdlProperty_StringVectorBody : pub friend class CdlTest; public: - static CdlProperty_StringVector make(CdlNode, std::string, const std::vector&, int, char**, + static CdlProperty_StringVector make(CdlNode, std::string, const std::vector&, int, const char*[], std::vector >&); virtual ~CdlProperty_StringVectorBody(); @@ -3129,7 +3140,7 @@ class CdlProperty_StringVectorBody : pub private: typedef CdlPropertyBody inherited; - CdlProperty_StringVectorBody(CdlNode, std::string, const std::vector&, int, char**, + CdlProperty_StringVectorBody(CdlNode, std::string, const std::vector&, int, const char*[], std::vector >&); std::vector data; @@ -3158,7 +3169,7 @@ class CdlProperty_ReferenceBody : public public: static CdlProperty_Reference make(CdlNode, std::string /* id */, std::string /* destination */, - CdlUpdateHandler, int, char**, + CdlUpdateHandler, int, const char*[], std::vector >&); virtual ~CdlProperty_ReferenceBody(); @@ -3173,7 +3184,7 @@ class CdlProperty_ReferenceBody : public CdlUpdateHandler update_handler; - CdlProperty_ReferenceBody(CdlNode, std::string /* id */, std::string /* destination */, CdlUpdateHandler, int, char**, + CdlProperty_ReferenceBody(CdlNode, std::string /* id */, std::string /* destination */, CdlUpdateHandler, int, const char*[], std::vector >&); enum { CdlProperty_ReferenceBody_Invalid = 0, @@ -3197,7 +3208,7 @@ class CdlProperty_ExpressionBody : publi friend class CdlTest; public: - static CdlProperty_Expression make(CdlNode, std::string, CdlExpression, CdlUpdateHandler, int, char**, + static CdlProperty_Expression make(CdlNode, std::string, CdlExpression, CdlUpdateHandler, int, const char*[], std::vector >&); virtual ~CdlProperty_ExpressionBody(); void update(CdlTransaction, CdlNode, CdlNode, CdlUpdate); @@ -3208,7 +3219,7 @@ class CdlProperty_ExpressionBody : publi typedef CdlPropertyBody inherited_property; typedef CdlExpressionBody inherited_expression; - CdlProperty_ExpressionBody(CdlNode, std::string, CdlExpression, CdlUpdateHandler, int, char**, + CdlProperty_ExpressionBody(CdlNode, std::string, CdlExpression, CdlUpdateHandler, int, const char*[], std::vector >&); CdlUpdateHandler update_handler; @@ -3234,7 +3245,7 @@ class CdlProperty_ListExpressionBody : p friend class CdlTest; public: - static CdlProperty_ListExpression make(CdlNode, std::string, CdlListExpression, CdlUpdateHandler, int, char**, + static CdlProperty_ListExpression make(CdlNode, std::string, CdlListExpression, CdlUpdateHandler, int, const char*[], std::vector >&); virtual ~CdlProperty_ListExpressionBody(); void update(CdlTransaction, CdlNode, CdlNode, CdlUpdate); @@ -3245,7 +3256,7 @@ class CdlProperty_ListExpressionBody : p typedef CdlPropertyBody inherited_property; typedef CdlListExpressionBody inherited_expression; - CdlProperty_ListExpressionBody(CdlNode, std::string, CdlListExpression, CdlUpdateHandler, int, char**, + CdlProperty_ListExpressionBody(CdlNode, std::string, CdlListExpression, CdlUpdateHandler, int, const char*[], std::vector >&); CdlUpdateHandler update_handler; @@ -3270,7 +3281,7 @@ class CdlProperty_GoalExpressionBody : p friend class CdlTest; public: - static CdlProperty_GoalExpression make(CdlNode, std::string, CdlGoalExpression, CdlUpdateHandler, int, char**, + static CdlProperty_GoalExpression make(CdlNode, std::string, CdlGoalExpression, CdlUpdateHandler, int, const char*[], std::vector >&); virtual ~CdlProperty_GoalExpressionBody(); void update(CdlTransaction, CdlNode, CdlNode, CdlUpdate); @@ -3281,7 +3292,7 @@ class CdlProperty_GoalExpressionBody : p typedef CdlPropertyBody inherited_property; typedef CdlGoalExpressionBody inherited_expression; - CdlProperty_GoalExpressionBody(CdlNode, std::string, CdlGoalExpression, CdlUpdateHandler, int, char**, + CdlProperty_GoalExpressionBody(CdlNode, std::string, CdlGoalExpression, CdlUpdateHandler, int, const char*[], std::vector >&); CdlUpdateHandler update_handler; @@ -3314,9 +3325,9 @@ class CdlParse { public: // Utility routines. static std::string get_tcl_cmd_name(std::string); - static std::string concatenate_argv(int, char**, int); + static std::string concatenate_argv(int, const char*[], int); static int parse_options(CdlInterpreter, std::string /* diag_prefix */, char** /* options */, - int /* argc */, char** /* argv */, int /* start_index */, + int /* argc */, const char*[] /* argv */, int /* start_index */, std::vector >& /* result */); static std::string construct_diagnostic(CdlInterpreter, std::string /* classification */, std::string /* sub-identifier */, std::string /* message */); @@ -3330,7 +3341,7 @@ class CdlParse { static std::string get_expression_error_location(void); // Support for Tcl's "unknown" command - static int unknown_command(CdlInterpreter, int, char**); + static int unknown_command(CdlInterpreter, int, const char*[]); // Property-related utilities static void report_property_parse_error(CdlInterpreter, std::string, std::string); @@ -3339,26 +3350,26 @@ class CdlParse { static void report_property_parse_warning(CdlInterpreter, CdlProperty, std::string); // Utility parsing routines - static int parse_minimal_property(CdlInterpreter, int, char**, std::string, + static int parse_minimal_property(CdlInterpreter, int, const char*[], std::string, char**, void (*)(CdlInterpreter, CdlProperty_Minimal)); - static int parse_string_property(CdlInterpreter, int, char**, std::string, + static int parse_string_property(CdlInterpreter, int, const char*[], std::string, char**, void (*)(CdlInterpreter, CdlProperty_String)); - static int parse_tclcode_property(CdlInterpreter, int, char**, std::string, + static int parse_tclcode_property(CdlInterpreter, int, const char*[], std::string, char**, void (*)(CdlInterpreter, CdlProperty_TclCode)); - static int parse_stringvector_property(CdlInterpreter, int, char**, std::string, + static int parse_stringvector_property(CdlInterpreter, int, const char*[], std::string, char**, void (*)(CdlInterpreter, CdlProperty_StringVector), bool /* allow_empty */ = false); - static int parse_reference_property(CdlInterpreter, int, char**, std::string, + static int parse_reference_property(CdlInterpreter, int, const char*[], std::string, char**, void (*)(CdlInterpreter, CdlProperty_Reference), bool /* allow_empty */, CdlUpdateHandler); - static int parse_expression_property(CdlInterpreter, int, char**, std::string, + static int parse_expression_property(CdlInterpreter, int, const char*[], std::string, char **, void (*)(CdlInterpreter, CdlProperty_Expression), CdlUpdateHandler); - static int parse_listexpression_property(CdlInterpreter, int, char**, std::string, + static int parse_listexpression_property(CdlInterpreter, int, const char*[], std::string, char **, void (*)(CdlInterpreter, CdlProperty_ListExpression), CdlUpdateHandler); - static int parse_goalexpression_property(CdlInterpreter, int, char**, std::string, + static int parse_goalexpression_property(CdlInterpreter, int, const char*[], std::string, char **, void (*)(CdlInterpreter, CdlProperty_GoalExpression), CdlUpdateHandler); }; @@ -3816,13 +3827,13 @@ class CdlToplevelBody : virtual public C void add_savefile_subcommand(std::string, std::string, CdlSaveCallback, CdlInterpreterCommand); void get_savefile_commands(std::vector&); void get_savefile_subcommands(std::string, std::vector&); - void save_command_details(CdlInterpreter, Tcl_Channel, int, bool); - static int savefile_handle_command(CdlInterpreter, int, char**); - static int savefile_handle_unsupported(CdlInterpreter, int, char**); - static int savefile_handle_unknown(CdlInterpreter, int, char**); - void save_unsupported_commands(CdlInterpreter, Tcl_Channel, int, bool); + void save_command_details(CdlInterpreter, Tcl_Channel, int, bool); + static int savefile_handle_command(CdlInterpreter, int, const char*[]); + static int savefile_handle_unsupported(CdlInterpreter, int, const char*[]); + static int savefile_handle_unknown(CdlInterpreter, int, const char*[]); + void save_unsupported_commands(CdlInterpreter, Tcl_Channel, int, bool); static cdl_int get_library_savefile_version(); - static int savefile_handle_version(CdlInterpreter, int, char**); + static int savefile_handle_version(CdlInterpreter, int, const char*[]); static cdl_int get_savefile_version(CdlInterpreter); void save_conflicts(CdlInterpreter, Tcl_Channel, int, bool); static void save_separator(CdlInterpreter, Tcl_Channel, std::string, bool); @@ -3901,9 +3912,9 @@ class CdlUserVisibleBody : virtual publi // user-visible object such as doc and description static void add_property_parsers(std::vector& parsers); void check_properties(CdlInterpreter); - static int parse_description(CdlInterpreter, int, char**); - static int parse_display(CdlInterpreter, int, char**); - static int parse_doc(CdlInterpreter, int, char**); + static int parse_description(CdlInterpreter, int, const char*[]); + static int parse_display(CdlInterpreter, int, const char*[]); + static int parse_doc(CdlInterpreter, int, const char*[]); // Persistence support. The save code simply outputs some comments // corresponding to the display, doc and description properties. @@ -3944,7 +3955,7 @@ class CdlParentableBody : virtual public static void add_property_parsers(std::vector& parsers); void check_properties(CdlInterpreter); - static int parse_parent(CdlInterpreter, int, char**); + static int parse_parent(CdlInterpreter, int, const char*[]); static void update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); virtual std::string get_class_name() const; @@ -4247,36 +4258,36 @@ class CdlValuableBody : virtual public C // valuable object such as default_value and legal_values static void add_property_parsers(std::vector& parsers); void check_properties(CdlInterpreter); - static int parse_active_if(CdlInterpreter, int, char**); + static int parse_active_if(CdlInterpreter, int, const char*[]); static void active_if_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_calculated(CdlInterpreter, int, char**); + static int parse_calculated(CdlInterpreter, int, const char*[]); static void calculated_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_check_proc(CdlInterpreter, int, char**); - static int parse_default_value(CdlInterpreter, int, char**); + static int parse_check_proc(CdlInterpreter, int, const char*[]); + static int parse_default_value(CdlInterpreter, int, const char*[]); static void default_value_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_dialog(CdlInterpreter, int, char**); + static int parse_dialog(CdlInterpreter, int, const char*[]); static void dialog_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_entry_proc(CdlInterpreter, int, char**); - static int parse_flavor(CdlInterpreter, int, char**); - static int parse_group(CdlInterpreter, int, char**); - static int parse_implements(CdlInterpreter, int, char**); + static int parse_entry_proc(CdlInterpreter, int, const char*[]); + static int parse_flavor(CdlInterpreter, int, const char*[]); + static int parse_group(CdlInterpreter, int, const char*[]); + static int parse_implements(CdlInterpreter, int, const char*[]); static void implements_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_legal_values(CdlInterpreter, int, char**); + static int parse_legal_values(CdlInterpreter, int, const char*[]); static void legal_values_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_requires(CdlInterpreter, int, char**); + static int parse_requires(CdlInterpreter, int, const char*[]); static void requires_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_wizard(CdlInterpreter, int, char**); + static int parse_wizard(CdlInterpreter, int, const char*[]); static void wizard_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); // Persistence suppot void save(CdlInterpreter, Tcl_Channel, int, bool /* modifiable */, bool /* minimal */); bool value_savefile_entry_needed() const; static void initialize_savefile_support(CdlToplevel, std::string); - static int savefile_value_source_command(CdlInterpreter, int, char**); - static int savefile_user_value_command(CdlInterpreter, int, char**); - static int savefile_wizard_value_command(CdlInterpreter, int, char**); - static int savefile_inferred_value_command(CdlInterpreter, int, char**); - static int savefile_xxx_value_command(CdlInterpreter, int, char**, CdlValueSource); + static int savefile_value_source_command(CdlInterpreter, int, const char*[]); + static int savefile_user_value_command(CdlInterpreter, int, const char*[]); + static int savefile_wizard_value_command(CdlInterpreter, int, const char*[]); + static int savefile_inferred_value_command(CdlInterpreter, int, const char*[]); + static int savefile_xxx_value_command(CdlInterpreter, int, const char*[], CdlValueSource); // Make sure that the current value is legal. This gets called automatically // by all the members that modify values. It has to be a virtual function @@ -5379,10 +5390,10 @@ class CdlBuildLoadableBody : virtual pub // build-loadable object such as makefile static void add_property_parsers(std::vector& parsers); void check_properties(CdlInterpreter); - static int parse_library(CdlInterpreter, int, char**); - static int parse_makefile(CdlInterpreter, int, char**); - static int parse_include_dir(CdlInterpreter, int, char**); - static int parse_include_files(CdlInterpreter, int, char**); + static int parse_library(CdlInterpreter, int, const char*[]); + static int parse_makefile(CdlInterpreter, int, const char*[]); + static int parse_include_dir(CdlInterpreter, int, const char*[]); + static int parse_include_files(CdlInterpreter, int, const char*[]); // By default any compiled files will go into libtarget.a, which // is the default value for this variable. Individual applications may @@ -5448,11 +5459,11 @@ class CdlBuildableBody : virtual public static void add_property_parsers(std::vector& parsers); void check_properties(CdlInterpreter); - static int parse_build_proc(CdlInterpreter, int, char**); - static int parse_compile(CdlInterpreter, int, char**); - static int parse_make(CdlInterpreter, int, char**); - static int parse_make_object(CdlInterpreter, int, char**); - static int parse_object(CdlInterpreter, int, char**); + static int parse_build_proc(CdlInterpreter, int, const char*[]); + static int parse_compile(CdlInterpreter, int, const char*[]); + static int parse_make(CdlInterpreter, int, const char*[]); + static int parse_make_object(CdlInterpreter, int, const char*[]); + static int parse_object(CdlInterpreter, int, const char*[]); static bool split_custom_build_step(std::string /* data */, std::string& /* target */, std::string& /* deps */, std::string& /* rules*/, std::string& /* error_msg */); @@ -5504,7 +5515,7 @@ class CdlDefineLoadableBody : virtual pu // Add property parsers and validation code. static void add_property_parsers(std::vector& parsers); void check_properties(CdlInterpreter); - static int parse_define_header(CdlInterpreter, int, char**); + static int parse_define_header(CdlInterpreter, int, const char*[]); virtual std::string get_class_name() const; bool check_this(cyg_assert_class_zeal = cyg_quick) const; @@ -5548,11 +5559,11 @@ class CdlDefinableBody : virtual public // Add property parsers and validation code. static void add_property_parsers(std::vector& parsers); void check_properties(CdlInterpreter); - static int parse_define(CdlInterpreter, int, char**); - static int parse_define_format(CdlInterpreter, int, char**); - static int parse_define_proc(CdlInterpreter, int, char**); - static int parse_if_define(CdlInterpreter, int, char**); - static int parse_no_define(CdlInterpreter, int, char**); + static int parse_define(CdlInterpreter, int, const char*[]); + static int parse_define_format(CdlInterpreter, int, const char*[]); + static int parse_define_proc(CdlInterpreter, int, const char*[]); + static int parse_if_define(CdlInterpreter, int, const char*[]); + static int parse_no_define(CdlInterpreter, int, const char*[]); virtual std::string get_class_name() const; bool check_this(cyg_assert_class_zeal = cyg_quick) const; @@ -5607,9 +5618,9 @@ class CdlDialogBody : const cdl_tcl_code& get_confirm_proc() const; const cdl_tcl_code& get_cancel_proc() const; - static int parse_dialog(CdlInterpreter, int, char**); - static int parse_display_proc(CdlInterpreter, int, char**); - static int parse_update_proc(CdlInterpreter, int, char**); + static int parse_dialog(CdlInterpreter, int, const char*[]); + static int parse_display_proc(CdlInterpreter, int, const char*[]); + static int parse_update_proc(CdlInterpreter, int, const char*[]); // Persistence support. Dialogs should just be ignored when it // comes to saving and restoring files. @@ -5663,12 +5674,12 @@ class CdlWizardBody : cdl_int get_first_screen_number() const; const cdl_tcl_code& get_first_screen() const; const cdl_tcl_code& get_screen(cdl_int) const; - static int parse_wizard(CdlInterpreter, int, char**); - static int parse_cancel_proc(CdlInterpreter, int, char**); - static int parse_confirm_proc(CdlInterpreter, int, char**); - static int parse_decoration_proc(CdlInterpreter, int, char**); - static int parse_init_proc(CdlInterpreter, int, char**); - static int parse_screen(CdlInterpreter, int, char**); + static int parse_wizard(CdlInterpreter, int, const char*[]); + static int parse_cancel_proc(CdlInterpreter, int, const char*[]); + static int parse_confirm_proc(CdlInterpreter, int, const char*[]); + static int parse_decoration_proc(CdlInterpreter, int, const char*[]); + static int parse_init_proc(CdlInterpreter, int, const char*[]); + static int parse_screen(CdlInterpreter, int, const char*[]); // Persistence support. Wizards should just be ignored when it // comes to saving and restoring files. @@ -5715,7 +5726,7 @@ class CdlInterfaceBody : public virtual void get_implementers(std::vector&) const; void recalculate(CdlTransaction); - static int parse_interface(CdlInterpreter, int, char**); + static int parse_interface(CdlInterpreter, int, const char*[]); // Persistence support. The interface data cannot sensibly be modified // by users, it is all calculated. However it is useful to have the @@ -5723,7 +5734,7 @@ class CdlInterfaceBody : public virtual // dependencies etc. virtual void save(CdlInterpreter, Tcl_Channel, int, bool); static void initialize_savefile_support(CdlToplevel); - static int savefile_interface_command(CdlInterpreter, int, char**); + static int savefile_interface_command(CdlInterpreter, int, const char*[]); bool was_generated() const; virtual bool is_modifiable() const; diff --git a/host/libcdl/component.cxx b/host/libcdl/component.cxx --- a/host/libcdl/component.cxx +++ b/host/libcdl/component.cxx @@ -10,6 +10,7 @@ //####COPYRIGHTBEGIN#### // // ---------------------------------------------------------------------------- +// Copyright (C) 2002 Bart Veer // Copyright (C) 1999, 2000 Red Hat, Inc. // // This file is part of the eCos host tools. @@ -113,7 +114,7 @@ CdlComponentBody::~CdlComponentBody() // Tcl interpreter. int -CdlComponentBody::parse_component(CdlInterpreter interp, int argc, char** argv) +CdlComponentBody::parse_component(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlComponentBody::parse_component", "result %d"); CYG_REPORT_FUNCARG1("argc %d", argc); @@ -149,7 +150,7 @@ CdlComponentBody::parse_component(CdlInt ok = false; goto done; } - if (!Tcl_CommandComplete(argv[2])) { + if (!Tcl_CommandComplete(CDL_TCL_CONST_CAST(char*, argv[2]))) { CdlParse::report_error(interp, "", std::string("Invalid property list for cdl_component `") + argv[1] + "'."); ok = false; @@ -329,7 +330,7 @@ CdlComponentBody::parse_component(CdlInt // ---------------------------------------------------------------------------- // Syntax: script int -CdlComponentBody::parse_script(CdlInterpreter interp, int argc, char** argv) +CdlComponentBody::parse_script(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_script", "result %d"); @@ -407,7 +408,7 @@ CdlComponentBody::save(CdlInterpreter in } int -CdlComponentBody::savefile_component_command(CdlInterpreter interp, int argc, char** argv) +CdlComponentBody::savefile_component_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlComponent::savefile_component_command", "result %d"); CYG_PRECONDITION_CLASSC(interp); diff --git a/host/libcdl/config.cxx b/host/libcdl/config.cxx --- a/host/libcdl/config.cxx +++ b/host/libcdl/config.cxx @@ -10,6 +10,7 @@ //####COPYRIGHTBEGIN#### // // ---------------------------------------------------------------------------- +// Copyright (C) 2002 Bart Veer // Copyright (C) 1999, 2000 Red Hat, Inc. // // This file is part of the eCos host tools. @@ -1644,7 +1645,7 @@ CdlConfigurationBody::add(CdlTransaction // This is not done, to allow multiple savefiles to be loaded into // a single configuration in future. int -CdlConfigurationBody::savefile_configuration_command(CdlInterpreter interp, int argc, char** argv) +CdlConfigurationBody::savefile_configuration_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlConfiguration::savefile_configuration_command", "result %d"); CYG_PRECONDITION_CLASSC(interp); @@ -1691,7 +1692,7 @@ CdlConfigurationBody::savefile_configura // ---------------------------------------------------------------------------- int -CdlConfigurationBody::savefile_description_command(CdlInterpreter interp, int argc, char** argv) +CdlConfigurationBody::savefile_description_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlConfiguration::savefile_description_command"); CYG_PRECONDITION_CLASSC(interp); @@ -1715,7 +1716,7 @@ CdlConfigurationBody::savefile_descripti // ---------------------------------------------------------------------------- int -CdlConfigurationBody::savefile_hardware_command(CdlInterpreter interp, int argc, char** argv) +CdlConfigurationBody::savefile_hardware_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlConfiguration::savefile_hardware_command"); CYG_PRECONDITION_CLASSC(interp); @@ -1739,7 +1740,7 @@ CdlConfigurationBody::savefile_hardware_ // ---------------------------------------------------------------------------- int -CdlConfigurationBody::savefile_template_command(CdlInterpreter interp, int argc, char** argv) +CdlConfigurationBody::savefile_template_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlConfiguration::savefile_template_command"); CYG_PRECONDITION_CLASSC(interp); @@ -1763,7 +1764,7 @@ CdlConfigurationBody::savefile_template_ // ---------------------------------------------------------------------------- int -CdlConfigurationBody::savefile_package_command(CdlInterpreter interp, int argc, char** argv) +CdlConfigurationBody::savefile_package_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlConfiguration::savefile_package_command"); CYG_PRECONDITION_CLASSC(interp); diff --git a/host/libcdl/configure b/host/libcdl/configure --- a/host/libcdl/configure +++ b/host/libcdl/configure @@ -1821,10 +1821,11 @@ fi ecos_tcl_incdir="" ecos_tcl_libdir="" ecos_tk_libs="" + ecos_tk_libdir="" echo $ac_n "checking for Tcl version""... $ac_c" 1>&6 -echo "configure:1828: checking for Tcl version" >&5 +echo "configure:1829: checking for Tcl version" >&5 # Check whether --with-tcl-version or --without-tcl-version was given. if test "${with_tcl_version+set}" = set; then withval="$with_tcl_version" @@ -1846,7 +1847,7 @@ fi echo "$ac_t""${ecos_tcl_version}" 1>&6 echo $ac_n "checking for Tcl installation""... $ac_c" 1>&6 -echo "configure:1850: checking for Tcl installation" >&5 +echo "configure:1851: checking for Tcl installation" >&5 # Check whether --with-tcl-header or --without-tcl-header was given. if test "${with_tcl_header+set}" = set; then @@ -1943,6 +1944,7 @@ fi else . ${ecos_tcl_libdir}/tclConfig.sh ecos_LIBS="${ecos_LIBS} -ltcl${ecos_tcl_version} ${TCL_LIBS}" + ecos_LDADD="${ecos_LDADD} -L${ecos_tcl_libdir}" fi possible_tk_libdir=`echo ${ecos_tcl_libdir} | sed -e 's,tcl,tk,'` @@ -1970,6 +1972,7 @@ fi echo "$ac_t""-I${ecos_tcl_incdir} -L${ecos_tcl_libdir}" 1>&6 + @@ -2143,6 +2146,7 @@ s%@MSVC_FALSE@%$MSVC_FALSE%g s%@ecos_infra_incdir@%$ecos_infra_incdir%g s%@ecos_infra_libdir@%$ecos_infra_libdir%g s%@ecos_tk_libs@%$ecos_tk_libs%g +s%@ecos_tk_libdir@%$ecos_tk_libdir%g CEOF EOF diff --git a/host/libcdl/database.cxx b/host/libcdl/database.cxx --- a/host/libcdl/database.cxx +++ b/host/libcdl/database.cxx @@ -12,6 +12,7 @@ //####COPYRIGHTBEGIN#### // // ---------------------------------------------------------------------------- +// Copyright (C) 2002 Bart Veer // Copyright (C) 1999, 2000, 2001 Red Hat, Inc. // // This file is part of the eCos host tools. @@ -106,20 +107,20 @@ CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlPackage class CdlDbParser { public: - static int new_package(CdlInterpreter, int, char**); - static int package_description(CdlInterpreter, int, char**); - static int package_alias(CdlInterpreter, int, char**); - static int package_directory(CdlInterpreter, int, char**); - static int package_script(CdlInterpreter, int, char**); - static int package_hardware(CdlInterpreter, int, char**); + static int new_package(CdlInterpreter, int, const char*[]); + static int package_description(CdlInterpreter, int, const char*[]); + static int package_alias(CdlInterpreter, int, const char*[]); + static int package_directory(CdlInterpreter, int, const char*[]); + static int package_script(CdlInterpreter, int, const char*[]); + static int package_hardware(CdlInterpreter, int, const char*[]); - static int new_target(CdlInterpreter, int, char**); - static int target_description(CdlInterpreter, int, char**); - static int target_alias(CdlInterpreter, int, char**); - static int target_packages(CdlInterpreter, int, char**); - static int target_enable(CdlInterpreter, int, char**); - static int target_disable(CdlInterpreter, int, char**); - static int target_set_value(CdlInterpreter, int, char**); + static int new_target(CdlInterpreter, int, const char*[]); + static int target_description(CdlInterpreter, int, const char*[]); + static int target_alias(CdlInterpreter, int, const char*[]); + static int target_packages(CdlInterpreter, int, const char*[]); + static int target_enable(CdlInterpreter, int, const char*[]); + static int target_disable(CdlInterpreter, int, const char*[]); + static int target_set_value(CdlInterpreter, int, const char*[]); }; //}}} @@ -129,7 +130,7 @@ class CdlDbParser { // package int -CdlDbParser::new_package(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::new_package(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::new_package", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -264,7 +265,7 @@ CdlDbParser::new_package(CdlInterpreter // Syntax: description int -CdlDbParser::package_description(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::package_description(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::package_description", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -290,7 +291,7 @@ CdlDbParser::package_description(CdlInte // Syntax: alias // For example: alias { "This is an alias" another_alias dummy_name } int -CdlDbParser::package_alias(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::package_alias(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::package_alias", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -309,10 +310,10 @@ CdlDbParser::package_alias(CdlInterprete } else if (0 < package->aliases.size()) { CdlParse::report_warning(interp, diag_package + name, "There should be only one list of aliases."); } else { - int list_count = 0; - char** list_entries = 0; + int list_count = 0; + const char** list_entries = 0; Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, argv[1], &list_count, &list_entries)) { + if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[1]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { CdlParse::report_error(interp, diag_package + name, Tcl_GetStringResult(tcl_interp)); } else { if (0 == list_count) { @@ -333,7 +334,7 @@ CdlDbParser::package_alias(CdlInterprete // Syntax: directory // The path is of course relative to the component repository. int -CdlDbParser::package_directory(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::package_directory(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::package_directory", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -360,7 +361,7 @@ CdlDbParser::package_directory(CdlInterp // Syntax: hardware // There are no arguments. int -CdlDbParser::package_hardware(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::package_hardware(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::package_hardware", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -385,7 +386,7 @@ CdlDbParser::package_hardware(CdlInterpr // Syntax: script int -CdlDbParser::package_script(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::package_script(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::package_script", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -417,7 +418,7 @@ CdlDbParser::package_script(CdlInterpret // target int -CdlDbParser::new_target(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::new_target(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::new_target", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -495,7 +496,7 @@ CdlDbParser::new_target(CdlInterpreter i // Syntax: description int -CdlDbParser::target_description(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::target_description(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::target_description", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -521,7 +522,7 @@ CdlDbParser::target_description(CdlInter // Syntax: alias // For example: alias { "This is an alias" another_alias dummy_name } int -CdlDbParser::target_alias(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::target_alias(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::target_alias", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -539,10 +540,10 @@ CdlDbParser::target_alias(CdlInterpreter } else if (0 < target->aliases.size()) { CdlParse::report_warning(interp, diag_target + name, "There should be only one list of aliases."); } else { - int list_count = 0; - char** list_entries = 0; + int list_count = 0; + const char** list_entries = 0; Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, argv[1], &list_count, &list_entries)) { + if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[1]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { CdlParse::report_error(interp, diag_target + name, Tcl_GetStringResult(tcl_interp)); } else { if (0 == list_count) { @@ -563,7 +564,7 @@ CdlDbParser::target_alias(CdlInterpreter // Syntax: packages ... // For example: packages { CYGPKG_HAL_XXX CYGPKG_HAL_YYY } int -CdlDbParser::target_packages(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::target_packages(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::target_packages", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -581,10 +582,10 @@ CdlDbParser::target_packages(CdlInterpre } else if (0 < target->packages.size()) { CdlParse::report_warning(interp, diag_target + name, "There should be only one list of packages."); } else { - int list_count = 0; - char** list_entries = 0; + int list_count = 0; + const char** list_entries = 0; Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, argv[1], &list_count, &list_entries)) { + if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[1]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { CdlParse::report_error(interp, diag_target + name, Tcl_GetStringResult(tcl_interp)); } else { // Allow for a dummy target spec, just in case it proves useful. @@ -604,7 +605,7 @@ CdlDbParser::target_packages(CdlInterpre // Syntax: enable { opt1 opt2 ... } // For example: enable { CYGPKG_HAL_ARM_CL7xxx_7211 } int -CdlDbParser::target_enable(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::target_enable(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::target_enable", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -619,10 +620,10 @@ CdlDbParser::target_enable(CdlInterprete if (2 != argc) { CdlParse::report_error(interp, diag_target + name, "`enable' should be followed by a list of CDL options."); } else { - int list_count = 0; - char** list_entries = 0; + int list_count = 0; + const char** list_entries = 0; Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, argv[1], &list_count, &list_entries)) { + if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[1]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { CdlParse::report_error(interp, diag_target + name, Tcl_GetStringResult(tcl_interp)); } else { for (int i = 0; i < list_count; i++) { @@ -640,7 +641,7 @@ CdlDbParser::target_enable(CdlInterprete // Syntax: disable { opt1 opt2 ... } // For example: disable { CYGPKG_HAL_ARM_CL7xxx_7111 } int -CdlDbParser::target_disable(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::target_disable(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::target_disable", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -655,10 +656,10 @@ CdlDbParser::target_disable(CdlInterpret if (2 != argc) { CdlParse::report_error(interp, diag_target + name, "`disable' should be followed by a list of CDL options."); } else { - int list_count = 0; - char** list_entries = 0; + int list_count = 0; + const char** list_entries = 0; Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, argv[1], &list_count, &list_entries)) { + if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[1]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { CdlParse::report_error(interp, diag_target + name, Tcl_GetStringResult(tcl_interp)); } else { for (int i = 0; i < list_count; i++) { @@ -675,7 +676,7 @@ CdlDbParser::target_disable(CdlInterpret // Syntax: set_value