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

 
 

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

Submitted by:  Joonas Lipping <alcedine>
Submitted on:  Sun 02 Mar 2014 11:12:28 PM UTC  
 
Category: NonePriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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 File(s):
   
   
Comment:
   

Attached Files
file #30753:  input.diff added by alcedine (14kB - 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
  • -unavailable- added by alcedine (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 02 Mar 2014 11:12:28 PM UTCalcedineAttached File-=>Added input.diff, #30753

    Back to the top


    Powered by Savane 3.1-cleanup