Added missing const qualifiers.

* sem_limits.c:
	* shm_limits.c:
	* swap.c: Added missing const qualifiers.

	* uptime.c: (glibtop_get_uptime_s): Cleaned up. Added boot_time.
This commit is contained in:
Benoît Dejean
2004-05-25 17:12:39 +00:00
parent 74453855aa
commit dc3027c438
10 changed files with 31 additions and 13 deletions

View File

@@ -1,3 +1,11 @@
2004-05-25 Benoît Dejean <tazforever@dlfp.org>
* sem_limits.c:
* shm_limits.c:
* swap.c: Added missing const qualifiers.
* uptime.c: (glibtop_get_uptime_s): Cleaned up. Added boot_time.
2004-03-09 Bastien Nocera <hadess@hadess.net>
* proclist.c: (glibtop_get_proclist_s): fix g_malloc usage on non-Linux

View File

@@ -41,7 +41,7 @@ union semun
};
#endif
static unsigned long _glibtop_sysdeps_sem_limits =
static const unsigned long _glibtop_sysdeps_sem_limits =
(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) +
(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) +
(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) +

View File

@@ -26,7 +26,7 @@
#include <sys/ipc.h>
#include <sys/shm.h>
static unsigned long _glibtop_sysdeps_shm_limits =
static const unsigned long _glibtop_sysdeps_shm_limits =
(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) +
(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) +
(1 << GLIBTOP_IPC_SHMALL);

View File

@@ -27,7 +27,7 @@
#include "kernel.h"
static unsigned long _glibtop_sysdeps_swap =
static const unsigned long _glibtop_sysdeps_swap =
(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) +
(1 << GLIBTOP_SWAP_FREE) + (1 << GLIBTOP_SWAP_PAGEIN) +
(1 << GLIBTOP_SWAP_PAGEOUT);

View File

@@ -25,9 +25,11 @@
#include <glibtop/error.h>
#include <glibtop/uptime.h>
#include <time.h>
#include "kernel.h"
static unsigned long _glibtop_sysdeps_uptime =
static const unsigned long _glibtop_sysdeps_uptime =
(1 << GLIBTOP_UPTIME_UPTIME) + (1 << GLIBTOP_UPTIME_IDLETIME);
/* Init function. */
@@ -61,4 +63,5 @@ glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
buf->uptime = (double) tbl.uptime.uptime / HZ;
buf->idletime = (double) tbl.uptime.idle / HZ;
buf->boot_time = (guint64) time(NULL) - (tbl.uptime.uptime / HZ);
}