]> sourceware.org Git - newlib-cygwin.git/commitdiff
Remove initialization of static or global values to zero, throughout. This
authorChristopher Faylor <me@cgf.cx>
Thu, 6 Sep 2001 04:41:59 +0000 (04:41 +0000)
committerChristopher Faylor <me@cgf.cx>
Thu, 6 Sep 2001 04:41:59 +0000 (04:41 +0000)
just needlessly grows the size of the DLL.
* tty.cc (tty::alive): Make inuse handle non-inheriting on open, just for
thread safety.

20 files changed:
winsup/cygwin/ChangeLog
winsup/cygwin/dcrt0.cc
winsup/cygwin/dll_init.cc
winsup/cygwin/environ.cc
winsup/cygwin/external.cc
winsup/cygwin/fhandler.cc
winsup/cygwin/fhandler_clipboard.cc
winsup/cygwin/fhandler_socket.cc
winsup/cygwin/fhandler_tty.cc
winsup/cygwin/fork.cc
winsup/cygwin/grp.cc
winsup/cygwin/heap.cc
winsup/cygwin/localtime.cc
winsup/cygwin/malloc_wrapper.cc
winsup/cygwin/net.cc
winsup/cygwin/ntea.cc
winsup/cygwin/pinfo.cc
winsup/cygwin/shared.cc
winsup/cygwin/shortcut.c
winsup/cygwin/tty.cc

index d256cc263b5190a10fb9140d2588593253a56780..69bdb99a88faffc1fcaa105cce1342817e2fd271 100644 (file)
@@ -1,3 +1,10 @@
+Thu Sep  6 00:40:35 2001  Christopher Faylor <cgf@cygnus.com>
+
+       Remove initialization of static or global values to zero, throughout.
+       This just needlessly grows the size of the DLL.
+       * tty.cc (tty::alive): Make inuse handle non-inheriting on open, just
+       for thread safety.
+
 Wed Sep  5 23:36:03 2001  Christopher Faylor <cgf@cygnus.com>
 
        * cygheap.h (init_cygheap): Move bucket array here from cygheap.cc.
index f4acc8d4468ee0569a2c253c2e0e46fcf3f37ca8..43940b435ea236f10fc711edd4cc644814b36958 100644 (file)
@@ -54,12 +54,12 @@ per_thread NO_COPY *threadstuff[] = {&waitq_storage,
                                     &signal_dispatch_storage,
                                     NULL};
 
-BOOL display_title = FALSE;
-BOOL strip_title_path = FALSE;
+BOOL display_title;
+BOOL strip_title_path;
 BOOL allow_glob = TRUE;
 codepage_type current_codepage = ansi_cp;
 
-int cygwin_finished_initializing = 0;
+int cygwin_finished_initializing;
 
 /* Used in SIGTOMASK for generating a bit for insertion into a sigset_t.
    This is subtracted from the signal number prior to shifting the bit.
@@ -86,7 +86,7 @@ extern "C"
   char **__cygwin_environ;
   char ***main_environ;
   /* __progname used in getopt error message */
-  char *__progname = NULL;
+  char *__progname;
   struct _reent reent_data = _REENT_INIT(reent_data);
   struct per_process __cygwin_user_data =
   {/* initial_sp */ 0, /* magic_biscuit */ 0,
@@ -110,14 +110,14 @@ extern "C"
    /* resourcelocks */ &_reslock, /* threadinterface */ &_mtinterf,
    /* impure_ptr */ &reent_data,
   };
-  bool ignore_case_with_glob = FALSE;
+  bool ignore_case_with_glob;
   int __declspec (dllexport) _check_for_executable = TRUE;
 #ifdef DEBUGGING
-  int pinger = 0;
+  int pinger;
 #endif
 };
 
-char *old_title = NULL;
+char *old_title;
 char title_buf[TITLESIZE + 1];
 
 static void
@@ -621,8 +621,8 @@ alloc_stack (child_info_fork *ci)
 }
 
 static NO_COPY int mypid = 0;
-int _declspec(dllexport) __argc = 0;
-char _declspec(dllexport) **__argv = NULL;
+int _declspec(dllexport) __argc;
+char _declspec(dllexport) **__argv;
 
 void
 sigthread::init (const char *s)
index 6a299d45b7f11e7f17098a40f00038502e7205ef..74bec0769790b82f002245e3794c7fbd86be82fb 100644 (file)
@@ -18,8 +18,8 @@ extern void __stdcall check_sanity_and_sync (per_process *);
 
 dll_list NO_COPY dlls;
 
-static NO_COPY int in_forkee = 0;
-static int dll_global_dtors_recorded = 0;
+static NO_COPY int in_forkee;
+static int dll_global_dtors_recorded;
 
 /* Run destructors for all DLLs on exit. */
 static void
