From 38d88507dac6ac412d2cf2ea85b81607176cbc8f Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 14 Aug 2014 05:26:04 +0000 Subject: [PATCH] a few tests on corner cases, but the logic is too hard to get all of them, either: capacity 1 gB wrong, actually 2 gB, deduced from 2x1gB sticks found, OR capacity 4 gB right, but 2 x 1 4gB stick found gives 8, which is wrong. --- inxi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/inxi b/inxi index 633dcbf..5c201f1 100755 --- a/inxi +++ b/inxi @@ -3,7 +3,7 @@ #### Script Name: inxi #### Version: 2.1.95 #### Date: 2014-08-13 -#### Patch Number: 02 +#### Patch Number: 03 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -8391,8 +8391,15 @@ get_ram_data() aMaxModuleSize[m]=int(aMaxModuleSize[m]) } # note: some cases memory capacity == max module size, so one stick will fill it - if (a_memory[j,3] != "" && aFoundModules[m] != 0 ) { - if ( a_memory[j,3] < aDerivedModuleSize[m] * aFoundModules[m] ) { + # but I think only with cases of 2 slots does this happen, so if > 2, use the count of slots. + if (a_memory[j,3] != "" && ( aFoundModules[m] != 0 || a_memory[j,4] != "" ) ) { + # not using this logic for now, too complicated and will not always work, grr. + # so use just count x biggest module found + if ( ( a_memory[j,4] > 1 ) && ( a_memory[j,3] < aDerivedModuleSize[m] * a_memory[j,4] ) ) { + a_memory[j,3] = aDerivedModuleSize[m] * a_memory[j,4] + estCap=" (est)" + } + else if ( ( aFoundModules[m] > 0 ) && ( a_memory[j,3] < aDerivedModuleSize[m] * aFoundModules[m] ) ) { a_memory[j,3] = aDerivedModuleSize[m] * aFoundModules[m] estCap=" (est)" }