This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
cope with Tcl 8.4 API changes
- From: Bart Veer <bartv at ecoscentric dot com>
- To: ecos-patches at sources dot redhat dot com
- Date: Sat, 21 Sep 2002 23:00:50 +0100 (BST)
- Subject: cope with Tcl 8.4 API changes
Rather extensive changes, I am afraid. On the host-side, especially
libcdl, I have switched to using const wherever appropriate. A new
macro is used to hide the resulting const_cast<> operations needed to
build with earlier versions of Tcl. Two per-package host
subdirectories are affected as well, but for now I use the
USE_NON_CONST #define cheat provided by Tcl8.4
I have done various test rebuilds under RH7.2/gcc 2.96RH, using both
the default Tcl 8.3 and a private install of Tcl 8.4, and also under
current cygwin using its Tcl80. Hopefully I have not broken things on
other systems.
I am still working on some of the configury issues that were
mentioned.
Bart
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/ChangeLog,v
retrieving revision 1.21
diff -u -u -r1.21 ChangeLog
--- ChangeLog 11 Aug 2002 21:44:17 -0000 1.21
+++ ChangeLog 21 Sep 2002 21:23:28 -0000
@@ -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,
Index: base.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/base.cxx,v
retrieving revision 1.4
diff -u -u -r1.4 base.cxx
--- base.cxx 22 Jun 2001 18:18:44 -0000 1.4
+++ base.cxx 21 Sep 2002 21:24:35 -0000
@@ -2748,7 +2748,7 @@
// 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 +2800,12 @@
// 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 +2871,7 @@
// 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 +2931,7 @@
// ----------------------------------------------------------------------------
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 +2966,7 @@
// 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 +3328,7 @@
// 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 +3343,7 @@
// 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 +3357,7 @@
// 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 +3694,7 @@
}
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");
Index: build.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/build.cxx,v
retrieving revision 1.6
diff -u -u -r1.6 build.cxx
--- build.cxx 20 May 2002 22:19:27 -0000 1.6
+++ build.cxx 21 Sep 2002 21:25:07 -0000
@@ -208,7 +209,7 @@
// 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 @@
}
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 @@
}
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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
// ----------------------------------------------------------------------------
// 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 @@
// 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 @@
// ----------------------------------------------------------------------------
// 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 @@
}
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 @@
// 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 @@
// ----------------------------------------------------------------------------
// 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 @@
}
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 @@
// ----------------------------------------------------------------------------
// 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");
Index: cdl.hxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/cdl.hxx,v
retrieving revision 1.4
diff -u -u -r1.4 cdl.hxx
--- cdl.hxx 22 Jun 2001 18:18:44 -0000 1.4
+++ cdl.hxx 21 Sep 2002 21:25:36 -0000
@@ -392,11 +393,11 @@
// 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 @@
~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 @@
// 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 @@
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 @@
// 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 @@
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;
Index: cdlcore.hxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/cdlcore.hxx,v
retrieving revision 1.8
diff -u -u -r1.8 cdlcore.hxx
--- cdlcore.hxx 7 Dec 2001 14:15:03 -0000 1.8
+++ cdlcore.hxx 21 Sep 2002 21:26:25 -0000
@@ -826,7 +827,7 @@
// 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 @@
// 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 @@
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 @@
// 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 @@
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 @@
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 @@
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 @@
private:
typedef CdlPropertyBody inherited;
- CdlProperty_StringB
+ 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 @@
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 @@
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 @@
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 @@
// 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;
Index: component.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/component.cxx,v
retrieving revision 1.3
diff -u -u -r1.3 component.cxx
--- component.cxx 25 Aug 2000 17:32:39 -0000 1.3
+++ component.cxx 21 Sep 2002 21:26:50 -0000
@@ -113,7 +114,7 @@
// 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 @@
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 @@
// ----------------------------------------------------------------------------
// 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 @@
}
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);
Index: config.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/config.cxx,v
retrieving revision 1.5
diff -u -u -r1.5 config.cxx
--- config.cxx 25 Aug 2000 17:32:39 -0000 1.5
+++ config.cxx 21 Sep 2002 21:27:17 -0000
@@ -1644,7 +1645,7 @@
// 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 @@
// ----------------------------------------------------------------------------
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 @@
// ----------------------------------------------------------------------------
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 @@
// ----------------------------------------------------------------------------
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 @@
// ----------------------------------------------------------------------------
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);
Index: database.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/database.cxx,v
retrieving revision 1.5
diff -u -u -r1.5 database.cxx
--- database.cxx 22 Jun 2001 18:18:45 -0000 1.5
+++ database.cxx 21 Sep 2002 21:28:33 -0000
@@ -106,20 +107,20 @@
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_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_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, 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 @@
// 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 @@
// 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 @@
// 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 @@
} 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))) {
Index: dialog.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/dialog.cxx,v
retrieving revision 1.3
diff -u -u -r1.3 dialog.cxx
--- dialog.cxx 25 Aug 2000 17:32:39 -0000 1.3
+++ dialog.cxx 21 Sep 2002 21:29:42 -0000
@@ -142,7 +143,7 @@
// ----------------------------------------------------------------------------
// 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 @@
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 @@
// ----------------------------------------------------------------------------
// 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 @@
// ----------------------------------------------------------------------------
// 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");
Index: interface.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/interface.cxx,v
retrieving revision 1.4
diff -u -u -r1.4 interface.cxx
--- interface.cxx 25 Aug 2000 17:32:39 -0000 1.4
+++ interface.cxx 21 Sep 2002 21:30:11 -0000
@@ -112,7 +113,7 @@
// 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 @@
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 @@
}
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);
Index: interp.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/interp.cxx,v
retrieving revision 1.6
diff -u -u -r1.6 interp.cxx
--- interp.cxx 7 Dec 2001 14:15:03 -0000 1.6
+++ interp.cxx 21 Sep 2002 21:30:44 -0000
@@ -145,10 +146,10 @@
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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
} x;
x.command = command;
- if (0 == Tcl_CreateCommand(tcl_interp, const_cast<char*
for (int i = 0; i < count; i++) {
@@ -1305,7 +1316,7 @@
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);
}
Index: option.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/option.cxx,v
retrieving revision 1.3
diff -u -u -r1.3 option.cxx
--- option.cxx 25 Aug 2000 17:32:39 -0000 1.3
+++ option.cxx 21 Sep 2002 21:31:24 -0000
@@ -113,7 +114,7 @@
// 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 @@
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 @@
}
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);
Index: package.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/package.cxx,v
retrieving revision 1.3
diff -u -u -r1.3 package.cxx
--- package.cxx 25 Aug 2000 17:32:39 -0000 1.3
+++ package.cxx 21 Sep 2002 21:32:29 -0000
@@ -139,7 +140,7 @@
// 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 @@
} 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 @@
// ----------------------------------------------------------------------------
// 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 @@
// ----------------------------------------------------------------------------
// 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 @@
// 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 @@
}
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);
Index: parse.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/parse.cxx,v
retrieving revision 1.4
diff -u -u -r1.4 parse.cxx
--- parse.cxx 22 Jun 2001 18:18:45 -0000 1.4
+++ parse.cxx 21 Sep 2002 21:33:31 -0000
@@ -129,7 +130,7 @@
// 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 @@
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 @@
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 @@
// 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 @@
// 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 @@
// ----------------------------------------------------------------------------
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 @@
// ----------------------------------------------------------------------------
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 @@
} 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 @@
// ----------------------------------------------------------------------------
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 @@
// ----------------------------------------------------------------------------
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 @@
// ----------------------------------------------------------------------------
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 @@
// ----------------------------------------------------------------------------
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 @@
// ----------------------------------------------------------------------------
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)
{
Index: property.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/property.cxx,v
retrieving revision 1.3
diff -u -u -r1.3 property.cxx
--- property.cxx 22 Jun 2001 18:18:45 -0000 1.3
+++ property.cxx 21 Sep 2002 21:34:39 -0000
@@ -82,7 +83,7 @@
// ----------------------------------------------------------------------------
-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 @@
// ----------------------------------------------------------------------------
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_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_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[],
: CdlPropertyBody(node_arg, name_arg, argc_arg, argv_arg, options_arg),
CdlExpressionBody(*expr_arg),
@@ -755,7 +757,7 @@
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::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_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::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),
Index: value.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/value.cxx,v
retrieving revision 1.9
diff -u -u -r1.9 value.cxx
--- value.cxx 29 Jul 2001 02:00:07 -0000 1.9
+++ value.cxx 21 Sep 2002 21:35:35 -0000
@@ -1583,7 +1584,7 @@
}
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 @@
}
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 @@
}
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 @@
}
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 @@
// 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 @@
}
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 @@
}
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 @@
}
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 @@
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 @@
// ----------------------------------------------------------------------------
// 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 @@
// 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 @@
// 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 @@
}
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 @@
}
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 @@
}
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 @@
}
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 @@
}
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);
Index: wizard.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/wizard.cxx,v
retrieving revision 1.3
diff -u -u -r1.3 wizard.cxx
--- wizard.cxx 25 Aug 2000 17:32:39 -0000 1.3
+++ wizard.cxx 21 Sep 2002 21:35:58 -0000
@@ -109,7 +110,7 @@
// 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 @@
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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
" 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 {
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/ChangeLog,v
retrieving revision 1.20
diff -u -u -r1.20 ChangeLog
--- ChangeLog 13 Aug 2002 20:10:48 -0000 1.20
+++ ChangeLog 21 Sep 2002 21:36:47 -0000
@@ -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:
Index: build.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/common/common/build.cxx,v
retrieving revision 1.14
diff -u -u -r1.14 build.cxx
--- build.cxx 11 Aug 2002 21:45:57 -0000 1.14
+++ build.cxx 21 Sep 2002 21:37:13 -0000
@@ -85,7 +85,7 @@
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);
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/synth/arch/current/ChangeLog,v
retrieving revision 1.8
diff -u -u -r1.8 ChangeLog
--- ChangeLog 15 Sep 2002 17:51:12 -0000 1.8
+++ ChangeLog 21 Sep 2002 21:37:58 -0000
@@ -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
Index: ecosynth.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/synth/arch/current/host/ecosynth.c,v
retrieving revision 1.1
diff -u -u -r1.1 ecosynth.c
--- ecosynth.c 15 Sep 2002 17:52:52 -0000 1.1
+++ ecosynth.c 21 Sep 2002 21:38:54 -0000
@@ -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>
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/usb/slave/current/ChangeLog,v
retrieving revision 1.6
diff -u -u -r1.6 ChangeLog
--- ChangeLog 23 May 2002 23:06:33 -0000 1.6
+++ ChangeLog 21 Sep 2002 21:39:31 -0000
@@ -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,
Index: usbhost.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/usb/slave/current/host/usbhost.c,v
retrieving revision 1.1
diff -u -u -r1.1 usbhost.c
--- usbhost.c 31 May 2002 17:10:26 -0000 1.1
+++ usbhost.c 21 Sep 2002 21:39:58 -0000
@@ -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>