From fcf2d4db4563a8f94015b991b3633c8da0a39c86 Mon Sep 17 00:00:00 2001 From: Oldes Huhuman Date: Tue, 16 Apr 2024 18:59:43 +0200 Subject: [PATCH] FIX: msvc compiler warnings --- src/core/m-pools.c | 4 ++++ src/os/win32/dev-file.c | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/m-pools.c b/src/core/m-pools.c index 55c3bb4521..b9e6ec3080 100644 --- a/src/core/m-pools.c +++ b/src/core/m-pools.c @@ -278,6 +278,7 @@ const REBPOOLSPEC Mem_Pool_Spec[MAX_POOLS] = pool = &Mem_Pools[pool_id]; if (!pool->first) Fill_Pool(pool); node = pool->first; +#pragma warning(suppress: 28182) pool->first = *node; #ifdef WATCH_SERIES_POOL printf(cs_cast("*** SERIES_POOL Make_Node=> has: %u free: %u\n"), Mem_Pools[SERIES_POOL].has, Mem_Pools[SERIES_POOL].free); @@ -334,6 +335,7 @@ const REBPOOLSPEC Mem_Pool_Spec[MAX_POOLS] = pool = &Mem_Pools[pool_num]; if (!pool->first) Fill_Pool(pool); node = pool->first; +#pragma warning(suppress: 28182) pool->first = *node; pool->free--; length = pool->wide; @@ -406,9 +408,11 @@ const REBPOOLSPEC Mem_Pool_Spec[MAX_POOLS] = pool = &Mem_Pools[pool_num]; if (!pool->first) Fill_Pool(pool); node = pool->first; +#pragma warning(suppress: 28182) pool->first = *node; pool->free--; length = pool->wide; +#pragma warning(suppress: 28183) memset(node, 0, length); #ifdef WATCH_SERIES_POOL if(pool_num == SERIES_POOL) printf(cs_cast("*** SERIES_POOL Make_Series=> has: %u free: %u (size: %u)\n"), Mem_Pools[SERIES_POOL].has, Mem_Pools[SERIES_POOL].free, length); diff --git a/src/os/win32/dev-file.c b/src/os/win32/dev-file.c index b081312693..b627860fef 100644 --- a/src/os/win32/dev-file.c +++ b/src/os/win32/dev-file.c @@ -180,10 +180,11 @@ static BOOL Seek_File_64(REBREQ *file) { HANDLE h= (HANDLE)(dir->handle); REBCHR *cp = 0; - REBCNT len; + REBLEN len; if (!h) { - len = (1 + GetLogicalDriveStrings(0, NULL)) << 1; - h = MAKE_MEM(len); + len = (1 + GetLogicalDriveStrings(0, NULL)); + h = MAKE_MEM(len << 1); + if (!h) return DR_ERROR; GetLogicalDriveStrings(len, h); dir->length = len; dir->actual = 0;