+Thu Sep 6 01:16:44 2001 Christopher Faylor <cgf@cygnus.com>
+
+ Move appropriate variables to NO_COPY segment, throughout.
+
Thu Sep 6 00:40:35 2001 Christopher Faylor <cgf@cygnus.com>
Remove initialization of static or global values to zero, throughout.
bit for masking. So, we'll temporarily detect this and set it to zero
for programs that are linked using older cygwins. This is just a stopgap
measure to allow an orderly transfer to the new, correct sigmask method. */
-unsigned int signal_shift_subtract = 1;
+unsigned NO_COPY int signal_shift_subtract = 1;
ResourceLocks _reslock NO_COPY;
MTinterface _mtinterf NO_COPY;
dll_list NO_COPY dlls;
-static NO_COPY int in_forkee;
+static NO_COPY int in_forkee = 0;
static int dll_global_dtors_recorded;
/* Run destructors for all DLLs on exit. */
#include "dtable.h"
#include "cygheap.h"
-static DWORD std_consts[] = {STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
+static const NO_COPY DWORD std_consts[] = {STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
STD_ERROR_HANDLE};
/* Set aside space for the table of fds */
CreateProcess. HOME is here because most shells use it and would be
confused by Windows style path names. */
static int return_MAX_PATH (const char *) {return MAX_PATH;}
-static win_env conv_envvars[] =
+static NO_COPY win_env conv_envvars[] =
{
{"PATH=", 5, NULL, NULL, cygwin_win32_to_posix_path_list,
cygwin_posix_to_win32_path_list,
for (int i = 0; conv_envvars[i].name != NULL; i++)
if (strncmp (env, conv_envvars[i].name, conv_envvars[i].namelen) == 0)
{
- win_env *we = conv_envvars + i;
+ win_env * const we = conv_envvars + i;
const char *val;
if (!cur_environ () || !(val = in_posix ?: getenv(we->name)))
debug_printf ("can't set native for %s since no environ yet",
/* The structure below is used to set up an array which is used to
parse the CYGWIN environment variable or, if enabled, options from
the registry. */
-struct parse_thing
+static struct parse_thing
{
const char *name;
union parse_setting
DWORD i;
const char *s;
} values[2];
- } known[] =
+ } known[] NO_COPY =
{
{"binmode", {x: &binmode}, justset, NULL, {{O_TEXT}, {O_BINARY}}},
{"check_case", {func: &check_case_init}, isfunc, NULL, {{0}, {0}}},
char *newp;
int sawTERM = 0;
bool envp_passed_in;
- static char cygterm[] = "TERM=cygwin";
+ static char NO_COPY cygterm[] = "TERM=cygwin";
static int initted;
if (!initted)
}
/* Keep this list in upper case and sorted */
-const char* forced_winenv_vars [] =
+static const NO_COPY char* forced_winenv_vars [] =
{
"SYSTEMDRIVE",
"SYSTEMROOT",
#define X(w, e) {ERROR_##w, #w, e}
-static const struct
+static const NO_COPY struct
{
DWORD w; /* windows version of error */
const char *s; /* text of windows version */
extern char *_user_strerror _PARAMS ((int));
-extern const char __declspec(dllexport) * const _sys_errlist[]=
+extern const NO_COPY char __declspec(dllexport) * const _sys_errlist[]=
{
/* NOERROR 0 */ "No error",
/* EPERM 1 */ "Not super-user",
/* ECASECLASH 137 */ "Filename exists with different case"
};
-int __declspec(dllexport) _sys_nerr =
+int NO_COPY __declspec(dllexport) _sys_nerr =
sizeof (_sys_errlist) / sizeof (_sys_errlist[0]);
/* FIXME: Why is strerror() a long switch and not just:
static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */
-static char fhandler_disk_dummy_name[] = "some disk file";
+static NO_COPY char fhandler_disk_dummy_name[] = "some disk file";
struct __cygwin_perfile *perfile_table;
* changed? How does /dev/clipboard operate under (say) linux?
*/
-static const char *CYGWIN_NATIVE = "CYGWIN_NATIVE_CLIPBOARD";
+static const NO_COPY char *CYGWIN_NATIVE = "CYGWIN_NATIVE_CLIPBOARD";
/* this is MT safe because windows format id's are atomic */
static UINT cygnativeformat;
static struct {
int vk;
const char *val[4];
-} keytable[] = {
+} const keytable[] NO_COPY = {
/* NORMAL */ /* SHIFT */ /* CTRL */ /* ALT */
{VK_LEFT, {"\033[D", "\033[D", "\033[D", "\033\033[D"}},
{VK_RIGHT, {"\033[C", "\033[C", "\033[C", "\033\033[C"}},
#define WILDABBR " "
#endif /* !defined WILDABBR */
-static char wildabbr[] = WILDABBR;
+static char wildabbr[] NO_COPY = WILDABBR;
-static const char gmt[] = "GMT";
+static const char gmt[] NO_COPY = "GMT";
struct ttinfo { /* time type information */
long tt_gmtoff; /* UTC offset in seconds */
/********************** String Helper Functions ************************/
-char case_folded_lower[] = {
+const char case_folded_lower[] NO_COPY = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, '!', '"', '#', '$', '%', '&', 39, '(', ')', '*', '+', ',', '-', '.', '/',
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
};
-char case_folded_upper[] = {
+const char case_folded_upper[] NO_COPY = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, '!', '"', '#', '$', '%', '&', 39, '(', ')', '*', '+', ',', '-', '.', '/',
int e;
};
-static struct tl errmap[] =
+static NO_COPY struct tl errmap[] =
{
{WSAEINTR, "WSAEINTR", EINTR},
{WSAEWOULDBLOCK, "WSAEWOULDBLOCK", EWOULDBLOCK},
* Since the member `s' isn't used for debug output we can use it
* for the error text returned by herror and hstrerror.
*/
-static struct tl host_errmap[] =
+const static NO_COPY struct tl host_errmap[] =
{
{WSAHOST_NOT_FOUND, "Unknown host", HOST_NOT_FOUND},
{WSATRY_AGAIN, "Host name lookup failure", TRY_AGAIN},
return p > name && !*p ? n : -1;
}
-const char *windows_device_names[] =
+const char *windows_device_names[] NO_COPY =
{
NULL,
"\\dev\\console",
#include "security.h"
#include <cygwin/version.h>
-char cygnus_class[] = "cygnus";
+static char NO_COPY cygnus_class[] = "cygnus";
reg_key::reg_key (HKEY top, REGSAM access, ...)
{
/* generated with bin2h from zoneinfo/posixrules */
-static unsigned char _posixrules_data[] = {
+static NO_COPY unsigned char _posixrules_data[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,
0,1,16,0,0,0,2,0,0,0,8,0,151,254,240,1,135,225,224,2,119,224,240,3,112,254,96,4,96,253,112,5,80,
224,96,6,64,223,112,7,48,194,96,7,141,25,112,9,16,164,96,9,173,148,240,10,240,134,96,11,224,133,112,12,217,162,
{
MSG msg;
WNDCLASS wc;
- static char classname[] = "CygwinWndClass";
+ static const NO_COPY char classname[] = "CygwinWndClass";
/* Register the window class for the main window. */
#include <sys/types.h>
#include <sys/strace.h>
-extern char case_folded_lower[];
+extern const char case_folded_lower[];
#define cyg_tolower(c) (case_folded_lower[(unsigned char)(c)])
-extern char case_folded_upper[];
+extern const char case_folded_upper[];
#define cyg_toupper(c) (case_folded_upper[(unsigned char)(c)])
#ifndef MALLOC_DEBUG