index 0e4e3310aab5f16dc0d8b9c14a25b28bce17df50..ab57663751c1f1f7adb0381d2885fff5621456ac 100644 (file)
@@ -40,7 +40,7 @@ extern int subauth_id;
 BOOL reset_com = TRUE;
 static BOOL envcache = TRUE;
 
-static char **lastenviron = NULL;
+static char **lastenviron;
 
 #define ENVMALLOC \
   (CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor) \
@@ -641,7 +641,7 @@ environ_init (char **envp, int envc)
   bool envp_passed_in;
   static char cygterm[] = "TERM=cygwin";
 
-  static int initted = 0;
+  static int initted;
   if (!initted)
     {
       for (int i = 0; conv_envvars[i].name != NULL; i++)
index 4eed55fb6e9cd860b724d1ad285e8f4ec93e6f22..9bbdc602444c81c64157fced21e3f78d96aaf3e3 100644 (file)
@@ -35,7 +35,7 @@ fillout_pinfo (pid_t pid, int winpid)
   if (!pids.npids || !nextpid)
     pids.init (winpid);
 
-  static unsigned int i = 0;
+  static unsigned int i;
   if (!pid)
     i = 0;
 
index 115a4c796e42fb9da931edd7fde17e070793c63e..6dd65bd59ce29b2713e4529112854a5f7209bd4b 100644 (file)
@@ -30,9 +30,9 @@ static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */
 
 static char fhandler_disk_dummy_name[] = "some disk file";
 
-struct __cygwin_perfile *perfile_table = NULL;
+struct __cygwin_perfile *perfile_table;
 
-DWORD binmode = 0;
+DWORD binmode;
 
 inline fhandler_base&
 fhandler_base::operator =(fhandler_base &x)
index ad7ec873341a6e11e926fd7231c497a614b2b355..97aaad88403af1096feb463fdf19d0a49a6aca14 100644 (file)
@@ -30,7 +30,7 @@ details. */
 
 static const char *CYGWIN_NATIVE = "CYGWIN_NATIVE_CLIPBOARD";
 /* this is MT safe because windows format id's are atomic */
-static UINT cygnativeformat = 0;
+static UINT cygnativeformat;
 
 fhandler_dev_clipboard::fhandler_dev_clipboard (const char *name):
 fhandler_base (FH_CLIPBOARD, name)
index 830ced5ae5991ee7fe4dc6c3692340d523027867..aabaa47b772b5e1dec6f001fe1748aba4db2fdfb 100644 (file)
@@ -35,7 +35,7 @@
 #define ENTROPY_SOURCE_NAME "/dev/urandom"
 #define ENTROPY_SOURCE_DEV_UNIT 9
 
-fhandler_dev_random* entropy_source = NULL;
+fhandler_dev_random* entropy_source;
 
 /**********************************************************************/
 /* fhandler_socket */
index d5c5f739bf0142bf8bf976290d8e30bf78cc8759..e3ca86d558f8dc609c5510d7b9288760b82f5567 100644 (file)
@@ -109,7 +109,7 @@ public:
   const char *tname;
 } ostack[100];
 
-static int osi = 0;
+static int osi;
 #endif /*DEBUGGING*/
 
 DWORD
index 173c02b1b9fabd9810eb9201ffc7820dec2ddeee..696daaf05d6123d9afa5f51707a8e89343a2082c 100644 (file)
@@ -30,9 +30,9 @@ details. */
 #include "dll_init.h"
 
 #ifdef DEBUGGING
-static int npid = 0;
-static int npid_max = 0;
-static pid_t fork_pids[100] = {0};
+static int npid;
+static int npid_max;
+static pid_t fork_pids[100];
 #endif
 
 DWORD NO_COPY chunksize = 0;
index 600302c957c010ddbd23c19728ddf9cbd6cac191..e73c9a0584226f23708260a704eb4cd5b5b9b51b 100644 (file)
@@ -31,9 +31,9 @@ details. */
    on the first call that needs information from it. */
 
 static NO_COPY const char *etc_group = "/etc/group";
-static struct group *group_buf = NULL;         /* group contents in memory */
-static int curr_lines = 0;
-static int max_lines = 0;
+static struct group *group_buf;                /* group contents in memory */
+static int curr_lines;
+static int max_lines;
 
 /* Position in the group cache */
 #ifdef _MT_SAFE
index 6d217cab3d64b59f23211e47ec7214fc79de40f6..3fd6d54656ea5d4d032495746adefd7674fbca5a 100644 (file)
@@ -19,7 +19,7 @@ details. */
 
 #define assert(x)
 
