octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Minor oop fix.


From: John W. Eaton
Subject: Minor oop fix.
Date: Mon, 27 Apr 2009 16:27:14 -0400

On 27-Apr-2009, Robert T. Short wrote:

| Attached is a minor fix that cleans up a couple of "FIXMEs".
| 
| Also attached are changlog entries.
| 
| Bob
| 
| 
| ----------------------------------------------------------------------
| # HG changeset patch
| # User Robert T. Short <address@hidden>
| # Date 1240863382 25200
| # Node ID 2b123c389862bea82ac91e6aa742c4197caca7df
| # Parent  ad20b967e1c951c3a736043c5d645694a3aa130c
| liboctave/file-ops.h: Added a method to extract the trailing element
| of a path.
| 
| src/ov-base.h: Returning a zero is ok, so removed the FIXME.

Returning a zero from what?

| src/ov-class.cc: Cleaned up the way the method class name is
| discovered.
| 
| diff -r ad20b967e1c9 -r 2b123c389862 liboctave/ChangeLog
| --- a/liboctave/ChangeLog     Sun Apr 26 22:19:57 2009 -0700
| +++ b/liboctave/ChangeLog     Mon Apr 27 13:16:22 2009 -0700
| @@ -1,3 +1,8 @@
| +2009-04-27  Robert T. Short <address@hidden>
| +
| +        * Added a tail () function to extract the last element of a path.

What file was changed?  For new functions, you can just write:

        * file-ops.h (file_ops::tail): New function.


| diff -r ad20b967e1c9 -r 2b123c389862 src/ChangeLog
| --- a/src/ChangeLog   Sun Apr 26 22:19:57 2009 -0700
| +++ b/src/ChangeLog   Mon Apr 27 13:16:22 2009 -0700
| @@ -1,3 +1,11 @@
| +2009-04-27  Robert T. Short <address@hidden>
| +        A couple of FIXMEs
| +        * ov-class.cc: Fixed get_current_method_class to extract the class
| +          name properly.
| +        * ov-base.h: Removed the fixme comment.  Since a zero is returned 
| +          when a parent class is not found, it shouldn't be a problem for
| +          the base class to return a zero.

Please follow the existing format for ChangeLog entries:

        * file (function): what changed.

| @@ -96,16 +97,13 @@
|  static std::string
|  get_current_method_class (void)
|  {
| -  // FIXME -- is there a better way to do this?
|    octave_function *fcn = octave_call_stack::current ();
|  
|    std::string my_dir = fcn->dir_name ();
|  
| -  size_t ipos = my_dir.find_last_of ("@");
| +  std::string method_class = file_ops::tail(my_dir);
|  
| -  assert (ipos != std::string::npos);
| -
| -  return my_dir.substr (ipos+1);
| +  return method_class.substr (1);
|  }

This conflicts with a change I checked in.  Will you please update,
eliminate the conflict, and send the patch again?

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]