More formatting updates. Reduced whitespace, looks even better.

This commit is contained in:
William Ferrell committed 2000-03-30 20:43:33 +00:00
1 parent a98c8109a8
commit ddfd41f53e
78 files changed
-590

No files matched your search

-22
View File
@@ -38,7 +38,6 @@ get_mem_info (struct meminfo *result)
result[1].free = getentry ("SwapFree:", buffer);
}
int
mem_init ()
{
@@ -60,7 +59,6 @@ mem_close ()
return 0;
}
/////////////////////////////////////////////////////////////////////////
// Mem Screen displays info about memory and swap usage...
//
@@ -121,10 +119,8 @@ mem_screen (int rep, int display)
//sock_send_string(sock, "\n");
}
get_mem_info (mem);
// flip the title back and forth...
if (lcd_hgt >= 4) {
if (which_title & 4) {
@@ -134,7 +130,6 @@ mem_screen (int rep, int display)
sock_send_string (sock, "widget_set M title { MEM -==- SWAP}\n");
which_title = (which_title + 1) & 7;
// Total memory
sprintf (tmp, "widget_set M memtotl 1 2 {%6dk}\n", mem[0].total);
if (display)
@@ -155,7 +150,6 @@ mem_screen (int rep, int display)
if (display)
sock_send_string (sock, tmp);
// Free memory graph
n = (int) (35.0 - ((float) mem[0].free + (float) mem[0].buffers + (float) mem[0].cache)
/ (float) mem[0].total * 35.0);
@@ -179,7 +173,6 @@ mem_screen (int rep, int display)
if (display)
sock_send_string (sock, tmp);
// Free memory graph
value = ((float) mem[0].free + (float) mem[0].buffers + (float) mem[0].cache)
/ (float) mem[0].total;
@@ -217,16 +210,11 @@ mem_screen (int rep, int display)
if (display)
sock_send_string (sock, tmp);
}
return 0;
} // End mem_screen()
typedef struct proc_mem_info {
char name[16]; // Is this really long enough?
// Size isn't used any more...
@@ -235,7 +223,6 @@ typedef struct proc_mem_info {
int number;
} proc_mem_info;
static int
sort_procs (void *a, void *b)
{
@@ -252,7 +239,6 @@ sort_procs (void *a, void *b)
return (two->totl > one->totl);
}
int
mem_top_screen (int rep, int display)
{
@@ -271,7 +257,6 @@ mem_top_screen (int rep, int display)
const int
NameLineLen = strlen (NameLine), VmSizeLineLen = strlen (VmSizeLine), VmDataLineLen = strlen (VmDataLine), VmStkLineLen = strlen (VmStkLine), VmExeLineLen = strlen (VmExeLine), VmRSSLineLen = strlen (VmRSSLine);
int threshold = 400, unique;
int i;
proc_mem_info *p;
@@ -299,14 +284,12 @@ mem_top_screen (int rep, int display)
sock_send_string (sock, "widget_set S 1 1 1 Checking...\n");
}
procs = LL_new ();
if (!procs) {
fprintf (stderr, "mem_top_screen: Error allocating list\n");
return -1;
}
if ((proc = opendir ("/proc")) == NULL) {
fprintf (stderr, "mem_top_screen: unable to open /proc");
perror ("");
@@ -383,7 +366,6 @@ mem_top_screen (int rep, int display)
}
closedir (proc);
// Now, print some info...
LL_Rewind (procs);
LL_Sort (procs, sort_procs);
@@ -408,9 +390,6 @@ mem_top_screen (int rep, int display)
LL_Next (procs);
}
end: // Ack! I hate using labels!
// Now clean it all up...
LL_Rewind (procs);
@@ -423,7 +402,6 @@ mem_top_screen (int rep, int display)
} while (LL_Next (procs) == 0);
LL_Destroy (procs);
return 0;
} // End mem_top_screen()