changeset 540:c07674bbc3b1

[project @ 1994-07-21 23:59:00 by jwe]
author jwe
date Fri, 22 Jul 1994 00:01:29 +0000
parents 5ec10a984241
children a8d5d1072d99
files src/dassl.cc src/defun-int.h src/fsolve.cc src/lsode.cc src/npsol.cc src/qpsol.cc src/quad.cc
diffstat 7 files changed, 26 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/dassl.cc	Thu Jul 21 22:42:09 1994 +0000
+++ b/src/dassl.cc	Fri Jul 22 00:01:29 1994 +0000
@@ -173,8 +173,8 @@
 
 struct DAE_OPTIONS
 {
-  char *keyword;
-  char *kw_tok[MAX_TOKENS + 1];
+  const char *keyword;
+  const char *kw_tok[MAX_TOKENS + 1];
   int min_len[MAX_TOKENS + 1];
   int min_toks_to_match;
   d_set_opt_mf d_set_fcn;
@@ -227,7 +227,7 @@
 
   DAE_OPTIONS *list = dassl_option_table;
 
-  char *keyword;
+  const char *keyword;
   while ((keyword = list->keyword) != 0)
     {
       output_buf.form ("  %-40s ", keyword);
--- a/src/defun-int.h	Thu Jul 21 22:42:09 1994 +0000
+++ b/src/defun-int.h	Fri Jul 22 00:01:29 1994 +0000
@@ -51,18 +51,23 @@
   Octave_object \
   fname (const Octave_object& args, int nargout)
 
+// XXX FIXME XXX -- eliminate the need for these in the functions that
+// use them?
+
 #define DEFINE_ARGV(warnfor) \
   int argc = args.length (); \
+  int save_argc = argc; \
   char **argv = make_argv (args, warnfor); \
+  char **save_argv = argv; \
   if (error_state) \
     return retval
 
 #define DELETE_ARGV \
   do \
     { \
-      while (--argc) \
-	delete [] argv[argc]; \
-      delete [] argv; \
+      while (--save_argc >= 0) \
+	delete [] save_argv[save_argc]; \
+      delete [] save_argv; \
     } \
   while (0)
 
--- a/src/fsolve.cc	Thu Jul 21 22:42:09 1994 +0000
+++ b/src/fsolve.cc	Fri Jul 22 00:01:29 1994 +0000
@@ -172,8 +172,8 @@
 
 struct NLEQN_OPTIONS
 {
-  char *keyword;
-  char *kw_tok[MAX_TOKENS + 1];
+  const char *keyword;
+  const char *kw_tok[MAX_TOKENS + 1];
   int min_len[MAX_TOKENS + 1];
   int min_toks_to_match;
   d_set_opt_mf d_set_fcn;
@@ -208,7 +208,7 @@
 
   NLEQN_OPTIONS *list = fsolve_option_table;
 
-  char *keyword;
+  const char *keyword;
   while ((keyword = list->keyword) != 0)
     {
       output_buf.form ("  %-40s ", keyword);
--- a/src/lsode.cc	Thu Jul 21 22:42:09 1994 +0000
+++ b/src/lsode.cc	Fri Jul 22 00:01:29 1994 +0000
@@ -154,8 +154,8 @@
 
 struct ODE_OPTIONS
 {
-  char *keyword;
-  char *kw_tok[MAX_TOKENS + 1];
+  const char *keyword;
+  const char *kw_tok[MAX_TOKENS + 1];
   int min_len[MAX_TOKENS + 1];
   int min_toks_to_match;
   d_set_opt_mf d_set_fcn;
@@ -214,7 +214,7 @@
 
   ODE_OPTIONS *list = lsode_option_table;
 
-  char *keyword;
+  const char *keyword;
   while ((keyword = list->keyword) != 0)
     {
       output_buf.form ("  %-40s ", keyword);
--- a/src/npsol.cc	Thu Jul 21 22:42:09 1994 +0000
+++ b/src/npsol.cc	Fri Jul 22 00:01:29 1994 +0000
@@ -522,8 +522,8 @@
 
 struct NPSOL_OPTIONS
 {
-  char *keyword;
-  char *kw_tok[MAX_TOKENS + 1];
+  const char *keyword;
+  const char *kw_tok[MAX_TOKENS + 1];
   int min_len[MAX_TOKENS + 1];
   int min_toks_to_match;
   d_set_opt_mf d_set_fcn;
@@ -674,7 +674,7 @@
 
   NPSOL_OPTIONS *list = npsol_option_table;
 
-  char *keyword;
+  const char *keyword;
   while ((keyword = list->keyword) != 0)
     {
       output_buf.form ("  %-40s ", keyword);
--- a/src/qpsol.cc	Thu Jul 21 22:42:09 1994 +0000
+++ b/src/qpsol.cc	Fri Jul 22 00:01:29 1994 +0000
@@ -226,8 +226,8 @@
 
 struct QPSOL_OPTIONS
 {
-  char *keyword;
-  char *kw_tok[MAX_TOKENS + 1];
+  const char *keyword;
+  const char *kw_tok[MAX_TOKENS + 1];
   int min_len[MAX_TOKENS + 1];
   int min_toks_to_match;
   d_set_opt_mf d_set_fcn;
@@ -282,7 +282,7 @@
 
   QPSOL_OPTIONS *list = qpsol_option_table;
 
-  char *keyword;
+  const char *keyword;
   while ((keyword = list->keyword) != 0)
     {
       output_buf.form ("  %-40s ", keyword);
--- a/src/quad.cc	Thu Jul 21 22:42:09 1994 +0000
+++ b/src/quad.cc	Fri Jul 22 00:01:29 1994 +0000
@@ -206,8 +206,8 @@
 
 struct QUAD_OPTIONS
 {
-  char *keyword;
-  char *kw_tok[MAX_TOKENS + 1];
+  const char *keyword;
+  const char *kw_tok[MAX_TOKENS + 1];
   int min_len[MAX_TOKENS + 1];
   int min_toks_to_match;
   d_set_opt_mf d_set_fcn;
@@ -248,7 +248,7 @@
 
   QUAD_OPTIONS *list = quad_option_table;
 
-  char *keyword;
+  const char *keyword;
   while ((keyword = list->keyword) != 0)
     {
       output_buf.form ("  %-40s ", keyword);