bug-gnu-pspp
[Top][All Lists]
Advanced

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

PSPP-BUG: [bug #19126] Cleanups in src/ui/terminal/main.c


From: Ben Pfaff
Subject: PSPP-BUG: [bug #19126] Cleanups in src/ui/terminal/main.c
Date: Fri, 23 Feb 2007 05:44:21 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-1)

URL:
  <http://savannah.gnu.org/bugs/?19126>

                 Summary: Cleanups in src/ui/terminal/main.c
                 Project: PSPP
            Submitted by: blp
            Submitted on: Thursday 02/22/07 at 21:44
                Category: Other
                Severity: 1 - Wishlist
                  Status: None
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None

    _______________________________________________________

Details:

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.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?19126>

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





reply via email to

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