bugPSPP - Bugs: bug #19126, Cleanups in src/ui/terminal/main.c

 
 

bug #19126: Cleanups in src/ui/terminal/main.c

Submitter:  Ben Pfaff <blp>
Submitted:  Fri 23 Feb 2007 05:44:20 AM UTC
   
 
Category:  Other Severity:  1 - Wishlist
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  Post-0.6.0
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 15 Apr 2011 04:55:21 AM UTC, comment #1: 

The first three of the four bullet points have been fixed without any of us remembering this bug.

The fourth is arguably not a big deal, and I think we've improved in this area anyhow.

Ben Pfaff <blp>
Group administrator
Fri 23 Feb 2007 05:44:20 AM UTC, original submission:  

These were proposed by John Darrington back in November 2006 and still make sense:

  • parse_command_line should be closer to the start of main.  It's where it is now, because it actually does more than parsing.  It also performs actions on the data it parses.  Some of these actions depend upon things being initialised, whereas others cannot be initialised until the data has been parsed.  Hence we have some of the _init functions called before parse_command_line, and some in the body of the if {}.  I suggest that parse_command_line is changed to do just parsing, and return the data it parses.


  • If terminate() is necessary, then for consistency there should also be initiate().


  • This code:



static bool terminating = false;
if (!terminating)
{
terminating = true;


is racy.  Get rid of it, and use sigvec instead of signal, to prevent re-entrancy.

  • Where static data is necessary, let's identify those which are effectively const --- ie are set at startup, and remain with these values until the program terminates.  Eg: config_path, allow_internal_sort, program_name etc.  There are ways of enforcing this, but they're a bit cumbersome.


Ben Pfaff <blp>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by blp (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-04-15 blp StatusNone Fixed
        Open/ClosedOpen Closed
    2007-07-25 blp ReleaseNone Post-0.6.0

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code