Mercurial > ecos
changeset 343:fbfd52cf7976
Try to resolve problems caused by API changes in Tcl 8.4, related to
the use of const
line wrap: on
line diff
--- a/host/libcdl/ChangeLog +++ b/host/libcdl/ChangeLog @@ -1,3 +1,11 @@ +2002-09-21 Bart Veer <bartv@ecoscentric.com> + + * 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 <bartv@ecoscentric.com> * acinclude.m4, configure.in, Makefile.am, testsuite/Makefile.am,
--- 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 <string> 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 <short description> 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 <url> 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");
--- 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 <file1> <file2> ... 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 <directory name> 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 <tclcode> 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 <header file name> 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");
--- 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;
--- 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<type>(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 // <name/value> pairs, and is usually obtained via // CdlParse::parse_options(). - CdlPropertyBody(CdlNode, std::string, int argc, char** argv, std::vector<std::pair<std::string,std::string> >&); + CdlPropertyBody(CdlNode, std::string, int argc, const char* argv[], std::vector<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); + static CdlProperty_Minimal make(CdlNode, std::string, int, const char*[], std::vector<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); + CdlProperty_MinimalBody(CdlNode, std::string, int, const char*[], std::vector<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); 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::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); - 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<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); 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<std::string>&, int, char**, + static CdlProperty_StringVector make(CdlNode, std::string, const std::vector<std::string>&, int, const char*[], std::vector<std::pair<std::string,std::string> >&); virtual ~CdlProperty_StringVectorBody(); @@ -3129,7 +3140,7 @@ class CdlProperty_StringVectorBody : pub private: typedef CdlPropertyBody inherited; - CdlProperty_StringVectorBody(CdlNode, std::string, const std::vector<std::string>&, int, char**, + CdlProperty_StringVectorBody(CdlNode, std::string, const std::vector<std::string>&, int, const char*[], std::vector<std::pair<std::string,std::string> >&); std::vector<std::string> 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<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >&); 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<std::pair<std::string,std::string> >& /* 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<CdlInterpreterCommandEntry>&); void get_savefile_subcommands(std::string, std::vector<CdlInterpreterCommandEntry>&); - 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<CdlInterpreterCommandEntry>& 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<CdlInterpreterCommandEntry>& 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<CdlInterpreterCommandEntry>& 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<CdlInterpreterCommandEntry>& 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<CdlInterpreterCommandEntry>& 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<CdlInterpreterCommandEntry>& 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<CdlInterpreterCommandEntry>& 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<CdlValuable>&) 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;
--- 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 <filename> 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);
--- 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);
--- 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
--- 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 <name> <body> 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 <text> 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 <list> // 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 <path> // 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 <filename> 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 <name> <body> 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 <text> 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 <list> // 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 <list> ... // 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 <option> <value> // For example: set_value CYGHWR_MEMSIZE 0x100000 int -CdlDbParser::target_set_value(CdlInterpreter interp, int argc, char** argv) +CdlDbParser::target_set_value(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDbParser::target_set_value", "result %d"); CYG_REPORT_FUNCARG1XV(argc); @@ -1467,13 +1468,13 @@ CdlPackagesDatabaseBody::get_template_pa // its sub-commands description and package. static int -extract_ignore(CdlInterpreter interp, int argc, char** argv) +extract_ignore(CdlInterpreter interp, int argc, const char* argv[]) { return TCL_OK; } static int -extract_cdl_configuration(CdlInterpreter interp, int argc, char** argv) +extract_cdl_configuration(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("extract_cdl_configuration", "result %d"); CYG_REPORT_FUNCARG2XV(interp, argc); @@ -1504,7 +1505,7 @@ extract_cdl_configuration(CdlInterpreter } static int -extract_cdl_description(CdlInterpreter interp, int argc, char** argv) +extract_cdl_description(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("extract_cdl_description", "result %d"); CYG_REPORT_FUNCARG2XV(interp, argc); @@ -1528,7 +1529,7 @@ extract_cdl_description(CdlInterpreter i } static int -extract_cdl_package(CdlInterpreter interp, int argc, char** argv) +extract_cdl_package(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("extract_cdl_package", "result %d"); CYG_REPORT_FUNCARG2XV(interp, argc);
--- a/host/libcdl/dialog.cxx +++ b/host/libcdl/dialog.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. @@ -142,7 +143,7 @@ CdlDialogBody::~CdlDialogBody() // ---------------------------------------------------------------------------- // Parsing a dialog definition. int -CdlDialogBody::parse_dialog(CdlInterpreter interp, int argc, char** argv) +CdlDialogBody::parse_dialog(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlDialog::parse_dialog", "result %d"); CYG_REPORT_FUNCARG1("argc %d", argc); @@ -172,7 +173,7 @@ CdlDialogBody::parse_dialog(CdlInterpret if (3 != argc) { CdlParse::report_error(interp, "", std::string("Incorrect number of arguments to `") + diag_argv0 + "'\nExpecting name and properties list."); - } else if (!Tcl_CommandComplete(argv[2])) { + } else if (!Tcl_CommandComplete(CDL_TCL_CONST_CAST(char*, argv[2]))) { CdlParse::report_error(interp, "", std::string("Invalid property list for cdl_dialog `") + argv[1] + "'."); } else if (0 != toplevel->lookup(argv[1])) { CdlParse::report_error(interp, "", std::string("Dialog `") + argv[1] + "' cannot be loaded.\n" + @@ -267,7 +268,7 @@ CdlDialogBody::parse_dialog(CdlInterpret // ---------------------------------------------------------------------------- // Syntax: display_proc <tclcode> int -CdlDialogBody::parse_display_proc(CdlInterpreter interp, int argc, char** argv) +CdlDialogBody::parse_display_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_display_proc", "result %d"); @@ -280,7 +281,7 @@ CdlDialogBody::parse_display_proc(CdlInt // ---------------------------------------------------------------------------- // Syntax: update_proc <tclcode> int -CdlDialogBody::parse_update_proc(CdlInterpreter interp, int argc, char** argv) +CdlDialogBody::parse_update_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_update_proc", "result %d");
--- a/host/libcdl/interface.cxx +++ b/host/libcdl/interface.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. @@ -112,7 +113,7 @@ CdlInterfaceBody::~CdlInterfaceBody() // an option, component, or package. int -CdlInterfaceBody::parse_interface(CdlInterpreter interp, int argc, char** argv) +CdlInterfaceBody::parse_interface(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlInterface::parse_interface", "result %d"); CYG_REPORT_FUNCARG1("argc %d", argc); @@ -143,7 +144,7 @@ CdlInterfaceBody::parse_interface(CdlInt CdlParse::report_error(interp, "", std::string("Incorrect number of arguments to `") + diag_argv0 + "'\nExpecting name and properties list."); ok = false; - } else if (!Tcl_CommandComplete(argv[2])) { + } else if (!Tcl_CommandComplete(CDL_TCL_CONST_CAST(char*, argv[2]))) { CdlParse::report_error(interp, "", std::string("Invalid property list for cdl_interface `") + argv[1] + "'."); ok = false; } else if (0 != toplevel->lookup(argv[1])) { @@ -377,7 +378,7 @@ CdlInterfaceBody::save(CdlInterpreter in } int -CdlInterfaceBody::savefile_interface_command(CdlInterpreter interp, int argc, char** argv) +CdlInterfaceBody::savefile_interface_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlInterface::savefile_interface_command", "result %d"); CYG_PRECONDITION_CLASSC(interp);
--- a/host/libcdl/interp.cxx +++ b/host/libcdl/interp.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. @@ -145,10 +146,10 @@ CdlInterpreterBody::make(Tcl_Interp* tcl result = new CdlInterpreterBody(tcl_interp); std::string version = Cdl::get_library_version(); - if (0 == Tcl_SetVar(tcl_interp, "cdl_version", const_cast<char*>(version.c_str()), TCL_GLOBAL_ONLY)) { + if (0 == Tcl_SetVar(tcl_interp, "cdl_version", CDL_TCL_CONST_CAST(char*,version.c_str()), TCL_GLOBAL_ONLY)) { throw std::bad_alloc(); } - if (0 == Tcl_SetVar(tcl_interp, "cdl_interactive", const_cast<char*>(Cdl::is_interactive() ? "1" : "0"), + if (0 == Tcl_SetVar(tcl_interp, "cdl_interactive", CDL_TCL_CONST_CAST(char*, (Cdl::is_interactive() ? "1" : "0")), TCL_GLOBAL_ONLY)) { throw std::bad_alloc(); } @@ -193,7 +194,7 @@ CdlInterpreterBody::create_slave(CdlLoad // FIXME: creating a slave that is not safe appears to fail. #if 0 - Tcl_Interp* slave = Tcl_CreateSlave(interp, const_cast<char*>(slave_name.c_str()), safe); + Tcl_Interp* slave = Tcl_CreateSlave(interp, CDL_TCL_CONST_CAST(char*, slave_name.c_str()), safe); #else Tcl_Interp* slave = Tcl_CreateInterp(); #endif @@ -687,7 +688,7 @@ CdlInterpreterBody::eval(std::string scr // raised up to the library level. That way the error count // etc. are kept accurate. if ((TCL_OK != result) && !cdl_result) { - char* tcl_result = Tcl_GetStringResult(tcl_interp); + const char* tcl_result = Tcl_GetStringResult(tcl_interp); if ((0 == tcl_result) || ('\0' == tcl_result[0])) { tcl_result = "Internal error, no additional information available."; } @@ -743,7 +744,7 @@ CdlInterpreterBody::eval_cdl_code(const // raised up to the library level. That way the error count // etc. are kept accurate. if ((TCL_OK != result) && !cdl_result) { - char* tcl_result = Tcl_GetStringResult(tcl_interp); + const char* tcl_result = Tcl_GetStringResult(tcl_interp); if ((0 == tcl_result) || ('\0' == tcl_result[0])) { tcl_result = "Internal error, no additional information available."; } @@ -768,7 +769,7 @@ CdlInterpreterBody::eval_file(std::strin // set by CDL-related commands running in that interpreter. cdl_result = false; - int result = Tcl_EvalFile(tcl_interp, const_cast<char*>(script.c_str())); + int result = Tcl_EvalFile(tcl_interp, CDL_TCL_CONST_CAST(char*, script.c_str())); // The distinction between TCL_OK and TCL_RETURN is probably not worth // worrying about. if (TCL_RETURN == result) { @@ -780,7 +781,7 @@ CdlInterpreterBody::eval_file(std::strin // raised up to the library level. That way the error count // etc. are kept accurate. if ((TCL_OK != result) && !cdl_result) { - char* tcl_result = Tcl_GetStringResult(tcl_interp); + const char* tcl_result = Tcl_GetStringResult(tcl_interp); if ((0 == tcl_result) || ('\0' == tcl_result[0])) { tcl_result = "Internal error, no additional information available."; } @@ -867,7 +868,7 @@ CdlInterpreterBody::get_result() // i.e. a function pointer. That function needs a pointer to the // CdlInterpreter object, which can be accessed via AssocData. int -CdlInterpreterBody::tcl_command_proc(ClientData data, Tcl_Interp* tcl_interp, int argc, char* argv[]) +CdlInterpreterBody::tcl_command_proc(ClientData data, Tcl_Interp* tcl_interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlInterpreter::tcl_command_proc", "result %d"); CYG_REPORT_FUNCARG3XV(data, tcl_interp, argc); @@ -920,9 +921,19 @@ CdlInterpreterBody::add_command(std::str } x; x.command = command; - if (0 == Tcl_CreateCommand(tcl_interp, const_cast<char*>(name.c_str()), &tcl_command_proc, x.data, 0)) { + // Tcl 8.4 involves some incompatible API changes +#if (TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) + if (0 == Tcl_CreateCommand(tcl_interp, CDL_TCL_CONST_CAST(char*, name.c_str()), &tcl_command_proc, x.data, 0)) { throw std::bad_alloc(); } +#else + if (0 == Tcl_CreateCommand(tcl_interp, CDL_TCL_CONST_CAST(char*, name.c_str()), + (int (*)(ClientData,Tcl_Interp*, int, char*[])) &tcl_command_proc, + x.data, 0)) { + throw std::bad_alloc(); + } +#endif + CYG_REPORT_RETURN(); } @@ -938,7 +949,7 @@ CdlInterpreterBody::remove_command(std:: CYG_PRECONDITION_THISC(); CYG_PRECONDITIONC("" != name); - if (0 != Tcl_DeleteCommand(tcl_interp, const_cast<char*>(name.c_str()))) { + if (0 != Tcl_DeleteCommand(tcl_interp, CDL_TCL_CONST_CAST(char*, name.c_str()))) { CYG_FAIL("attempt to delete non-existant command"); } CYG_REPORT_RETURN(); @@ -1024,7 +1035,7 @@ CdlInterpreterBody::set_variable(std::st CYG_REPORT_FUNCARG2("this %p, name %s", this, name.c_str()); CYG_PRECONDITION_THISC(); CYG_PRECONDITIONC("" != name); - if (0 == Tcl_SetVar(tcl_interp, const_cast<char*>(name.c_str()), const_cast<char*>(value.c_str()), TCL_GLOBAL_ONLY)) { + if (0 == Tcl_SetVar(tcl_interp, CDL_TCL_CONST_CAST(char*, name.c_str()), CDL_TCL_CONST_CAST(char*, value.c_str()), TCL_GLOBAL_ONLY)) { throw std::bad_alloc(); } CYG_REPORT_RETURN(); @@ -1038,7 +1049,7 @@ CdlInterpreterBody::unset_variable(std:: CYG_PRECONDITION_THISC(); CYG_PRECONDITIONC("" != name); - Tcl_UnsetVar(tcl_interp, const_cast<char*>(name.c_str()), TCL_GLOBAL_ONLY); + Tcl_UnsetVar(tcl_interp, CDL_TCL_CONST_CAST(char*, name.c_str()), TCL_GLOBAL_ONLY); CYG_REPORT_RETURN(); } @@ -1051,7 +1062,7 @@ CdlInterpreterBody::get_variable(std::st CYG_PRECONDITIONC("" != name); std::string result = ""; - char *tmp = Tcl_GetVar(tcl_interp, const_cast<char*>(name.c_str()), TCL_GLOBAL_ONLY); + const char *tmp = Tcl_GetVar(tcl_interp, CDL_TCL_CONST_CAST(char*, name.c_str()), TCL_GLOBAL_ONLY); if (0 != tmp) { result = tmp; } @@ -1078,7 +1089,7 @@ CdlInterpreterBody::set_assoc_data(const CYG_PRECONDITION_THISC(); CYG_PRECONDITIONC((0 != key) && ('\0' != key[0])); - Tcl_SetAssocData(tcl_interp, const_cast<char*>(key), del_proc, data); + Tcl_SetAssocData(tcl_interp, CDL_TCL_CONST_CAST(char*, key), del_proc, data); CYG_REPORT_RETURN(); } @@ -1090,7 +1101,7 @@ CdlInterpreterBody::get_assoc_data(const CYG_PRECONDITION_THISC(); CYG_PRECONDITIONC((0 != key) && ('\0' != key[0])); - ClientData result = Tcl_GetAssocData(tcl_interp, const_cast<char*>(key), 0); + ClientData result = Tcl_GetAssocData(tcl_interp, CDL_TCL_CONST_CAST(char*, key), 0); CYG_REPORT_RETVAL(result); return result; } @@ -1103,7 +1114,7 @@ CdlInterpreterBody::delete_assoc_data(co CYG_PRECONDITION_THISC(); CYG_PRECONDITIONC((0 != key) && ('\0' != key[0])); - Tcl_DeleteAssocData(tcl_interp, const_cast<char*>(key)); + Tcl_DeleteAssocData(tcl_interp, CDL_TCL_CONST_CAST(char*, key)); CYG_REPORT_RETURN(); } @@ -1179,9 +1190,9 @@ return $result CYG_FAIL("Internal error evaluating Tcl script"); } - int count; - char** array; - if (TCL_OK != Tcl_SplitList(tcl_interp, const_cast<char*>(tcl_result.c_str()), &count, &array)) { + int count; + const char** array; + if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, tcl_result.c_str()), &count, CDL_TCL_CONST_CAST(char***, &array))) { throw std::bad_alloc(); } for (int i = 0; i < count; i++) { @@ -1246,9 +1257,9 @@ return $result if (TCL_OK != eval(locate_files_script, tcl_result)) { CYG_FAIL("Internal error evaluating Tcl script"); } - int count; - char** array; - if (TCL_OK != Tcl_SplitList(tcl_interp, const_cast<char*>(tcl_result.c_str()), &count, &array)) { + int count; + const char** array; + if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, tcl_result.c_str()), &count, CDL_TCL_CONST_CAST(char***, &array))) { throw std::bad_alloc(); } for (int i = 0; i < count; i++) { @@ -1305,7 +1316,7 @@ CdlInterpreterBody::write_data(Tcl_Chann CYG_REPORT_FUNCARG2XV(this, chan); CYG_PRECONDITION_THISC(); - if (-1 == Tcl_Write(chan, const_cast<char*>(data.data()), data.size())) { + if (-1 == Tcl_Write(chan, CDL_TCL_CONST_CAST(char*, data.data()), data.size())) { std::string msg = "Unexpected error writing to file " + this->get_context() + " : " + Tcl_PosixError(tcl_interp); throw CdlInputOutputException(msg); }
--- a/host/libcdl/option.cxx +++ b/host/libcdl/option.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 @@ CdlOptionBody::~CdlOptionBody() // a container, and the only non-standard property is "parent". int -CdlOptionBody::parse_option(CdlInterpreter interp, int argc, char** argv) +CdlOptionBody::parse_option(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlOptionBody::parse_option", "result %d"); CYG_REPORT_FUNCARG1("argc %d", argc); @@ -147,7 +148,7 @@ CdlOptionBody::parse_option(CdlInterpret std::string("Incorrect number of arguments to `") + diag_argv0 + "'\nExpecting name and properties list."); ok = false; - } else if (!Tcl_CommandComplete(argv[2])) { + } else if (!Tcl_CommandComplete(CDL_TCL_CONST_CAST(char*, argv[2]))) { CdlParse::report_error(interp, "", std::string("Invalid property list for cdl_option `") + argv[1] + "'."); ok = false; @@ -307,7 +308,7 @@ CdlOptionBody::save(CdlInterpreter inter } int -CdlOptionBody::savefile_option_command(CdlInterpreter interp, int argc, char** argv) +CdlOptionBody::savefile_option_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlOption::savefile_option_command", "result %d"); CYG_PRECONDITION_CLASSC(interp);
--- a/host/libcdl/package.cxx +++ b/host/libcdl/package.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. @@ -139,7 +140,7 @@ CdlPackageBody::~CdlPackageBody() // to be defined inside a package definition. int -CdlPackageBody::parse_package(CdlInterpreter interp, int argc, char** argv) +CdlPackageBody::parse_package(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlPackageBody::parse_package", "result %d"); CYG_REPORT_FUNCARG1("argc %d", argc); @@ -207,7 +208,7 @@ CdlPackageBody::parse_package(CdlInterpr } else if (0 != properties.size()) { CdlParse::report_error(interp, "", std::string("Duplicate cdl_package commands for package `") + argv[1] + "'."); - } else if (!Tcl_CommandComplete(argv[2])) { + } else if (!Tcl_CommandComplete(CDL_TCL_CONST_CAST(char*, argv[2]))) { CdlParse::report_error(interp, "", std::string("Invalid property list for cdl_package `") + argv[1] + "'."); } else { @@ -307,7 +308,7 @@ CdlPackageBody::parse_package(CdlInterpr // ---------------------------------------------------------------------------- // Syntax: hardware int -CdlPackageBody::parse_hardware(CdlInterpreter interp, int argc, char** argv) +CdlPackageBody::parse_hardware(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_hardware", "result %d"); @@ -320,7 +321,7 @@ CdlPackageBody::parse_hardware(CdlInterp // ---------------------------------------------------------------------------- // Syntax: install_proc <tclcode> int -CdlPackageBody::parse_install_proc(CdlInterpreter interp, int argc, char** argv) +CdlPackageBody::parse_install_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_install_proc", "result %d"); @@ -335,7 +336,7 @@ CdlPackageBody::parse_install_proc(CdlIn // Syntax: license_proc <tclcode> int -CdlPackageBody::parse_license_proc(CdlInterpreter interp, int argc, char** argv) +CdlPackageBody::parse_license_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_license_proc", "result %d"); @@ -515,7 +516,7 @@ CdlPackageBody::save(CdlInterpreter inte } int -CdlPackageBody::savefile_package_command(CdlInterpreter interp, int argc, char** argv) +CdlPackageBody::savefile_package_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlPackage::savefile_package_command", "result %d"); CYG_PRECONDITION_CLASSC(interp);
--- a/host/libcdl/parse.cxx +++ b/host/libcdl/parse.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. @@ -129,7 +130,7 @@ CdlParse::get_tcl_cmd_name(std::string n // This makes expression parsing easier. The final argument should be an // index into the array, typically the result of a call to skip_argv_options(). std::string -CdlParse::concatenate_argv(int argc, char** argv, int index) +CdlParse::concatenate_argv(int argc, const char* argv[], int index) { CYG_REPORT_FUNCNAME("CdlParse::concatenate_argv"); @@ -220,7 +221,7 @@ get_option_string(char* name) int CdlParse::parse_options(CdlInterpreter interp, std::string diag_prefix, char** options, - int argc, char** argv, int index, + int argc, const char* argv[], int index, std::vector<std::pair<std::string,std::string> >& result) { CYG_REPORT_FUNCNAMETYPE("CdlParse::parse_options", "final index %d"); @@ -241,7 +242,7 @@ CdlParse::parse_options(CdlInterpreter i break; } - char* arg_ptr = argv[index]; + const char* arg_ptr = argv[index]; // Skip the initial -, and the second one as well if it is present. if ('-' == *++arg_ptr) { arg_ptr++; @@ -633,7 +634,7 @@ CdlParse::report_warning(CdlInterpreter // This routine should be uninstalled after the parsing is complete, // to avoid e.g. a ParseException when it is not expected. int -CdlParse::unknown_command(CdlInterpreter interp, int argc, char** argv) +CdlParse::unknown_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlParse::unknown_command"); CYG_REPORT_FUNCARG3XV(interp, argc, argv); @@ -729,7 +730,7 @@ CdlParse::report_property_parse_warning( // A minimal property takes no arguments. int -CdlParse::parse_minimal_property(CdlInterpreter interp, int argc, char** argv, std::string name, +CdlParse::parse_minimal_property(CdlInterpreter interp, int argc, const char* argv[], std::string name, char** options_desc, void (*final_parser)(CdlInterpreter, CdlProperty_Minimal)) { CYG_REPORT_FUNCNAME("parse_minimal_property"); @@ -770,7 +771,7 @@ CdlParse::parse_minimal_property(CdlInte // ---------------------------------------------------------------------------- int -CdlParse::parse_string_property(CdlInterpreter interp, int argc, char** argv, std::string name, +CdlParse::parse_string_property(CdlInterpreter interp, int argc, const char* argv[], std::string name, char** options_desc, void (*final_parser)(CdlInterpreter, CdlProperty_String)) { CYG_REPORT_FUNCNAME("parse_string_property"); @@ -812,7 +813,7 @@ CdlParse::parse_string_property(CdlInter // ---------------------------------------------------------------------------- int -CdlParse::parse_tclcode_property(CdlInterpreter interp, int argc, char** argv, std::string name, +CdlParse::parse_tclcode_property(CdlInterpreter interp, int argc, const char* argv[], std::string name, char** options_desc, void (*final_parser)(CdlInterpreter, CdlProperty_TclCode)) { CYG_REPORT_FUNCNAME("parse_tclcode_property"); @@ -828,7 +829,7 @@ CdlParse::parse_tclcode_property(CdlInte } else if ((data_index + 1) < argc) { CdlParse::report_property_parse_error(interp, argv[0], std::string("Invalid number of arguments.\n") + "Expecting one argument, a Tcl code fragment."); - } else if (!Tcl_CommandComplete(argv[data_index])) { + } else if (!Tcl_CommandComplete(CDL_TCL_CONST_CAST(char*, argv[data_index]))) { CdlParse::report_property_parse_error(interp, argv[0], "Incomplete Tcl code fragment."); } else { @@ -855,7 +856,7 @@ CdlParse::parse_tclcode_property(CdlInte // ---------------------------------------------------------------------------- int -CdlParse::parse_stringvector_property(CdlInterpreter interp, int argc, char** argv, std::string name, +CdlParse::parse_stringvector_property(CdlInterpreter interp, int argc, const char* argv[], std::string name, char** options_desc, void (*final_parser)(CdlInterpreter, CdlProperty_StringVector), bool allow_empty) { @@ -900,7 +901,7 @@ CdlParse::parse_stringvector_property(Cd // ---------------------------------------------------------------------------- int -CdlParse::parse_reference_property(CdlInterpreter interp, int argc, char** argv, std::string name, +CdlParse::parse_reference_property(CdlInterpreter interp, int argc, const char* argv[], std::string name, char** options_desc, void (*final_parser)(CdlInterpreter, CdlProperty_Reference), bool allow_empty, CdlUpdateHandler update_handler) { @@ -946,7 +947,7 @@ CdlParse::parse_reference_property(CdlIn // ---------------------------------------------------------------------------- int -CdlParse::parse_expression_property(CdlInterpreter interp, int argc, char** argv, std::string name, +CdlParse::parse_expression_property(CdlInterpreter interp, int argc, const char* argv[], std::string name, char** options_desc, void (*final_parser)(CdlInterpreter, CdlProperty_Expression), CdlUpdateHandler update_handler) { @@ -1005,7 +1006,7 @@ CdlParse::parse_expression_property(CdlI // ---------------------------------------------------------------------------- int -CdlParse::parse_listexpression_property(CdlInterpreter interp, int argc, char** argv, std::string name, +CdlParse::parse_listexpression_property(CdlInterpreter interp, int argc, const char* argv[], std::string name, char** options_desc, void (*final_parser)(CdlInterpreter, CdlProperty_ListExpression), CdlUpdateHandler update_handler) { @@ -1059,7 +1060,7 @@ CdlParse::parse_listexpression_property( // ---------------------------------------------------------------------------- int -CdlParse::parse_goalexpression_property(CdlInterpreter interp, int argc, char** argv, std::string name, +CdlParse::parse_goalexpression_property(CdlInterpreter interp, int argc, const char* argv[], std::string name, char** options_desc, void (*final_parser)(CdlInterpreter, CdlProperty_GoalExpression), CdlUpdateHandler update_handler) {
--- a/host/libcdl/property.cxx +++ b/host/libcdl/property.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. @@ -82,7 +83,7 @@ CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlPropert // ---------------------------------------------------------------------------- -CdlPropertyBody::CdlPropertyBody(CdlNode node, std::string name_arg, int argc, char** argv_arg, +CdlPropertyBody::CdlPropertyBody(CdlNode node, std::string name_arg, int argc, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) { CYG_REPORT_FUNCNAME("CdlProperty:: constructor"); @@ -239,13 +240,13 @@ CdlPropertyBody::check_this(cyg_assert_c // ---------------------------------------------------------------------------- CdlProperty_Minimal -CdlProperty_MinimalBody::make(CdlNode node_arg, std::string name_arg, int argc_arg, char** argv_arg, +CdlProperty_MinimalBody::make(CdlNode node_arg, std::string name_arg, int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) { return new CdlProperty_MinimalBody(node_arg, name_arg, argc_arg, argv_arg, options_arg); } -CdlProperty_MinimalBody::CdlProperty_MinimalBody(CdlNode node_arg, std::string name_arg, int argc_arg, char** argv_arg, +CdlProperty_MinimalBody::CdlProperty_MinimalBody(CdlNode node_arg, std::string name_arg, int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) : inherited(node_arg, name_arg, argc_arg, argv_arg, options_arg) { @@ -287,14 +288,14 @@ CdlProperty_MinimalBody::check_this(cyg_ // ---------------------------------------------------------------------------- CdlProperty_String -CdlProperty_StringBody::make(CdlNode node_arg, std::string name_arg, std::string value_arg, int argc_arg, char** argv_arg, +CdlProperty_StringBody::make(CdlNode node_arg, std::string name_arg, std::string value_arg, int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) { return new CdlProperty_StringBody(node_arg, name_arg, value_arg, argc_arg, argv_arg, options_arg); } CdlProperty_StringBody::CdlProperty_StringBody(CdlNode node_arg, std::string name_arg, std::string value_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) : inherited(node_arg, name_arg, argc_arg, argv_arg, options_arg) { @@ -349,15 +350,16 @@ CdlProperty_StringBody::check_this(cyg_a // ---------------------------------------------------------------------------- CdlProperty_TclCode -CdlProperty_TclCodeBody::make(CdlNode node_arg, std::string name_arg, cdl_tcl_code code_arg, int argc_arg, char** argv_arg, - std::vector<std::pair<std::string,std::string> >& options_arg) +CdlProperty_TclCodeBody::make(CdlNode node_arg, std::string name_arg, cdl_tcl_code code_arg, + int argc_arg, const char* argv_arg[], + std::vector<std::pair<std::string,std::string> >& options_arg) { return new CdlProperty_TclCodeBody(node_arg, name_arg, 0, code_arg, argc_arg, argv_arg, options_arg); } CdlProperty_TclCode CdlProperty_TclCodeBody::make(CdlNode node_arg, std::string name_arg, cdl_int number_arg, cdl_tcl_code code_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) { return new CdlProperty_TclCodeBody(node_arg, name_arg, number_arg, code_arg, argc_arg, argv_arg, options_arg); @@ -366,7 +368,7 @@ CdlProperty_TclCodeBody::make(CdlNode no CdlProperty_TclCodeBody::CdlProperty_TclCodeBody(CdlNode node_arg, std::string name_arg, cdl_int number_arg, cdl_tcl_code code_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) : inherited(node_arg, name_arg, argc_arg, argv_arg, options_arg) { @@ -435,7 +437,7 @@ CdlProperty_TclCodeBody::check_this(cyg_ CdlProperty_StringVector CdlProperty_StringVectorBody::make(CdlNode node_arg, std::string name_arg, const std::vector<std::string>& data_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) { return new CdlProperty_StringVectorBody(node_arg, name_arg, data_arg, argc_arg, argv_arg, options_arg); @@ -443,7 +445,7 @@ CdlProperty_StringVectorBody::make(CdlNo CdlProperty_StringVectorBody::CdlProperty_StringVectorBody(CdlNode node_arg, std::string name_arg, const std::vector<std::string>& data_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) : inherited(node_arg, name_arg, argc_arg, argv_arg, options_arg) { @@ -543,7 +545,7 @@ CdlProperty_StringVectorBody::check_this CdlProperty_Reference CdlProperty_ReferenceBody::make(CdlNode node_arg, std::string name_arg, std::string ref_arg, CdlUpdateHandler update_handler, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) { return new CdlProperty_ReferenceBody(node_arg, name_arg, ref_arg, update_handler, argc_arg, argv_arg, options_arg); @@ -551,7 +553,7 @@ CdlProperty_ReferenceBody::make(CdlNode CdlProperty_ReferenceBody::CdlProperty_ReferenceBody(CdlNode node_arg, std::string name_arg, std::string ref_arg, CdlUpdateHandler update_handler_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) : CdlPropertyBody(node_arg, name_arg, argc_arg, argv_arg, options_arg), CdlReference(ref_arg), @@ -679,7 +681,7 @@ CdlProperty_ReferenceBody::check_this(cy CdlProperty_Expression CdlProperty_ExpressionBody::make(CdlNode node_arg, std::string name_arg, CdlExpression expr_arg, CdlUpdateHandler update_handler_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) { return new CdlProperty_ExpressionBody(node_arg, name_arg, expr_arg, update_handler_arg, argc_arg, argv_arg, options_arg); @@ -687,7 +689,7 @@ CdlProperty_ExpressionBody::make(CdlNode CdlProperty_ExpressionBody::CdlProperty_ExpressionBody(CdlNode node_arg, std::string name_arg, CdlExpression expr_arg, CdlUpdateHandler update_handler_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) : CdlPropertyBody(node_arg, name_arg, argc_arg, argv_arg, options_arg), CdlExpressionBody(*expr_arg), @@ -755,7 +757,7 @@ CdlProperty_ExpressionBody::check_this(c CdlProperty_ListExpression CdlProperty_ListExpressionBody::make(CdlNode node_arg, std::string name_arg, CdlListExpression expr_arg, CdlUpdateHandler update_handler_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) { return new CdlProperty_ListExpressionBody(node_arg, name_arg, expr_arg, update_handler_arg, @@ -765,7 +767,7 @@ CdlProperty_ListExpressionBody::make(Cdl CdlProperty_ListExpressionBody::CdlProperty_ListExpressionBody(CdlNode node_arg, std::string name_arg, CdlListExpression expr_arg, CdlUpdateHandler update_handler_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) : CdlPropertyBody(node_arg, name_arg, argc_arg, argv_arg, options_arg), CdlListExpressionBody(*expr_arg), @@ -833,7 +835,7 @@ CdlProperty_ListExpressionBody::check_th CdlProperty_GoalExpression CdlProperty_GoalExpressionBody::make(CdlNode node_arg, std::string name_arg, CdlGoalExpression expr_arg, CdlUpdateHandler update_handler_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) { return new CdlProperty_GoalExpressionBody(node_arg, name_arg, expr_arg, update_handler_arg, @@ -843,7 +845,7 @@ CdlProperty_GoalExpressionBody::make(Cdl CdlProperty_GoalExpressionBody::CdlProperty_GoalExpressionBody(CdlNode node_arg, std::string name_arg, CdlGoalExpression expr_arg, CdlUpdateHandler update_handler_arg, - int argc_arg, char** argv_arg, + int argc_arg, const char* argv_arg[], std::vector<std::pair<std::string,std::string> >& options_arg) : CdlPropertyBody(node_arg, name_arg, argc_arg, argv_arg, options_arg), CdlGoalExpressionBody(*expr_arg),
--- a/host/libcdl/value.cxx +++ b/host/libcdl/value.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. @@ -1583,7 +1584,7 @@ CdlValuableBody::dialog_update_handler(C } int -CdlValuableBody::parse_dialog(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_dialog(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_dialog", "result %d"); @@ -1682,7 +1683,7 @@ CdlValuableBody::wizard_update_handler(C } int -CdlValuableBody::parse_wizard(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_wizard(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_wizard", "result %d"); @@ -1777,7 +1778,7 @@ CdlValuableBody::legal_values_update_han } int -CdlValuableBody::parse_legal_values(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_legal_values(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_legal_values", "result %d"); @@ -1869,7 +1870,7 @@ CdlValuableBody::default_value_update_ha } int -CdlValuableBody::parse_default_value(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_default_value(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_default_value", "result %d"); int result = CdlParse::parse_expression_property(interp, argc, argv, CdlPropertyId_DefaultValue, 0, 0, @@ -1961,7 +1962,7 @@ CdlValuableBody::calculated_update_handl // FIXME: check for flavor none? int -CdlValuableBody::parse_calculated(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_calculated(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_calculated", "result %d"); @@ -2041,7 +2042,7 @@ CdlValuableBody::active_if_update_handle } int -CdlValuableBody::parse_active_if(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_active_if(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_active_if", "result %d"); @@ -2117,7 +2118,7 @@ CdlValuableBody::requires_update_handler } int -CdlValuableBody::parse_requires(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_requires(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_requires", "result %d"); @@ -2230,7 +2231,7 @@ CdlValuableBody::implements_update_handl } int -CdlValuableBody::parse_implements(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_implements(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_implements", "result %d"); @@ -2291,7 +2292,7 @@ parse_flavor_final_check(CdlInterpreter int -CdlValuableBody::parse_flavor(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_flavor(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_flavor", "result %d"); @@ -2303,7 +2304,7 @@ CdlValuableBody::parse_flavor(CdlInterpr // ---------------------------------------------------------------------------- // syntax: group <group name> int -CdlValuableBody::parse_group(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_group(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_group", "result %d"); @@ -2317,7 +2318,7 @@ CdlValuableBody::parse_group(CdlInterpre // Syntax: check_proc <tclcode> int -CdlValuableBody::parse_check_proc(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_check_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_check_proc", "result %d"); @@ -2362,7 +2363,7 @@ CdlValuableBody::get_check_proc() const // Syntax: entry_proc <tclcode> int -CdlValuableBody::parse_entry_proc(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::parse_entry_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_entry_proc", "result %d"); @@ -3985,7 +3986,7 @@ CdlValuableBody::save(CdlInterpreter int } int -CdlValuableBody::savefile_value_source_command(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::savefile_value_source_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlValuable::savefile_value_source_command"); CYG_REPORT_FUNCARG2XV(interp, argc); @@ -4014,7 +4015,7 @@ CdlValuableBody::savefile_value_source_c } int -CdlValuableBody::savefile_xxx_value_command(CdlInterpreter interp, int argc, char** argv, CdlValueSource source) +CdlValuableBody::savefile_xxx_value_command(CdlInterpreter interp, int argc, const char* argv[], CdlValueSource source) { CYG_REPORT_FUNCNAME("CdlValuable::savefile_xxx_value_command"); CYG_REPORT_FUNCARG3XV(interp, argc, source); @@ -4084,7 +4085,7 @@ CdlValuableBody::savefile_xxx_value_comm } int -CdlValuableBody::savefile_user_value_command(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::savefile_user_value_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlValuable::savefile_user_value_command"); int result = CdlValuableBody::savefile_xxx_value_command(interp, argc, argv, CdlValueSource_User); @@ -4093,7 +4094,7 @@ CdlValuableBody::savefile_user_value_com } int -CdlValuableBody::savefile_wizard_value_command(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::savefile_wizard_value_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlValuable::savefile_wizard_value_command"); int result = CdlValuableBody::savefile_xxx_value_command(interp, argc, argv, CdlValueSource_Wizard); @@ -4102,7 +4103,7 @@ CdlValuableBody::savefile_wizard_value_c } int -CdlValuableBody::savefile_inferred_value_command(CdlInterpreter interp, int argc, char** argv) +CdlValuableBody::savefile_inferred_value_command(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlValuable::savefile_inferred_value_command"); int result = CdlValuableBody::savefile_xxx_value_command(interp, argc, argv, CdlValueSource_Inferred);
--- a/host/libcdl/wizard.cxx +++ b/host/libcdl/wizard.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. @@ -109,7 +110,7 @@ CdlWizardBody::~CdlWizardBody() // Parsing a wizard definition. int -CdlWizardBody::parse_wizard(CdlInterpreter interp, int argc, char** argv) +CdlWizardBody::parse_wizard(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("CdlWizard::parse_wizard", "result %d"); CYG_REPORT_FUNCARG1("argc %d", argc); @@ -138,7 +139,7 @@ CdlWizardBody::parse_wizard(CdlInterpret if (3 != argc) { CdlParse::report_error(interp, "", std::string("Incorrect number of arguments to `") + diag_argv0 + "'\nExpecting name and properties list."); - } else if (!Tcl_CommandComplete(argv[2])) { + } else if (!Tcl_CommandComplete(CDL_TCL_CONST_CAST(char*, argv[2]))) { CdlParse::report_error(interp, "", std::string("Invalid property list for cdl_wizard `") + argv[1]+ "'."); } else if (0 != toplevel->lookup(argv[1])) { CdlParse::report_error(interp, "", std::string("Wizard `") + argv[1] + @@ -263,7 +264,7 @@ CdlWizardBody::parse_wizard(CdlInterpret // Syntax: cancel_proc <tclcode> int -CdlWizardBody::parse_cancel_proc(CdlInterpreter interp, int argc, char** argv) +CdlWizardBody::parse_cancel_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_cancel_proc", "result %d"); @@ -277,7 +278,7 @@ CdlWizardBody::parse_cancel_proc(CdlInte // Syntax: confirm_proc <tclcode> int -CdlWizardBody::parse_confirm_proc(CdlInterpreter interp, int argc, char** argv) +CdlWizardBody::parse_confirm_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_confirm_proc", "result %d"); @@ -291,7 +292,7 @@ CdlWizardBody::parse_confirm_proc(CdlInt // syntax: decoration_proc <tclcode> int -CdlWizardBody::parse_decoration_proc(CdlInterpreter interp, int argc, char** argv) +CdlWizardBody::parse_decoration_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_decoration_proc", "result %d"); @@ -305,7 +306,7 @@ CdlWizardBody::parse_decoration_proc(Cdl // Syntax: init_proc <tclcode> int -CdlWizardBody::parse_init_proc(CdlInterpreter interp, int argc, char** argv) +CdlWizardBody::parse_init_proc(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAMETYPE("parse_init_proc", "result %d"); @@ -320,7 +321,7 @@ CdlWizardBody::parse_init_proc(CdlInterp // generic parsers. There are two arguments, a number and some Tcl code. int -CdlWizardBody::parse_screen(CdlInterpreter interp, int argc, char** argv) +CdlWizardBody::parse_screen(CdlInterpreter interp, int argc, const char* argv[]) { CYG_REPORT_FUNCNAME("CdlParse::parse_screen"); CYG_REPORT_FUNCARG1("argc %d", argc); @@ -337,7 +338,7 @@ CdlWizardBody::parse_screen(CdlInterpret " Expecting two arguments, a number and some Tcl code."); } else if (!Cdl::string_to_integer(argv[data_index], number)) { CdlParse::report_property_parse_error(interp, argv[0], std::string(argv[data_index]) + " is not a valid number."); - } else if (!Tcl_CommandComplete(argv[data_index + 1])) { + } else if (!Tcl_CommandComplete(CDL_TCL_CONST_CAST(char*, argv[data_index + 1]))) { CdlParse::report_property_parse_error(interp, argv[0], "incomplete Tcl code fragment."); } else {
--- a/host/tools/configtool/ChangeLog +++ b/host/tools/configtool/ChangeLog @@ -1,3 +1,8 @@ +2002-09-21 Bart Veer <bartv@ecoscentric.com> + + * common/common/build.cxx: + Avoid const compatibility problems with Tcl 8.4 + 2002-08-12 Bart Veer <bartv@ecoscentric.com> * standalone/win32/ReadMe:
--- a/host/tools/configtool/common/common/build.cxx +++ b/host/tools/configtool/common/common/build.cxx @@ -85,7 +85,7 @@ bool eval_tcl_command (const std::string Tcl_Channel outchan = Tcl_OpenFileChannel (interp, "nul", "a+", 777); Tcl_SetStdChannel (outchan, TCL_STDOUT); // direct standard output to the null device #endif - int nStatus = Tcl_Eval (interp, (char *) command.c_str ()); + int nStatus = Tcl_Eval (interp, CDL_TCL_CONST_CAST(char*, command.c_str())); #if SET_STDOUT_TO_NULL Tcl_SetStdChannel (NULL, TCL_STDOUT); Tcl_UnregisterChannel (interp, outchan);
--- a/packages/hal/synth/arch/current/ChangeLog +++ b/packages/hal/synth/arch/current/ChangeLog @@ -1,3 +1,8 @@ +2002-09-21 Bart Veer <bartv@ecoscentric.com> + + * host/ecosynth.c: + Avoid const compatibility problems with Tcl 8.4 + 2002-09-15 Bart Veer <bartv@ecoscentric.com> * include/hal_io.h
--- a/packages/hal/synth/arch/current/host/ecosynth.c +++ b/packages/hal/synth/arch/current/host/ecosynth.c @@ -57,6 +57,8 @@ #include <fcntl.h> #include <sys/param.h> #include <sys/types.h> +// Avoid compatibility problems with Tcl 8.4 vs. earlier +#define USE_NON_CONST #include <tcl.h> #include <tk.h>
--- a/packages/io/usb/slave/current/ChangeLog +++ b/packages/io/usb/slave/current/ChangeLog @@ -1,3 +1,8 @@ +2002-09-21 Bart Veer <bartv@ecoscentric.com> + + * host/usbhost.c: + Avoid const compatibility problems with Tcl 8.4 + 2002-01-23 Bart Veer <bartv@redhat.com> * host/Makefile.am, host/Makefile.in, host/acinclude.m4,
--- a/packages/io/usb/slave/current/host/usbhost.c +++ b/packages/io/usb/slave/current/host/usbhost.c @@ -80,6 +80,8 @@ #include <time.h> #include <pthread.h> #include <semaphore.h> +// Avoid compatibility problems with Tcl 8.4 vs. earlier +#define USE_NON_CONST #include <tcl.h> #include <linux/usb.h> #include <linux/usbdevice_fs.h>
