OSDN Git Service

Move appropriate variables to NO_COPY segment, throughout.
authorcgf <cgf>
Thu, 6 Sep 2001 05:17:22 +0000 (05:17 +0000)
committercgf <cgf>
Thu, 6 Sep 2001 05:17:22 +0000 (05:17 +0000)
17 files changed:
winsup/cygwin/ChangeLog
winsup/cygwin/dcrt0.cc
winsup/cygwin/dll_init.cc
winsup/cygwin/dtable.cc
winsup/cygwin/environ.cc
winsup/cygwin/errno.cc
winsup/cygwin/fhandler.cc
winsup/cygwin/fhandler_clipboard.cc
winsup/cygwin/fhandler_console.cc
winsup/cygwin/localtime.cc
winsup/cygwin/miscfuncs.cc
winsup/cygwin/net.cc
winsup/cygwin/path.cc
winsup/cygwin/registry.cc
winsup/cygwin/tz_posixrules.h
winsup/cygwin/window.cc
winsup/cygwin/winsup.h

index 69bdb99..ee455ca 100644 (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>
 
        Remove initialization of static or global values to zero, throughout.
index 43940b4..ae95c8b 100644 (file)
@@ -67,7 +67,7 @@ int cygwin_finished_initializing;
    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;
index 74bec07..265ebf8 100644 (file)
@@ -18,7 +18,7 @@ extern void __stdcall check_sanity_and_sync (per_process *);
 
 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. */
index 8e4d40b..0b3ad25 100644 (file)
@@ -32,7 +32,7 @@ details. */
 #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 */
index ab57663..cc127ad 100644 (file)
@@ -53,7 +53,7 @@ static char **lastenviron;
    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,
@@ -110,7 +110,7 @@ getwinenv (const char *env, const char *in_posix)
   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",
@@ -477,7 +477,7 @@ subauth_id_init (const char *buf)
 /* 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
@@ -495,7 +495,7 @@ struct parse_thing
        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}}},
@@ -639,7 +639,7 @@ environ_init (char **envp, int envc)
   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)
@@ -743,7 +743,7 @@ env_sort (const void *a, const void *b)
 }
 
 /* Keep this list in upper case and sorted */
-const char* forced_winenv_vars [] =
+static const NO_COPY char* forced_winenv_vars [] =
   {
     "SYSTEMDRIVE",
     "SYSTEMROOT",
index f9a3ca1..540951c 100644 (file)
@@ -21,7 +21,7 @@ details. */
 
 #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 */
@@ -145,7 +145,7 @@ seterrno (const char *file, int line)
 
 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",
@@ -287,7 +287,7 @@ extern const char __declspec(dllexport) * const _sys_errlist[]=
 /* 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:
index 6dd65bd..88b80af 100644 (file)
@@ -28,7 +28,7 @@ details. */
 
 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;
 
index 97aaad8..6a22855 100644 (file)
@@ -28,7 +28,7 @@ details. */
  * 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;
 
index 9bb6c09..98155c9 100644 (file)
@@ -1646,7 +1646,7 @@ fhandler_console::write (const void *vsrc, size_t len)
 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"}},
index daf888a..43c64ce 100644 (file)
@@ -499,9 +499,9 @@ struct tzhead {
 #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 */
index 49e7ceb..1dfff73 100644 (file)
@@ -14,7 +14,7 @@ details. */
 
 /********************** 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, '(', ')', '*', '+', ',', '-', '.', '/',
@@ -33,7 +33,7 @@ char case_folded_lower[] = {
  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, '(', ')', '*', '+', ',', '-', '.', '/',
index 34489da..18ff29b 100644 (file)
@@ -286,7 +286,7 @@ struct tl
   int e;
 };
 
-static struct tl errmap[] =
+static NO_COPY struct tl errmap[] =
 {
  {WSAEINTR, "WSAEINTR", EINTR},
  {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
  * 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},
index 7e32ae8..57e4e2c 100644 (file)
@@ -740,7 +740,7 @@ digits (const char *name)
   return p > name && !*p ? n : -1;
 }
 
-const char *windows_device_names[] =
+const char *windows_device_names[] NO_COPY =
 {
   NULL,
   "\\dev\\console",
index 1d3cce5..9e91d1a 100644 (file)
@@ -14,7 +14,7 @@ details. */
 #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, ...)
 {
index 6059d67..dea668e 100644 (file)
@@ -1,6 +1,6 @@
 /* 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,
index 761db25..4e6ddc9 100644 (file)
@@ -74,7 +74,7 @@ Winmain (VOID *)
 {
   MSG msg;
   WNDCLASS wc;
-  static char classname[] = "CygwinWndClass";
+  static const NO_COPY char classname[] = "CygwinWndClass";
 
   /* Register the window class for the main window. */
 
index 1b73a2f..1b8c155 100644 (file)
@@ -35,9 +35,9 @@ details. */
 #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