just needlessly grows the size of the DLL.
* tty.cc (tty::alive): Make inuse handle non-inheriting on open, just for
thread safety.
+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.
&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.
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,
/* 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
}
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)
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
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) \
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++)
if (!pids.npids || !nextpid)
pids.init (winpid);
- static unsigned int i = 0;
+ static unsigned int i;
if (!pid)
i = 0;
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)
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)
#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 */
const char *tname;
} ostack[100];
-static int osi = 0;
+static int osi;
#endif /*DEBUGGING*/
DWORD
#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;
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
#define assert(x)
-static unsigned page_const = 0;
+static unsigned page_const;
extern "C" size_t getpagesize ();
#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
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
{
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)
#include "security.h"
/* Default to not using NTEA information */
-BOOL allow_ntea = FALSE;
+BOOL allow_ntea;
/*
From Windows NT DDK:
pinfo NO_COPY myself ((_pinfo *)&pinfo_dummy); // Avoid myself != NULL checks
-HANDLE hexec_proc = NULL;
+HANDLE hexec_proc;
void __stdcall
pinfo_fixup_after_fork ()
DWORD
winpids::enumNT (bool winpid)
{
- static DWORD szprocs = 0;
+ static DWORD szprocs;
static SYSTEM_PROCESSES *procs;
DWORD nelem = 0;
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;
}
char shortcut_header[SHORTCUT_HDR_SIZE];
-BOOL shortcut_initalized = FALSE;
+BOOL shortcut_initalized;
void
create_shortcut_header (void)
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;
}