changeset 3946:eab957395758

[project @ 2002-05-23 00:42:15 by jwe]
author jwe
date Thu, 23 May 2002 00:42:16 +0000
parents b050da7f9994
children b4f51bbf7557
files liboctave/ChangeLog liboctave/DASPK.cc liboctave/oct-rl-edit.c src/ChangeLog src/TEMPLATE-INST/Array-tc.cc src/debug.cc
diffstat 6 files changed, 94 insertions(+), 78 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog	Mon May 20 19:40:07 2002 +0000
+++ b/liboctave/ChangeLog	Thu May 23 00:42:16 2002 +0000
@@ -1,3 +1,8 @@
+2002-05-22  Mumit Khan <khan@nanotech.wisc.edu>
+
+	* DASPK.cc (ddaspk_psol): Return value.
+	* oct-rl-edit.c: Use /* ... */ to comment.
+
 2002-05-20  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* DASSL.h (DASSL_options::init): Undo previous change.
--- a/liboctave/DASPK.cc	Mon May 20 19:40:07 2002 +0000
+++ b/liboctave/DASPK.cc	Thu May 23 00:42:16 2002 +0000
@@ -172,6 +172,7 @@
 	     double *, int*)
 {
   abort ();
+  return 0;
 }
 
 int
--- a/liboctave/oct-rl-edit.c	Mon May 20 19:40:07 2002 +0000
+++ b/liboctave/oct-rl-edit.c	Thu May 23 00:42:16 2002 +0000
@@ -68,15 +68,15 @@
   rl_variable_bind ("blink-matching-paren", val ? "1" : "0");
 }
 
-// It would be much simpler if we could just call _rl_clear_screen to
-// only clear the screen, but it is not a public function, and on some
-// systems, it is not exported from shared library versions of
-// readline, so we can't use it.
-//
-// Instead, temporarily redefine the redisplay function to do nothing.
-//
-// XXX FIXME XXX -- It would be safer to do this when protected from
-// interrupts...
+/* It would be much simpler if we could just call _rl_clear_screen to
+   only clear the screen, but it is not a public function, and on some
+   systems, it is not exported from shared library versions of
+   readline, so we can't use it.
+
+   Instead, temporarily redefine the redisplay function to do nothing.
+
+   XXX FIXME XXX -- It would be safer to do this when protected from
+   interrupts... */
 
 static void
 no_redisplay (void)
--- a/src/ChangeLog	Mon May 20 19:40:07 2002 +0000
+++ b/src/ChangeLog	Thu May 23 00:42:16 2002 +0000
@@ -1,3 +1,10 @@
+2002-05-22  Mumit Khan <khan@nanotech.wisc.edu>
+
+	* debug.cc: Include cstdlib instead of stdlib.h. Include cstring.
+	(dbtype): Use strchr instead of index.
+	* TEMPLATE-INST/Array-tc.cc (Array<octave_value>::resize_fill_value):
+	Fix template specialization syntax.
+
 2002-05-17  Mumit Khan <khan@nanotech.wisc.edu>
 
 	* c-file-ptr-stream.h (OCTAVE_STD_FILEBUF): New macro to handle
--- a/src/TEMPLATE-INST/Array-tc.cc	Mon May 20 19:40:07 2002 +0000
+++ b/src/TEMPLATE-INST/Array-tc.cc	Thu May 23 00:42:16 2002 +0000
@@ -39,6 +39,7 @@
 
 template class Array<octave_value>;
 