-static unsigned page_const = 0;
+static unsigned page_const;
 
 extern "C" size_t getpagesize ();
 
index 573ec8c8c806e61346e62517f8972f42184293f7..daf888a04d067d799e1e010635984bfb3ab2aebd 100644 (file)
@@ -640,12 +640,12 @@ static struct tm  tm;
 #undef _daylight
 
 #ifdef USG_COMPAT
-time_t                 timezone = 0;
-int                    daylight = 0;
+time_t                 timezone;
+int                    daylight;
 #endif /* defined USG_COMPAT */
 
 #ifdef ALTZONE
-time_t                 altzone = 0;
+time_t                 altzone;
 #endif /* defined ALTZONE */
 
 static long
index 43bb0c52ad90cc6cd08684cad3fdf09d2cfa6aaf..783fec956314a4037a37d9301ebf4a4f5d1ab949 100644 (file)
@@ -28,7 +28,7 @@ details. */
    problems if malloced on our heap and free'd on theirs.
 */
 
-static int export_malloc_called = 0;
+static int export_malloc_called;
 static int use_internal_malloc = 1;
 
 #undef in
index 1715b16cb05bdf386511c180695b10363fb5b25d..34489da8e833416584d5ce7cf38175dba8b6b499 100644 (file)
@@ -1072,8 +1072,8 @@ cygwin_gethostbyname (const char *name)
 {
   static unsigned char tmp_addr[4];
   static struct hostent tmp;
-  static char *tmp_aliases[1] = {0};
-  static char *tmp_addr_list[2] = {0, 0};
+  static char *tmp_aliases[1];
+  static char *tmp_addr_list[2];
   static int a, b, c, d;
 
   if (sscanf (name, "%d.%d.%d.%d", &a, &b, &c, &d) == 4)
index 1d5c77cd4cacbfbeac23cc082a42555feee57077..421610060f2316812c6e2c9995865c3d10be52e5 100644 (file)
@@ -16,7 +16,7 @@ details. */
 #include "security.h"
 
 /* Default to not using NTEA information */
-BOOL allow_ntea = FALSE;
+BOOL allow_ntea;
 
 /*
 From Windows NT DDK:
index 63ecce4e5d27ec1f7415a8bd156a2be92e854bda..14e8b819b20843af9e15f26ece0e0c4da87180ef 100644 (file)
@@ -31,7 +31,7 @@ static char NO_COPY pinfo_dummy[sizeof(pinfo)] = {0};
 
 pinfo NO_COPY myself ((_pinfo *)&pinfo_dummy); // Avoid myself != NULL checks
 
-HANDLE hexec_proc = NULL;
+HANDLE hexec_proc;
 
 void __stdcall
 pinfo_fixup_after_fork ()
@@ -319,7 +319,7 @@ winpids::add (DWORD& nelem, bool winpid, DWORD pid)
 DWORD
 winpids::enumNT (bool winpid)
 {
-  static DWORD szprocs = 0;
+  static DWORD szprocs;
   static SYSTEM_PROCESSES *procs;
 
   DWORD nelem = 0;
index 91fc48e5f540162ea4498fadd85b9d452eae390a..5622765fa941428975f26627a116f28d270bba9a 100644 (file)
@@ -31,7 +31,7 @@ details. */
 
 shared_info NO_COPY *cygwin_shared = NULL;
 mount_info NO_COPY *mount_table = NULL;
-HANDLE cygwin_mount_h = NULL;
+HANDLE cygwin_mount_h;
 
 /* General purpose security attribute objects for global use. */
 SECURITY_ATTRIBUTES NO_COPY sec_none;
index 1aaa5de9e555b23ec3d641600bcd05c524cda3bb..fd684e83bf17e692cc72ed2086a3e704353da9f7 100644 (file)
@@ -39,7 +39,7 @@ has_exec_chars (const char *buf, int len)
 }
 
 char shortcut_header[SHORTCUT_HDR_SIZE];
-BOOL shortcut_initalized = FALSE;
+BOOL shortcut_initalized;
 
 void
 create_shortcut_header (void)
index 613aa2969b12e8a6b3f2d8c1cd82e53d33d39258..7edfdd217aab67b90ea7a6b49da5ffcb5879a6bf 100644 (file)
@@ -295,7 +295,7 @@ tty::alive (const char *fmt)
   char buf[sizeof (TTY_MASTER_ALIVE) + 16];
 
   __small_sprintf (buf, fmt, ntty);
-  if ((ev = OpenEvent (EVENT_ALL_ACCESS, TRUE, buf)))
+  if ((ev = OpenEvent (EVENT_ALL_ACCESS, FALSE, buf)))
     CloseHandle (ev);
   return ev != NULL;
 }
This page took 0.054668 seconds and 5 git commands to generate.