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

 
 
Show feedback again

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

Submitted by:  Ben Pfaff <blp>
Submitted on:  Fri 23 Feb 2007 05:44:20 AM UTC  
 
Category: OtherSeverity: 1 - Wishlist
Status: NoneAssigned to: None
Open/Closed: OpenRelease: Post-0.6.0
Effort: 0.00

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

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:

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>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by blp (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 421 here (basic anti-spam test):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 25 Jul 2007 03:21:10 PM UTCblpReleaseNone=>Post-0.6.0
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup