Whitespace cleanup.
* loadavg.c: (glibtop_get_loadavg_s): Whitespace cleanup.
* ppp.c: (get_ISDN_stats), (is_ISDN_on): Replace g_malloc by an
array.
* glibtop_server.c: (get_pageshift):
* glibtop_server.h:
* procmem.c: (glibtop_init_proc_mem_s), (glibtop_get_proc_mem_s):
* procsegment.c: (glibtop_init_proc_segment_s),
(glibtop_get_proc_segment_s): Moved the pageshift calculation to
glibtop_server.[ch]
* procstate.c: (glibtop_get_proc_state_s):
* procuid.c: (glibtop_get_proc_uid_s):
* sysinfo.c: (init_sysinfo): Minor cleanups.
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
/* gcc warning bug */
|
||||
unsigned get_pageshift();
|
||||
|
||||
|
||||
unsigned long long
|
||||
get_scaled(const char *buffer, const char *key)
|
||||
@@ -50,3 +53,21 @@ proc_file_to_buffer (char *buffer, const char *fmt, pid_t pid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#warning "Ignore the following warning"
|
||||
unsigned get_pageshift()
|
||||
{
|
||||
static unsigned pageshift = 0;
|
||||
|
||||
if(G_UNLIKELY(!pageshift))
|
||||
{
|
||||
register unsigned pagesize = getpagesize();
|
||||
|
||||
while( pagesize > 1 )
|
||||
{
|
||||
pagesize >>= 1;
|
||||
pageshift++;
|
||||
}
|
||||
}
|
||||
|
||||
return pageshift;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user