+template<>
 octave_value
 Array<octave_value>::resize_fill_value (void)
 {
--- a/src/debug.cc	Mon May 20 19:40:07 2002 +0000
+++ b/src/debug.cc	Thu May 23 00:42:16 2002 +0000
@@ -27,8 +27,8 @@
 #include <iostream>
 #include <fstream>
 #include <strstream>
-#include <string>
-#include <stdlib.h> 
+#include <cstring>
+#include <cstdlib>
 
 #include "defun.h"
 #include "error.h"
@@ -58,7 +58,7 @@
   if (str.compare (""))
     {
       symbol_record *ptr = curr_sym_tab->lookup (str);
-      
+
       if (ptr && ptr->is_user_function ())
 	{
 	  octave_value tmp = ptr->def ();
@@ -67,7 +67,7 @@
       else
 	{
 	  symbol_record *ptr = lookup_by_name (str, false);
-	  
+	
 	  if (ptr && ptr->is_user_function ())
 	    {
 	      octave_value tmp = ptr->def ();
@@ -105,20 +105,20 @@
 
   int result = -1;
   int nargin = args.length ();
-  
+
   string_vector argv = args.make_argv ("dbstop");
 
   if (error_state)
     return retval;
 
   if (nargin == 2)
-    { 
+    {
       std::string symbol_name = argv[1];
 
       std::string line_number = argv[2];
 
       int line = atoi (line_number.c_str ());
-      
+
       octave_user_function *dbg_fcn = get_user_function (symbol_name);
 
       if (dbg_fcn)
@@ -136,14 +136,14 @@
       int line = atoi (line_number.c_str ());
 
       octave_user_function *dbg_fcn = get_user_function ();
-      
+
       if (dbg_fcn)
 	{
 	  tree_statement_list *cmds = dbg_fcn->body ();
 	  result = cmds->set_breakpoint (line);
 	}
       else
-	error ("unable to find the function requested\n");	 
+	error ("unable to find the function requested\n");	
     }
   else
     error ("one argument when in a function and two when not\n");
@@ -175,13 +175,13 @@
   std::string line_number;
   int line = -1;
   int nargin = args.length ();
-  
+
   if (nargin != 1 && nargin != 2)
     {
       error ("need one or two arguements\n");
       return retval;
     }
-  
+
   string_vector argv = args.make_argv ("dbclear");
 
   if (error_state)
@@ -191,7 +191,7 @@
     {
       octave_stdout << "2 input arguments\n";
       symbol_name = argv[1];
- 
+
       octave_stdout << argv[1] << std::endl;
       line_number = argv[2];
 
@@ -210,12 +210,12 @@
 
   if (line_number.compare("all") && line_number.compare("ALL"))
     line = atoi (line_number.c_str ());
-  else 
+  else
     line = -1;
 
   octave_stdout << "symbol_name = " << symbol_name << std::endl;
   octave_user_function *dbg_fcn = get_user_function (symbol_name);
-  
+
   if (dbg_fcn)
     {
       tree_statement_list *cmds = dbg_fcn->body ();
@@ -261,7 +261,7 @@
     }
 
   octave_user_function *dbg_fcn = get_user_function (symbol_name);
- 
+
   if (dbg_fcn)
     {
       tree_statement_list *cmds = dbg_fcn->body ();
@@ -271,7 +271,7 @@
       RowVector vec (lst.length (), 0.0);
 
       for (int i = 0; i < lst.length (); i++)
-	{ 
+	{
 	  vec(i) = lst(i).double_value ();
 
 	  if (error_state)
@@ -294,7 +294,7 @@
 @seealso{dbclear, dbstatus, dbstop}")
 {
   octave_value retval;
-  
+
   octave_user_function *dbg_fcn = curr_function;
 
   if (dbg_fcn)
@@ -307,7 +307,7 @@
 
       if (dbg_stmt)
 	{
-	  octave_stdout << "line " << dbg_stmt->line () << ", "; 
+	  octave_stdout << "line " << dbg_stmt->line () << ", ";
 	  octave_stdout << "column " << dbg_stmt->column () << std::endl;
 	}
       else
@@ -320,8 +320,8 @@
 }
 
 // Copied and modified from the do_type command in help.cc
-// Maybe we could share some code?  
-void 
+// Maybe we could share some code?
+void
 do_dbtype(std::ostream& os, const std::string& name, int start, int end)
 {
   std::string ff = fcn_file_in_path (name);
@@ -329,15 +329,15 @@
   if (! ff.empty ())
     {
       std::ifstream fs (ff.c_str (), std::ios::in);
-      
+
       if (fs)
-	{  
+	{
 	  char ch;
 	  int line = 1;
-	  
+	
 	  if (line >= start && line <= end)
 	    os << line << "\t";
- 	  
+ 	
 	  while (fs.get (ch))
 	    {
 	      if (line >= start && line <= end)
@@ -349,11 +349,11 @@
 		{
 		  line++;
 		  if (line >= start && line <= end)
-		    os << line << "\t"; 
+		    os << line << "\t";
 		}
 	    }
 	}
-      else 
+      else
 	os << "unable to open `" << ff << "' for reading!\n";
     }
   else
@@ -370,10 +370,10 @@
 {
   octave_value retval;
   octave_user_function *dbg_fcn;
-  
+
   int nargin = args.length ();
   string_vector argv = args.make_argv ("dbtype");
-    
+
   if (! error_state)
     {
       switch (nargin)
@@ -382,99 +382,101 @@
 	  dbg_fcn = get_user_function ();
 
 	  if (dbg_fcn)
-	    do_dbtype(octave_stdout,dbg_fcn->function_name (), 0, INT_MAX);
+	    do_dbtype (octave_stdout, dbg_fcn->function_name (), 0, INT_MAX);
 	  else
-	    error("must be in a user function to give no arguments to dbtype\n");
+	    error ("must be in a user function to give no arguments to dbtype\n");
+	  break;
 
-	  break;
-	case 1: // (dbtype func) || (dbtype start:end) 
+	case 1: // (dbtype func) || (dbtype start:end)
 	  dbg_fcn = get_user_function (argv[1].c_str ());
 
 	  if (dbg_fcn)
-	    do_dbtype(octave_stdout,dbg_fcn->function_name (), 0, INT_MAX);
+	    do_dbtype (octave_stdout, dbg_fcn->function_name (), 0, INT_MAX);
 	  else
 	    {
 	      dbg_fcn = get_user_function ("");
 
 	      if (dbg_fcn)
 		{
-		  char *str = (char *)malloc(strlen(argv[1].c_str ()) + 1);
+		  char *str = malloc (strlen (argv[1].c_str ()) + 1);
 
 		  if (str)
-		    memcpy(str, argv[1].c_str (), strlen(argv[1].c_str ()) + 1);
-		  else 
-		    error("croaked\n");
-		  
-		  char *ind = index(str,':');
-		  
+		    memcpy (str, argv[1].c_str (),
+			    strlen (argv[1].c_str ()) + 1);
+		  else
+		    error ("croaked\n");
+		
+		  char *ind = strchr (str, ':');
+		
 		  if (ind)
 		    *ind = '\0';
 		  else
 		    {
-		      free(str);
-		      error("if you specify lines it must be like `start:end`");
+		      free (str);
+		      error ("if you specify lines it must be like `start:end`");
 		    }
 		  ind++;
-		  
-		  int start = atoi(str);
-		  int end   = atoi(ind);
-		  
-		  free(str);
+		
+		  int start = atoi (str);
+		  int end   = atoi (ind);
+		
+		  free (str);
 		  str = NULL;
 		  ind = NULL;
-		  
+		
 		  octave_stdout << "got start and end\n";
-		  
+		
 		  if (start > end)
 		    error("the start line must be less than the end line\n");
-		  
+		
 		  octave_stdout << "doing dbtype\n";
-		  do_dbtype(octave_stdout, dbg_fcn->function_name (), start, end);
+		  do_dbtype (octave_stdout, dbg_fcn->function_name (), start, end);
 		  octave_stdout << "did dbtype\n";
 		}
 	    }
 	  break;
-	case 2: // (dbtype func start:end) 
+
+	case 2: // (dbtype func start:end)
 	  dbg_fcn = get_user_function (argv[1].c_str ());
 
 	  if (dbg_fcn)
 	    {
-	      
-	      char *str = (char *)malloc(strlen(argv[2].c_str ()) + 1);
+	
+	      char *str = malloc (strlen (argv[2].c_str ()) + 1);
 
 	      if (str)
-		memcpy(str, argv[2].c_str (), strlen(argv[2].c_str ()) + 1);
+		memcpy (str, argv[2].c_str (), strlen (argv[2].c_str ()) + 1);
 	      else
-		error("not enough memory\n");
+		error ("not enough memory\n");
 
-	      
-	      char *ind = index(str,':');
+	
+	      char *ind = strchr (str, ':');
 
 	      if (ind)
 		*ind = '\0';
 	      else
 		{
-		  free(str);
-		  error("if you specify lines it must be like `start:end`");
+		  free (str);
+		  error ("if you specify lines it must be like `start:end`");
 		}
 	      ind++;
 
-	      int start = atoi(str);
-	      int end   = atoi(ind);
+	      int start = atoi (str);
+	      int end   = atoi (ind);
 
-	      free(str);
-	      ind = NULL; 
-	      str = NULL; 
+	      free (str);
+	      ind = NULL;
+	      str = NULL;
 
 	      if (start > end)
-		error("the start line must be less than the end line\n");
+		error ("the start line must be less than the end line\n");
 
-	      do_dbtype(octave_stdout, dbg_fcn->function_name (), start, end);	      
+	      do_dbtype (octave_stdout, dbg_fcn->function_name (), start, end);
 	    }
+	  break;
 
-	  break;
 	default:
-	  error("unacceptable number of arguments\n"); 
+	  error ("unacceptable number of arguments\n");
 	}
     }