From 3b1577ab7eb2000a3477a0aa489b888fb1256434 Mon Sep 17 00:00:00 2001 From: lurumdare <8020186+lurumdare@users.noreply.github.com> Date: 周六, 07 9月 2019 20:40:25 +0800 Subject: [PATCH] const everywhere (#30) --- src/library/os/os-win.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/library/os/os-win.c b/src/library/os/os-win.c index d847405..a5a3bde 100644 --- a/src/library/os/os-win.c +++ b/src/library/os/os-win.c @@ -16,7 +16,7 @@ FUNCTION_RETURN result = FUNC_RET_ERROR; char buffer[MAX_COMPUTERNAME_LENGTH + 1]; int bufsize = MAX_COMPUTERNAME_LENGTH + 1; - BOOL cmpName = GetComputerName(buffer, &bufsize); + const BOOL cmpName = GetComputerName(buffer, &bufsize); if (cmpName) { strncpy(identifier, buffer, 6); result = FUNC_RET_OK; @@ -44,12 +44,12 @@ DWORD volSerial = 0; BOOL success; UINT driveType; - DWORD dwSize = MAX_PATH; + const DWORD dwSize = MAX_PATH; char szLogicalDrives[MAX_PATH] = { 0 }; unsigned char buf[8] = ""; FUNCTION_RETURN return_value; - DWORD dwResult = GetLogicalDriveStrings(dwSize, szLogicalDrives); + const DWORD dwResult = GetLogicalDriveStrings(dwSize, szLogicalDrives); if (dwResult > 0 && dwResult <= MAX_PATH) { return_value = FUNC_RET_OK; @@ -184,7 +184,7 @@ FUNCTION_RETURN getModuleName(char buffer[MAX_PATH]) { FUNCTION_RETURN result = FUNC_RET_OK; - DWORD wres = GetModuleFileName(NULL, buffer, MAX_PATH); + const DWORD wres = GetModuleFileName(NULL, buffer, MAX_PATH); if (wres == 0) { result = FUNC_RET_ERROR; } -- Gitblit v1.9.1