msvcrt: Constify some character strings
Frédéric Delanoy
frederic.delanoy at gmail.com
Tue Dec 17 15:17:38 CST 2013
---
dlls/msvcrt/errno.c | 86 ++++++++++++++++++++++++++---------------------------
1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/dlls/msvcrt/errno.c b/dlls/msvcrt/errno.c
index fe0a8d0..4252c17 100644
--- a/dlls/msvcrt/errno.c
+++ b/dlls/msvcrt/errno.c
@@ -34,48 +34,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";
-
-char *MSVCRT__sys_errlist[] =
+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";
+
+const char *MSVCRT__sys_errlist[] =
{
str_success,
str_EPERM,
@@ -266,7 +266,7 @@ char* CDECL MSVCRT_strerror(int err)
*/
int CDECL strerror_s(char *buffer, MSVCRT_size_t numberOfElements, int errnum)
{
- char *ptr;
+ const char *ptr;
if (!buffer || !numberOfElements)
{
--
1.8.5
More information about the wine-patches
mailing list