diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-02-23 19:08:31 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-02-23 19:28:03 +0900 |
commit | da18d6f0154f020733747c359b08d216db05c26a (patch) | |
tree | 1f42910f96a60ed8b4a99fdb130bed7a228f9a90 /win32 | |
parent | 19cc24b34b0490b7c2779eec521fe0089e05f183 (diff) |
Constified possible data
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/win32/win32.c b/win32/win32.c index 050582211c..fc36f75e75 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -137,7 +137,7 @@ static FARPROC get_proc_address(const char *module, const char *func, HANDLE *mh #define RUBY_CRITICAL if (0) {} else /* just remark */ /* errno mapping */ -static struct { +static const struct { DWORD winerr; int err; } errmap[] = { @@ -3318,12 +3318,12 @@ rb_w32_select(int nfds, fd_set *rd, fd_set *wr, fd_set *ex, /* License: Ruby's */ static FARPROC -get_wsa_extension_function(SOCKET s, GUID *guid) +get_wsa_extension_function(SOCKET s, GUID guid) { DWORD dmy; FARPROC ptr = NULL; - WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, guid, sizeof(*guid), + WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid), &ptr, sizeof(ptr), &dmy, NULL, NULL); if (!ptr) errno = ENOSYS; @@ -3694,8 +3694,8 @@ recvmsg(int fd, struct msghdr *msg, int flags) s = TO_SOCKET(fd); if (!pWSARecvMsg) { - static GUID guid = WSAID_WSARECVMSG; - pWSARecvMsg = (WSARecvMsg_t)get_wsa_extension_function(s, &guid); + static const GUID guid = WSAID_WSARECVMSG; + pWSARecvMsg = (WSARecvMsg_t)get_wsa_extension_function(s, guid); if (!pWSARecvMsg) return -1; } @@ -3749,8 +3749,8 @@ sendmsg(int fd, const struct msghdr *msg, int flags) s = TO_SOCKET(fd); if (!pWSASendMsg) { - static GUID guid = WSAID_WSASENDMSG; - pWSASendMsg = (WSASendMsg_t)get_wsa_extension_function(s, &guid); + static const GUID guid = WSAID_WSASENDMSG; + pWSASendMsg = (WSASendMsg_t)get_wsa_extension_function(s, guid); if (!pWSASendMsg) return -1; } @@ -5088,7 +5088,7 @@ rb_w32_read_reparse_point(const WCHAR *path, rb_w32_reparse_buffer_t *rp, *len = ret / sizeof(WCHAR); } else if (rp->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) { - static const WCHAR *volume = L"Volume{"; + static const WCHAR volume[] = L"Volume{"; enum {volume_prefix_len = rb_strlen_lit("\\??\\")}; name = ((char *)rp->MountPointReparseBuffer.PathBuffer + rp->MountPointReparseBuffer.SubstituteNameOffset + |