netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=fe30a5a72f50858b70dfedbe067958c180ab47a5

commit fe30a5a72f50858b70dfedbe067958c180ab47a5
Author: Alastair Poole <nets...@gmail.com>
Date:   Sat Jul 11 18:30:23 2020 +0100

    machine: ifdef chopping within functions.
    
    I don't belive in ifdef blocks within a single function. Ideally
    keep the blocks separate at worst. I think if this is necessary
    at the time it's permissible but overall it's fucking ugly.
---
 src/bin/system/machine/cpu.bogox | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/bin/system/machine/cpu.bogox b/src/bin/system/machine/cpu.bogox
index 2e56c7f..5a71de6 100644
--- a/src/bin/system/machine/cpu.bogox
+++ b/src/bin/system/machine/cpu.bogox
@@ -94,11 +94,10 @@ _cpu_state_get(cpu_core_t **cores, int ncpu)
    double ratio, percent;
    unsigned long total, idle, used;
    cpu_core_t *core;
-#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__DragonFly__)
    size_t size;
    int i, j;
-#endif
-#if defined(__FreeBSD__) || defined(__DragonFly__)
+
    if (!ncpu)
      return;
    size = sizeof(unsigned long) * (CPU_STATES * ncpu);
@@ -136,6 +135,8 @@ _cpu_state_get(cpu_core_t **cores, int ncpu)
 #elif defined(__OpenBSD__)
    static struct cpustats cpu_times[CPU_STATES];
    static int cpu_time_mib[] = { CTL_KERN, KERN_CPUSTATS, 0 };
+   size_t size;
+   int i, j;
 
    memset(&cpu_times, 0, CPU_STATES * sizeof(struct cpustats));
    if (!ncpu)

-- 


Reply via email to