patchGNU Octave - Patches: patch #8367, Doxygen comments for input.h and...

 
 

patch #8367: Doxygen comments for input.h and cleanup of input.cc

Submitter:  Joonas Lipping <alcedine>
Submitted:  Sun 02 Mar 2014 11:12:28 PM UTC
   
 
Category:  Core : other Priority:  3 - Low
Status:  Wont Do Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 18 Jan 2020 12:05:05 PM UTC, comment #1: 

Review for Octave 6.

Sorry for the 6 years without reply.

Your patch does not cleanly apply to the default Octave branch any more and does not fulfill our Doxygen style guide.

https://wiki.octave.org/C%2B%2B_style_guide#Doxygen

Closing this item.

Kai Torben Ohlhus <siko1056>
Group Member
Sun 02 Mar 2014 11:12:28 PM UTC, original submission:  

Pertaining to two items on the 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.

Joonas Lipping <alcedine>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #30753:  input.diff added by alcedine (14KiB - text/plain - Doxygen comments for input.h and some cleanup of input.cc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by alcedine (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-18 siko1056 CategoryNone Core : other
        Priority5 - Normal 3 - Low
        StatusNone Wont Do
        Open/ClosedOpen Closed
    2014-03-02 alcedine Attached File- Added input.diff, #30753

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code