Mercurial > hg > octave-lyh
changeset 1363:ed5757e3333b
[project @ 1995-09-05 23:26:59 by jwe]
author | jwe |
---|---|
date | Tue, 05 Sep 1995 23:26:59 +0000 |
parents | f9745982c987 |
children | 353b06ad0194 |
files | src/balance.cc src/colloc.cc src/dassl.cc src/data.cc src/error.cc src/file-io.cc src/fsolve.cc src/input.cc src/load-save.cc src/lsode.cc src/npsol.cc src/oct-hist.cc src/oct-hist.h src/octave.cc src/qpsol.cc src/quad.cc src/rand.cc src/schur.cc src/sysdep.cc src/timefns.cc src/utils.cc src/variables.cc |
diffstat | 22 files changed, 63 insertions(+), 63 deletions(-) [+] |
line wrap: on
line diff
--- a/src/balance.cc +++ b/src/balance.cc @@ -72,7 +72,7 @@ return retval; } - char *bal_job; + const char *bal_job; int my_nargin; // # args w/o optional string arg // Determine if balancing option is listed. Set my_nargin to the
--- a/src/colloc.cc +++ b/src/colloc.cc @@ -84,7 +84,7 @@ return retval; } - char *s = args(i).string_value (); + const char *s = args(i).string_value (); if (s && (((*s == 'R' || *s == 'r') && strlen (s) == 1) || strcmp (s, "right") == 0))
--- a/src/dassl.cc +++ b/src/dassl.cc @@ -274,7 +274,7 @@ } static void -set_dassl_option (char *keyword, double val) +set_dassl_option (const char *keyword, double val) { DAE_OPTIONS *list = dassl_option_table; @@ -294,7 +294,7 @@ } static Octave_object -show_dassl_option (char *keyword) +show_dassl_option (const char *keyword) { Octave_object retval; @@ -332,7 +332,7 @@ } else if (nargin == 1 || nargin == 2) { - char *keyword = args(0).string_value (); + const char *keyword = args(0).string_value (); if (! error_state) {
--- a/src/data.cc +++ b/src/data.cc @@ -755,7 +755,7 @@ retval = 0.0; if (args(0).is_map () && args(1).is_string ()) { - char *s = args(1).string_value (); + const char *s = args(1).string_value (); tree_constant tmp = args(0).lookup_map_element (s, 0, 1); retval = (double) tmp.is_defined (); }
--- a/src/error.cc +++ b/src/error.cc @@ -175,7 +175,7 @@ { Octave_object retval; - char *msg = "unspecified error"; + const char *msg = "unspecified error"; int nargin = args.length (); @@ -204,7 +204,7 @@ { Octave_object retval; - char *msg = "unspecified warning"; + const char *msg = "unspecified warning"; int nargin = args.length (); @@ -233,7 +233,7 @@ { Octave_object retval; - char *msg = "unknown"; + const char *msg = "unknown"; int nargin = args.length ();
--- a/src/file-io.cc +++ b/src/file-io.cc @@ -167,7 +167,7 @@ int file_count = file_list.length (); for (int i = 0; i < file_count; i++) { - char *file_name = arg.string_value (); + const char *file_name = arg.string_value (); file = file_list (p); if (strcmp (file.name (), file_name) == 0) return p; @@ -243,7 +243,7 @@ { if (arg.is_string ()) { - char *name = arg.string_value (); + const char *name = arg.string_value (); struct stat buffer; int status = stat (name, &buffer); @@ -532,8 +532,8 @@ return retval; } - char *name = args(0).string_value (); - char *mode = args(1).string_value (); + const char *name = args(0).string_value (); + const char *mode = args(1).string_value (); if (! valid_mode (mode)) { @@ -985,7 +985,7 @@ case 's': { - char *val = args(fmt_arg_count++).string_value (); + const char *val = args(fmt_arg_count++).string_value (); if (error_state) goto invalid_conversion; @@ -1002,7 +1002,7 @@ case 'c': { - char *val = args(fmt_arg_count++).string_value (); + const char *val = args(fmt_arg_count++).string_value (); if (error_state || strlen (val) != 1) goto invalid_conversion; @@ -1037,7 +1037,7 @@ { Octave_object retval; fmt_arg_count = 0; - char *fmt; + const char *fmt; file_info file; if (strcmp (type, "fprintf") == 0) @@ -1082,7 +1082,7 @@ ostrstream output_buf; - char *ptr = fmt; + const char *ptr = fmt; for (;;) { @@ -1357,7 +1357,7 @@ do_scanf (const char *type, const Octave_object& args, int nargout) { Octave_object retval; - char *scanf_fmt = 0; + const char *scanf_fmt = 0; char *tmp_file = 0; int tmp_file_open = 0; FILE *fptr = 0; @@ -1399,7 +1399,7 @@ if ((! fptr && args(0).is_string ()) || (doing_fscanf && file.number () == 0)) { - char *string; + const char *string; if (strcmp (type, "scanf") == 0) scanf_fmt = args(0).string_value (); @@ -1460,7 +1460,7 @@ retval.resize (nargout); - char *ptr = scanf_fmt; + const char *ptr = scanf_fmt; for (;;) { @@ -1553,7 +1553,7 @@ // Find out how many elements are left to read. static long -num_items_remaining (FILE *fptr, char *type) +num_items_remaining (FILE *fptr, const char *type) { size_t size; @@ -1628,7 +1628,7 @@ // Get type and number of bytes per element to read. - char *prec = "uchar"; + const char *prec = "uchar"; if (nargin > 2) { prec = args(2).string_value (); @@ -1815,7 +1815,7 @@ // Get type and number of bytes per element to read. - char *prec = "uchar"; + const char *prec = "uchar"; if (nargin > 2) { prec = args(2).string_value (); @@ -1968,9 +1968,7 @@ return retval; } - char *name = args(0).string_value (); - - Pix p = return_valid_file (name); + Pix p = return_valid_file (args(0)); if (p) { @@ -1987,7 +1985,8 @@ return retval; } - char *mode = args(1).string_value (); + const char *name = args(0).string_value (); + const char *mode = args(1).string_value (); if (mode[1] || (mode[0] != 'w' && mode[0] != 'r')) { @@ -2108,7 +2107,7 @@ return retval; } - char *name = args(0).string_value (); + const char *name = args(0).string_value (); if (pipe (stdin_pipe) || pipe (stdout_pipe)) { @@ -2200,7 +2199,7 @@ return retval; } - char *name = args(0).string_value (); + const char *name = args(0).string_value (); retval (0) = (double) system (name); return retval; @@ -2235,7 +2234,7 @@ return retval; } - char *name = args(0).string_value (); + const char *name = args(0).string_value (); pid = fork (); @@ -2368,7 +2367,7 @@ return retval; } - char *name = args(0).string_value (); + const char *name = args(0).string_value (); if (! args(1).is_scalar_type ()) { @@ -2417,7 +2416,7 @@ return retval; } - char *name = args(0).string_value (); + const char *name = args(0).string_value (); retval (0) = (double) unlink (name);
--- a/src/fsolve.cc +++ b/src/fsolve.cc @@ -240,7 +240,7 @@ } static void -set_fsolve_option (char *keyword, double val) +set_fsolve_option (const char *keyword, double val) { NLEQN_OPTIONS *list = fsolve_option_table; @@ -260,7 +260,7 @@ } static Octave_object -show_fsolve_option (char *keyword) +show_fsolve_option (const char *keyword) { Octave_object retval; @@ -298,7 +298,7 @@ } else if (nargin == 1 || nargin == 2) { - char *keyword = args(0).string_value (); + const char *keyword = args(0).string_value (); if (! error_state) {
--- a/src/input.cc +++ b/src/input.cc @@ -73,7 +73,7 @@ #endif char * -gnu_readline (char *s) +gnu_readline (const char *s) { #if 0 static int state = 0; @@ -977,7 +977,7 @@ if (nargin == 2) read_as_string++; - char *prompt = "debug> "; + const char *prompt = "debug> "; if (nargin > 0) { prompt = args(0).string_value ();
--- a/src/load-save.cc +++ b/src/load-save.cc @@ -2428,7 +2428,7 @@ int nc = tc.columns (); FOUR_BYTE_INT len = nr * nc; os.write (&len, 4); - char *s = tc.string_value (); + const char *s = tc.string_value (); os.write (s, len); } else if (tc.is_range ()) @@ -2726,7 +2726,7 @@ else if (tc.is_string ()) { ascii_save_type (os, "string", mark_as_global); - char *tmp = tc.string_value (); + const char *tmp = tc.string_value (); os << "# length: " << strlen (tmp) << "\n" << tmp << "\n"; }
--- a/src/lsode.cc +++ b/src/lsode.cc @@ -255,7 +255,7 @@ } static void -set_lsode_option (char *keyword, double val) +set_lsode_option (const char *keyword, double val) { ODE_OPTIONS *list = lsode_option_table; @@ -275,7 +275,7 @@ } static Octave_object -show_lsode_option (char *keyword) +show_lsode_option (const char *keyword) { Octave_object retval; @@ -313,7 +313,7 @@ } else if (nargin == 1 || nargin == 2) { - char *keyword = args(0).string_value (); + const char *keyword = args(0).string_value (); if (! error_state) {
--- a/src/npsol.cc +++ b/src/npsol.cc @@ -719,7 +719,7 @@ } static void -set_npsol_option (char *keyword, double val) +set_npsol_option (const char *keyword, double val) { NPSOL_OPTIONS *list = npsol_option_table; @@ -749,7 +749,7 @@ } static Octave_object -show_npsol_option (char *keyword) +show_npsol_option (const char *keyword) { Octave_object retval; @@ -805,7 +805,7 @@ } else if (nargin == 1 || nargin == 2) { - char *keyword = args(0).string_value (); + const char *keyword = args(0).string_value (); if (! error_state) {
--- a/src/oct-hist.cc +++ b/src/oct-hist.cc @@ -142,7 +142,7 @@ } void -maybe_save_history (char *s) +maybe_save_history (const char *s) { if (saving_history) {
--- a/src/oct-hist.h +++ b/src/oct-hist.h @@ -26,7 +26,7 @@ extern void initialize_history (void); extern void clean_up_history (void); -extern void maybe_save_history (char*); +extern void maybe_save_history (const char*); extern void do_history (int, char**); extern void do_edit_history (int, char**); extern void do_run_history (int, char**);
--- a/src/octave.cc +++ b/src/octave.cc @@ -902,7 +902,7 @@ static Octave_object eval_string (const tree_constant& arg, int& parse_status, int nargout) { - char *string = arg.string_value (); + const char *string = arg.string_value (); if (error_state) { @@ -971,7 +971,7 @@ tree_constant tc_command = args(0); - char *tmp_str = tc_command.string_value (); + const char *tmp_str = tc_command.string_value (); if (error_state) {
--- a/src/qpsol.cc +++ b/src/qpsol.cc @@ -328,7 +328,7 @@ } static void -set_qpsol_option (char *keyword, double val) +set_qpsol_option (const char *keyword, double val) { QPSOL_OPTIONS *list = qpsol_option_table; @@ -358,7 +358,7 @@ } static Octave_object -show_qpsol_option (char *keyword) +show_qpsol_option (const char *keyword) { Octave_object retval; @@ -414,7 +414,7 @@ } else if (nargin == 1 || nargin == 2) { - char *keyword = args(0).string_value (); + const char *keyword = args(0).string_value (); if (! error_state) {
--- a/src/quad.cc +++ b/src/quad.cc @@ -312,7 +312,7 @@ } static void -set_quad_option (char *keyword, double val) +set_quad_option (const char *keyword, double val) { QUAD_OPTIONS *list = quad_option_table; @@ -332,7 +332,7 @@ } static Octave_object -show_quad_option (char *keyword) +show_quad_option (const char *keyword) { Octave_object retval; @@ -370,7 +370,7 @@ } else if (nargin == 1 || nargin == 2) { - char *keyword = args(0).string_value (); + const char *keyword = args(0).string_value (); if (! error_state) {
--- a/src/rand.cc +++ b/src/rand.cc @@ -172,7 +172,8 @@ if (tmp.is_string ()) { - char *s_arg = tmp.string_value (); + const char *s_arg = tmp.string_value (); + if (strcmp (s_arg, "dist") == 0) { char *s = curr_rand_dist ();
--- a/src/schur.cc +++ b/src/schur.cc @@ -61,7 +61,7 @@ tree_constant arg = args(0); - char *ord = "U"; + const char *ord = "U"; if (nargin == 2) { ord = args(1).string_value ();
--- a/src/sysdep.cc +++ b/src/sysdep.cc @@ -525,7 +525,7 @@ if (nargin == 1) { - char *name = args(0).string_value (); + const char *name = args(0).string_value (); if (! error_state) {
--- a/src/timefns.cc +++ b/src/timefns.cc @@ -272,7 +272,7 @@ if (args.length () == 2 && args(0).is_string () && args(1).is_map ()) { - char *fmt = args(0).string_value (); + const char *fmt = args(0).string_value (); Octave_map map = args(1).map_value (); double fraction;
--- a/src/utils.cc +++ b/src/utils.cc @@ -781,7 +781,7 @@ } char * -undo_string_escapes (char *s) +undo_string_escapes (const char *s) { ostrstream buf;
--- a/src/variables.cc +++ b/src/variables.cc @@ -129,7 +129,7 @@ { tree_fvc *ans = 0; - char *fcn_name = arg.string_value (); + const char *fcn_name = arg.string_value (); if (error_state) { @@ -188,7 +188,7 @@ return retval; } - char *name = args(0).string_value (); + const char *name = args(0).string_value (); if (error_state) { @@ -847,7 +847,7 @@ if (! error_state && val.is_string ()) { - char *s = val.string_value (); + const char *s = val.string_value (); if (s) retval = strsave (s);