msvcrt: Constify some variables

Andrew Talbot Andrew.Talbot at talbotville.com
Sat Feb 17 13:25:02 CST 2007


Changelog:
    msvcrt: Constify some variables.

diff -urN a/dlls/msvcrt/ctype.c b/dlls/msvcrt/ctype.c
--- a/dlls/msvcrt/ctype.c	2006-09-11 12:05:53.000000000 +0100
+++ b/dlls/msvcrt/ctype.c	2007-02-17 19:04:33.000000000 +0000
@@ -30,7 +30,7 @@
 #define _U_ MSVCRT__UPPER
 #define _L_ MSVCRT__LOWER
 
-WORD MSVCRT__ctype [257] = {
+const WORD MSVCRT__ctype [257] = {
   0, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _S_|_C_, _S_|_C_,
   _S_|_C_, _S_|_C_, _S_|_C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_,
   _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _S_|MSVCRT__BLANK,
diff -urN a/dlls/msvcrt/errno.c b/dlls/msvcrt/errno.c
--- a/dlls/msvcrt/errno.c	2006-06-13 12:00:58.000000000 +0100
+++ b/dlls/msvcrt/errno.c	2007-02-17 19:02:33.000000000 +0000
@@ -27,48 +27,48 @@
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
 /* error strings generated with glibc strerror */
-static char str_success[]       = "Success";
-static char str_EPERM[]         = "Operation not permitted";
-static char str_ENOENT[]        = "No such file or directory";
-static char str_ESRCH[]         = "No such process";
-static char str_EINTR[]         = "Interrupted system call";
-static char str_EIO[]           = "Input/output error";
-static char str_ENXIO[]         = "No such device or address";
-static char str_E2BIG[]         = "Argument list too long";
-static char str_ENOEXEC[]       = "Exec format error";
-static char str_EBADF[]         = "Bad file descriptor";
-static char str_ECHILD[]        = "No child processes";
-static char str_EAGAIN[]        = "Resource temporarily unavailable";
-static char str_ENOMEM[]        = "Cannot allocate memory";
-static char str_EACCES[]        = "Permission denied";
-static char str_EFAULT[]        = "Bad address";
-static char str_EBUSY[]         = "Device or resource busy";
-static char str_EEXIST[]        = "File exists";
-static char str_EXDEV[]         = "Invalid cross-device link";
-static char str_ENODEV[]        = "No such device";
-static char str_ENOTDIR[]       = "Not a directory";
-static char str_EISDIR[]        = "Is a directory";
-static char str_EINVAL[]        = "Invalid argument";
-static char str_ENFILE[]        = "Too many open files in system";
-static char str_EMFILE[]        = "Too many open files";
-static char str_ENOTTY[]        = "Inappropriate ioctl for device";
-static char str_EFBIG[]         = "File too large";
-static char str_ENOSPC[]        = "No space left on device";
-static char str_ESPIPE[]        = "Illegal seek";
-static char str_EROFS[]         = "Read-only file system";
-static char str_EMLINK[]        = "Too many links";
-static char str_EPIPE[]         = "Broken pipe";
-static char str_EDOM[]          = "Numerical argument out of domain";
-static char str_ERANGE[]        = "Numerical result out of range";
-static char str_EDEADLK[]       = "Resource deadlock avoided";
-static char str_ENAMETOOLONG[]  = "File name too long";
-static char str_ENOLCK[]        = "No locks available";
-static char str_ENOSYS[]        = "Function not implemented";
-static char str_ENOTEMPTY[]     = "Directory not empty";
-static char str_EILSEQ[]        = "Invalid or incomplete multibyte or wide character";
-static char str_generic_error[] = "Unknown error";
+static const char str_success[]       = "Success";
+static const char str_EPERM[]         = "Operation not permitted";
+static const char str_ENOENT[]        = "No such file or directory";
+static const char str_ESRCH[]         = "No such process";
+static const char str_EINTR[]         = "Interrupted system call";
+static const char str_EIO[]           = "Input/output error";
+static const char str_ENXIO[]         = "No such device or address";
+static const char str_E2BIG[]         = "Argument list too long";
+static const char str_ENOEXEC[]       = "Exec format error";
+static const char str_EBADF[]         = "Bad file descriptor";
+static const char str_ECHILD[]        = "No child processes";
+static const char str_EAGAIN[]        = "Resource temporarily unavailable";
+static const char str_ENOMEM[]        = "Cannot allocate memory";
+static const char str_EACCES[]        = "Permission denied";
+static const char str_EFAULT[]        = "Bad address";
+static const char str_EBUSY[]         = "Device or resource busy";
+static const char str_EEXIST[]        = "File exists";
+static const char str_EXDEV[]         = "Invalid cross-device link";
+static const char str_ENODEV[]        = "No such device";
+static const char str_ENOTDIR[]       = "Not a directory";
+static const char str_EISDIR[]        = "Is a directory";
+static const char str_EINVAL[]        = "Invalid argument";
+static const char str_ENFILE[]        = "Too many open files in system";
+static const char str_EMFILE[]        = "Too many open files";
+static const char str_ENOTTY[]        = "Inappropriate ioctl for device";
+static const char str_EFBIG[]         = "File too large";
+static const char str_ENOSPC[]        = "No space left on device";
+static const char str_ESPIPE[]        = "Illegal seek";
+static const char str_EROFS[]         = "Read-only file system";
+static const char str_EMLINK[]        = "Too many links";
+static const char str_EPIPE[]         = "Broken pipe";
+static const char str_EDOM[]          = "Numerical argument out of domain";
+static const char str_ERANGE[]        = "Numerical result out of range";
+static const char str_EDEADLK[]       = "Resource deadlock avoided";
+static const char str_ENAMETOOLONG[]  = "File name too long";
+static const char str_ENOLCK[]        = "No locks available";
+static const char str_ENOSYS[]        = "Function not implemented";
+static const char str_ENOTEMPTY[]     = "Directory not empty";
+static const char str_EILSEQ[]        = "Invalid or incomplete multibyte or wide character";
+static const char str_generic_error[] = "Unknown error";
 
-char *MSVCRT__sys_errlist[] =
+const char *MSVCRT__sys_errlist[] =
 {
     str_success,
     str_EPERM,



More information about the wine-patches mailing list