octave-patch-tracker
[Top][All Lists]
Advanced

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

[Octave-patch-tracker] [patch #8367] Doxygen comments for input.h and cl


From: Joonas Lipping
Subject: [Octave-patch-tracker] [patch #8367] Doxygen comments for input.h and cleanup of input.cc
Date: Sun, 02 Mar 2014 23:12:29 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0

URL:
  <http://savannah.gnu.org/patch/?8367>

                 Summary: Doxygen comments for input.h and cleanup of input.cc
                 Project: GNU Octave
            Submitted by: alcedine
            Submitted on: Sun 02 Mar 2014 11:12:28 PM GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Pertaining to two items on the Projects <http://wiki.octave.org/Projects>
page:

* Doxygen comments provided for input reader classes in input.h.

* In input.cc, std::string gnu_readline(const std::string&, bool&) was only
ever called at the end of std::string interactive_input(const std::string&,
bool&). I have moved the code there for clarity.

* In input.cc, I have provided an overload std::string interactive_input(const
std::string&) that provides a dummy bool& for callers that don't need the eof
flag. The unnecessary bool eof; declaration has been removed from these
functions.

* In input.cc, all eof = false; initializations have been removed as
unnecessary. The function that ultimately sets the eof flag is either
std::string gnu_readline::do_readline(const std::string&, bool& eof) or
std::string octave_fgets(FILE*, bool&), both of which do the initialization
anyway. Moreover, it is reasonable to expect that any future functions
promising to set an eof flag will also initialize it in an appropriate way.

* In input.cc, octave_eval_string_reader::get_input has been changed to use a
swap operation instead of a copy assignment, and the conditional
+ verbatim +
if (retval.empty ())
  eof = true;
- verbatim -
was replaced with
+ verbatim +
eof = retval.empty();
- verbatim -
I believe that these improve readability. Swap also improves efficiency,
although that effect is probably minuscule.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 02 Mar 2014 11:12:28 PM GMT  Name: input.diff  Size: 14kB   By:
alcedine
Doxygen comments for input.h and some cleanup of input.cc
<http://savannah.gnu.org/patch/download.php?file_id=30753>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8367>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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