From 717d7441954d23988f7ec60b388f3e67319ca953 Mon Sep 17 00:00:00 2001 From: freedom7341 Date: Wed, 4 Oct 2023 13:27:22 -0600 Subject: [PATCH] really round up --- progmgr/group.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/progmgr/group.c b/progmgr/group.c index 7b581eb..74ddeb9 100644 --- a/progmgr/group.c +++ b/progmgr/group.c @@ -99,7 +99,7 @@ HWND CreateGroup(_In_ PGROUP pgrp) // allocate memory for a new group pGroup = (PGROUP)malloc(CalculateGroupMemory(pgrp, 0)); - // Get group minimized/maximized flags + // TODO: get group minimized/maximized flags mcs.szClass = szGrpClass; mcs.szTitle = pgrp->szName; @@ -253,10 +253,9 @@ UINT CalculateGroupMemory(_In_ PGROUP pGroup, _In_ UINT cItems) // to 16 if there's less than 16 items so we always // have some memory ready cItemBlock = pGroup->cItemArray + cItems; - cItemBlock = cItemBlock > 16 ? cItemBlock : 16; // round the amount of items to the nearest but highest 16 - cItemBlock = (cItemBlock / 16) * 16; + cItemBlock = ((cItemBlock + 16) / 16) * 16; // finally calculate the total group size cbGroupSize += cItemBlock * sizeof(ITEM);