Move appropriate variables to NO_COPY segment, throughout.

This commit is contained in:
Christopher Faylor 2001-09-06 05:17:22 +00:00
parent 08b78edf5a
commit 57c89867f5
17 changed files with 31 additions and 27 deletions

View File

@ -1,3 +1,7 @@
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> Thu Sep 6 00:40:35 2001 Christopher Faylor <cgf@cygnus.com>
Remove initialization of static or global values to zero, throughout. Remove initialization of static or global values to zero, throughout.

View File

@ -67,7 +67,7 @@ int cygwin_finished_initializing;
bit for masking. So, we'll temporarily detect this and set it to zero 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 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. */ 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; ResourceLocks _reslock NO_COPY;
MTinterface _mtinterf NO_COPY; MTinterface _mtinterf NO_COPY;

View File

@ -18,7 +18,7 @@ extern void __stdcall check_sanity_and_sync (per_process *);
dll_list NO_COPY dlls; dll_list NO_COPY dlls;
static NO_COPY int in_forkee; static NO_COPY int in_forkee = 0;
static int dll_global_dtors_recorded; static int dll_global_dtors_recorded;
/* Run destructors for all DLLs on exit. */ /* Run destructors for all DLLs on exit. */

View File

@ -32,7 +32,7 @@ details. */
#include "dtable.h" #include "dtable.h"
#include "cygheap.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}; STD_ERROR_HANDLE};
/* Set aside space for the table of fds */ /* Set aside space for the table of fds */

View File

@ -53,7 +53,7 @@ static char **lastenviron;
CreateProcess. HOME is here because most shells use it and would be CreateProcess. HOME is here because most shells use it and would be
confused by Windows style path names. */ confused by Windows style path names. */
static int return_MAX_PATH (const char *) {return MAX_PATH;} 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, {"PATH=", 5, NULL, NULL, cygwin_win32_to_posix_path_list,
cygwin_posix_to_win32_path_list, cygwin_posix_to_win32_path_list,
@ -110,7 +110,7 @@ getwinenv (const char *env, const char *in_posix)
for (int i = 0; conv_envvars[i].name != NULL; i++) for (int i = 0; conv_envvars[i].name != NULL; i++)
if (strncmp (env, conv_envvars[i].name, conv_envvars[i].namelen) == 0) 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; const char *val;
if (!cur_environ () || !(val = in_posix ?: getenv(we->name))) if (!cur_environ () || !(val = in_posix ?: getenv(we->name)))
debug_printf ("can't set native for %s since no environ yet", debug_printf ("can't set native for %s since no environ yet",
@ -477,7 +477,7 @@ subauth_id_init (const char *buf)
/* The structure below is used to set up an array which is used to /* The structure below is used to set up an array which is used to
parse the CYGWIN environment variable or, if enabled, options from parse the CYGWIN environment variable or, if enabled, options from
the registry. */ the registry. */
struct parse_thing static struct parse_thing
{ {
const char *name; const char *name;
union parse_setting union parse_setting
@ -495,7 +495,7 @@ struct parse_thing
DWORD i; DWORD i;
const char *s; const char *s;
} values[2]; } values[2];
} known[] = } known[] NO_COPY =
{ {
{"binmode", {x: &binmode}, justset, NULL, {{O_TEXT}, {O_BINARY}}}, {"binmode", {x: &binmode}, justset, NULL, {{O_TEXT}, {O_BINARY}}},
{"check_case", {func: &check_case_init}, isfunc, NULL, {{0}, {0}}}, {"check_case", {func: &check_case_init}, isfunc, NULL, {{0}, {0}}},
@ -639,7 +639,7 @@ environ_init (char **envp, int envc)
char *newp; char *newp;
int sawTERM = 0; int sawTERM = 0;
bool envp_passed_in; bool envp_passed_in;
static char cygterm[] = "TERM=cygwin"; static char NO_COPY cygterm[] = "TERM=cygwin";
static int initted; static int initted;
if (!initted) if (!initted)
@ -743,7 +743,7 @@ env_sort (const void *a, const void *b)
} }
/* Keep this list in upper case and sorted */ /* Keep this list in upper case and sorted */
const char* forced_winenv_vars [] = static const NO_COPY char* forced_winenv_vars [] =
{ {
"SYSTEMDRIVE", "SYSTEMDRIVE",
"SYSTEMROOT", "SYSTEMROOT",

View File

@ -21,7 +21,7 @@ details. */
#define X(w, e) {ERROR_##w, #w, e} #define X(w, e) {ERROR_##w, #w, e}
static const struct static const NO_COPY struct
{ {
DWORD w; /* windows version of error */ DWORD w; /* windows version of error */
const char *s; /* text of windows version */ const char *s; /* text of windows version */
@ -145,7 +145,7 @@ seterrno (const char *file, int line)
extern char *_user_strerror _PARAMS ((int)); 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", /* NOERROR 0 */ "No error",
/* EPERM 1 */ "Not super-user", /* EPERM 1 */ "Not super-user",
@ -287,7 +287,7 @@ extern const char __declspec(dllexport) * const _sys_errlist[]=
/* ECASECLASH 137 */ "Filename exists with different case" /* 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]); sizeof (_sys_errlist) / sizeof (_sys_errlist[0]);
/* FIXME: Why is strerror() a long switch and not just: /* FIXME: Why is strerror() a long switch and not just:

View File

@ -28,7 +28,7 @@ details. */
static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */ 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; struct __cygwin_perfile *perfile_table;

View File

@ -28,7 +28,7 @@ details. */
* changed? How does /dev/clipboard operate under (say) linux? * 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 */ /* this is MT safe because windows format id's are atomic */
static UINT cygnativeformat; static UINT cygnativeformat;

View File

@ -1646,7 +1646,7 @@ fhandler_console::write (const void *vsrc, size_t len)
static struct { static struct {
int vk; int vk;
const char *val[4]; const char *val[4];
} keytable[] = { } const keytable[] NO_COPY = {
/* NORMAL */ /* SHIFT */ /* CTRL */ /* ALT */ /* NORMAL */ /* SHIFT */ /* CTRL */ /* ALT */
{VK_LEFT, {"\033[D", "\033[D", "\033[D", "\033\033[D"}}, {VK_LEFT, {"\033[D", "\033[D", "\033[D", "\033\033[D"}},
{VK_RIGHT, {"\033[C", "\033[C", "\033[C", "\033\033[C"}}, {VK_RIGHT, {"\033[C", "\033[C", "\033[C", "\033\033[C"}},

View File

@ -499,9 +499,9 @@ struct tzhead {
#define WILDABBR " " #define WILDABBR " "
#endif /* !defined 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 */ struct ttinfo { /* time type information */
long tt_gmtoff; /* UTC offset in seconds */ long tt_gmtoff; /* UTC offset in seconds */

View File

@ -14,7 +14,7 @@ details. */
/********************** String Helper Functions ************************/ /********************** 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, 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, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, '!', '"', '#', '$', '%', '&', 39, '(', ')', '*', '+', ',', '-', '.', '/', 32, '!', '"', '#', '$', '%', '&', 39, '(', ')', '*', '+', ',', '-', '.', '/',
@ -33,7 +33,7 @@ char case_folded_lower[] = {
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 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, 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, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, '!', '"', '#', '$', '%', '&', 39, '(', ')', '*', '+', ',', '-', '.', '/', 32, '!', '"', '#', '$', '%', '&', 39, '(', ')', '*', '+', ',', '-', '.', '/',

View File

@ -286,7 +286,7 @@ struct tl
int e; int e;
}; };
static struct tl errmap[] = static NO_COPY struct tl errmap[] =
{ {
{WSAEINTR, "WSAEINTR", EINTR}, {WSAEINTR, "WSAEINTR", EINTR},
{WSAEWOULDBLOCK, "WSAEWOULDBLOCK", EWOULDBLOCK}, {WSAEWOULDBLOCK, "WSAEWOULDBLOCK", EWOULDBLOCK},
@ -356,7 +356,7 @@ __set_winsock_errno (const char *fn, int ln)
* Since the member `s' isn't used for debug output we can use it * Since the member `s' isn't used for debug output we can use it
* for the error text returned by herror and hstrerror. * 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}, {WSAHOST_NOT_FOUND, "Unknown host", HOST_NOT_FOUND},
{WSATRY_AGAIN, "Host name lookup failure", TRY_AGAIN}, {WSATRY_AGAIN, "Host name lookup failure", TRY_AGAIN},

View File

@ -740,7 +740,7 @@ digits (const char *name)
return p > name && !*p ? n : -1; return p > name && !*p ? n : -1;
} }
const char *windows_device_names[] = const char *windows_device_names[] NO_COPY =
{ {
NULL, NULL,
"\\dev\\console", "\\dev\\console",

View File

@ -14,7 +14,7 @@ details. */
#include "security.h" #include "security.h"
#include <cygwin/version.h> #include <cygwin/version.h>
char cygnus_class[] = "cygnus"; static char NO_COPY cygnus_class[] = "cygnus";
reg_key::reg_key (HKEY top, REGSAM access, ...) reg_key::reg_key (HKEY top, REGSAM access, ...)
{ {

View File

@ -1,6 +1,6 @@
/* generated with bin2h from zoneinfo/posixrules */ /* 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,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, 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, 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,

View File

@ -74,7 +74,7 @@ Winmain (VOID *)
{ {
MSG msg; MSG msg;
WNDCLASS wc; WNDCLASS wc;
static char classname[] = "CygwinWndClass"; static const NO_COPY char classname[] = "CygwinWndClass";
/* Register the window class for the main window. */ /* Register the window class for the main window. */

View File

@ -35,9 +35,9 @@ details. */
#include <sys/types.h> #include <sys/types.h>
#include <sys/strace.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)]) #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)]) #define cyg_toupper(c) (case_folded_upper[(unsigned char)(c)])
#ifndef MALLOC_DEBUG #ifndef MALLOC_DEBUG