From c3ead5d395a9c39d16c5488ee00052606df17b56 Mon Sep 17 00:00:00 2001 From: Robert Wolterman Date: Sun, 26 Feb 2017 00:50:54 +0000 Subject: [PATCH] fixing issues with the code to determine if the computer is a chip/chip pro for #32 --- source/common.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/common.c b/source/common.c index 0e5caa1..430bf36 100644 --- a/source/common.c +++ b/source/common.c @@ -222,19 +222,25 @@ int get_xio_base(void) } /* get_xio_base */ #define RAMDETERMINER 380.0 -#define MEGABYTE 1024.0*1024.0 int is_this_chippro(void) { int is_pro = 0; - struct sysinfo si; sysinfo (&si); - - if ((si.totalram/MEGABYTE) > RAMDETERMINER) { + const double megabyte = 1024 * 1024; + + if (DEBUG) + printf(" ** is_this_chippro: total system ram: %5.1f mb\n", si.totalram / megabyte); + + if ((si.totalram/megabyte) > RAMDETERMINER) { is_pro = 0; + if (DEBUG) + printf(" ** is_this_chippro: we are a chip\n"); } else { is_pro = 1; + if (DEBUG) + printf(" ** is_this_chippro: we are a chip pro\n"); } return is_pro;