diff -Nru wmsysmon-0.7.7/debian/changelog wmsysmon-0.7.7+git20150808/debian/changelog --- wmsysmon-0.7.7/debian/changelog 2015-08-26 00:23:18.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/changelog 2016-11-24 14:16:50.000000000 +0000 @@ -1,3 +1,35 @@ +wmsysmon (0.7.7+git20150808-1) unstable; urgency=medium + + * New upstream release (git snapshot). + * debian/control + - Add pkg-config to Build-Depends. + - Bump to Standards-Version 3.9.8. + - Update Homepage. + - Use secure URI for Vcs-Browser. + - Update spelling in Description. + * debian/copyright + - Update Source. + * debian/docs + - New file; install README. + * debian/install + - New file; installs desktop entry file. + * debian/{manpages,wmsysmon.1} + - Remove files; manpage now distributed by upstream. + * debian/menu + - Remove deprecated file. + * debian/patches + - Remove directory; patches applied upstream. + * debian/rules + - Use all hardening flags. + - New override_dh_auto_install target to correctly set PREFIX. + - New get-orig-source target to build tarball. + * debian/watch + - Replace with comment stating that upstream does not tag their releases. + * debian/wmsysmon.desktop + - New desktop entry file. + + -- Doug Torrance Thu, 24 Nov 2016 09:16:50 -0500 + wmsysmon (0.7.7-9) unstable; urgency=medium * debian/control diff -Nru wmsysmon-0.7.7/debian/control wmsysmon-0.7.7+git20150808/debian/control --- wmsysmon-0.7.7/debian/control 2015-08-25 03:03:41.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/control 2016-11-24 14:16:50.000000000 +0000 @@ -3,16 +3,20 @@ Priority: optional Maintainer: Debian Window Maker Team Uploaders: Doug Torrance -Build-Depends: debhelper (>= 9), libx11-dev, libxext-dev, libxpm-dev -Standards-Version: 3.9.6 -Homepage: http://www.gnugeneration.com/software/wmsysmon/ +Build-Depends: debhelper (>= 9), + libx11-dev, + libxext-dev, + libxpm-dev, + pkg-config +Standards-Version: 3.9.8 +Homepage: https://github.com/vcaputo/wmsysmon Vcs-Git: https://anonscm.debian.org/git/pkg-wmaker/wmsysmon.git -Vcs-Browser: http://anonscm.debian.org/cgit/pkg-wmaker/wmsysmon.git +Vcs-Browser: https://anonscm.debian.org/git/pkg-wmaker/wmsysmon.git Package: wmsysmon Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} -Description: WindowMaker dock-app for monitoring your system - wmsysmon is a dockable application for WindowMaker (and possibly Afterstep). +Description: Window Maker dockapp for monitoring your system + wmsysmon is a dockable application for Window Maker (and possibly AfterStep). It monitors system information on interrupt activity, memory use, swap use, and IO. diff -Nru wmsysmon-0.7.7/debian/copyright wmsysmon-0.7.7+git20150808/debian/copyright --- wmsysmon-0.7.7/debian/copyright 2015-08-25 03:04:13.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/copyright 2016-11-24 14:13:09.000000000 +0000 @@ -1,7 +1,7 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: wmsysmon Upstream-Contact: Vito Caputo -Source: http://www.gnugeneration.com/software/wmsysmon/ +Source: https://github.com/vcaputo/wmsysmon Files: * Copyright: 1998-1999 Dave Clark diff -Nru wmsysmon-0.7.7/debian/docs wmsysmon-0.7.7+git20150808/debian/docs --- wmsysmon-0.7.7/debian/docs 1970-01-01 00:00:00.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/docs 2016-11-24 14:13:09.000000000 +0000 @@ -0,0 +1 @@ +README diff -Nru wmsysmon-0.7.7/debian/install wmsysmon-0.7.7+git20150808/debian/install --- wmsysmon-0.7.7/debian/install 1970-01-01 00:00:00.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/install 2016-11-24 14:13:09.000000000 +0000 @@ -0,0 +1 @@ +debian/wmsysmon.desktop usr/share/applications diff -Nru wmsysmon-0.7.7/debian/manpages wmsysmon-0.7.7+git20150808/debian/manpages --- wmsysmon-0.7.7/debian/manpages 2015-08-25 02:59:43.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/manpages 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/wmsysmon.1 diff -Nru wmsysmon-0.7.7/debian/menu wmsysmon-0.7.7+git20150808/debian/menu --- wmsysmon-0.7.7/debian/menu 2015-08-25 02:59:43.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/menu 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -?package(wmsysmon): needs="X11" section="Applications/System/Monitoring" \ -title="wmsysmon" command="/usr/bin/wmsysmon" diff -Nru wmsysmon-0.7.7/debian/patches/break.patch wmsysmon-0.7.7+git20150808/debian/patches/break.patch --- wmsysmon-0.7.7/debian/patches/break.patch 2015-08-25 03:04:04.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/patches/break.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -Description: Add a break to wmsysmon.c at the end of a switch statement. -Author: Luca Bedogni -Last-Update: 2015-07-12 - ---- a/src/wmsysmon.c -+++ b/src/wmsysmon.c -@@ -288,6 +288,7 @@ - #ifdef MONDEBUG - printf("got: %i\n", Event.type); - #endif -+ break; - } - } - diff -Nru wmsysmon-0.7.7/debian/patches/makefile-strip.patch wmsysmon-0.7.7+git20150808/debian/patches/makefile-strip.patch --- wmsysmon-0.7.7/debian/patches/makefile-strip.patch 2015-08-25 03:04:04.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/patches/makefile-strip.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -Description: Delete automatic stripping of binary -Author: Luca Bedogni -Last-Update: 2015-07-12 - ---- a/src/Makefile -+++ b/src/Makefile -@@ -1,7 +1,7 @@ - CC = gcc - - LIBDIR += -L/usr/X11R6/lib --LDFLAGS += -lXpm -lXext -lX11 -lm -s -+LDFLAGS += -lXpm -lXext -lX11 -lm - #CFLAGS = -g #-DMONDEBUG - CFLAGS += -Wall -O3 -fomit-frame-pointer -I/usr/X11R6/include #-DHI_INTS #undefine HI_INTS if your x86 SMP or alpha - diff -Nru wmsysmon-0.7.7/debian/patches/output.patch wmsysmon-0.7.7+git20150808/debian/patches/output.patch --- wmsysmon-0.7.7/debian/patches/output.patch 2015-08-25 03:04:04.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/patches/output.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -Description: Corrects a typo in wmsysmon output. -Author: Luca Bedogni -Last-Update: 2015-07-12 - ---- a/src/wmsysmon.c -+++ b/src/wmsysmon.c -@@ -852,10 +852,10 @@ - #ifdef HI_INTS - "| 01234567 UV | <--- 0-N are hardware interrupts 0-23\n" - "| 89ABCDEF WX | <--- U,V are Page IN/OUT, W,X are Swap IN/OUT\n" -- "| GHIJKLMN YZ |\n" -+ "| GHIJKLMN YZ | <--- Y,Z are Swap IN/OUT\n" - #else - "| 01234567 WX | <--- 0-F are hardware interrupts 0-15\n" -- "| 89ABCDEF YZ | <--- W,X are Page IN/OUT, W,X are Swap IN/OUT\n" -+ "| 89ABCDEF YZ | <--- W,X are Page IN/OUT, Y,Z are Swap IN/OUT\n" - #endif - "-------------------\n"); - diff -Nru wmsysmon-0.7.7/debian/patches/series wmsysmon-0.7.7+git20150808/debian/patches/series --- wmsysmon-0.7.7/debian/patches/series 2015-08-25 02:59:43.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -break.patch -output.patch -src_makefile.patch -makefile-strip.patch -unused-but-set-variable.patch -unused-result.patch diff -Nru wmsysmon-0.7.7/debian/patches/src_makefile.patch wmsysmon-0.7.7+git20150808/debian/patches/src_makefile.patch --- wmsysmon-0.7.7/debian/patches/src_makefile.patch 2015-08-25 03:04:04.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/patches/src_makefile.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -Description: Change Makefile to fit debian policy -Author: Luca Bedogni -Last-Update: 2015-07-12 - ---- a/src/Makefile -+++ b/src/Makefile -@@ -3,7 +3,7 @@ - LIBDIR += -L/usr/X11R6/lib - LDFLAGS += -lXpm -lXext -lX11 -lm -s - #CFLAGS = -g #-DMONDEBUG --CFLAGS += -Wall -O3 -m486 -fomit-frame-pointer -I/usr/X11R6/include #-DHI_INTS #undefine HI_INTS if your x86 SMP or alpha -+CFLAGS += -Wall -O3 -fomit-frame-pointer -I/usr/X11R6/include #-DHI_INTS #undefine HI_INTS if your x86 SMP or alpha - - BIN = wmsysmon - OBJS = wmgeneral.o \ -@@ -17,5 +17,6 @@ - clean: - rm -f $(OBJS) $(BIN) - --install: -- install -g root -o root $(BIN) /usr/local/bin -+install: $(BIN) -+ mkdir -p $(DESTDIR)/usr/bin -+ install -g root -o root $(BIN) $(DESTDIR)/usr/bin diff -Nru wmsysmon-0.7.7/debian/patches/unused-but-set-variable.patch wmsysmon-0.7.7+git20150808/debian/patches/unused-but-set-variable.patch --- wmsysmon-0.7.7/debian/patches/unused-but-set-variable.patch 2015-08-25 03:04:04.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/patches/unused-but-set-variable.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Description: Fix "variable ‘stage’ set but not used" compiler warning. -Author: Doug Torrance -Last-Update: 2015-07-12 - ---- a/src/wmsysmon.c -+++ b/src/wmsysmon.c -@@ -439,10 +439,9 @@ - static long swapins; - static long swapouts; - static long intdiff; -- static long stage; - static long *tints; - -- stage = io = iodiff = iopercent = pageins = pageouts = swapins = swapouts = 0; -+ io = iodiff = iopercent = pageins = pageouts = swapins = swapouts = 0; - - statfp = freopen("/proc/stat", "r", statfp); - diff -Nru wmsysmon-0.7.7/debian/patches/unused-result.patch wmsysmon-0.7.7+git20150808/debian/patches/unused-result.patch --- wmsysmon-0.7.7/debian/patches/unused-result.patch 2015-08-25 03:04:04.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/patches/unused-result.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -Description: Fix "ignoring return value of ‘fscanf’" compiler warning. -Author: Doug Torrance -Last-Update: 2015-07-12 - ---- a/src/wmsysmon.c -+++ b/src/wmsysmon.c -@@ -233,7 +233,8 @@ - /* init uptime */ - fp = fopen("/proc/uptime", "r"); - if (fp) { -- fscanf(fp, "%ld", &start_time); -+ if (fscanf(fp, "%ld", &start_time) < 1) -+ fprintf(stderr, "warning: could not read uptime\n"); - fclose(fp); - start_uptime = time(NULL); - } diff -Nru wmsysmon-0.7.7/debian/rules wmsysmon-0.7.7+git20150808/debian/rules --- wmsysmon-0.7.7/debian/rules 2015-08-25 02:59:43.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/rules 2016-11-24 13:56:17.000000000 +0000 @@ -1,4 +1,24 @@ #!/usr/bin/make -f +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + %: dh $@ --sourcedirectory=src + +override_dh_auto_install: + dh_auto_install -- PREFIX=/usr + +UPSTREAMGIT=https://github.com/vcaputo/wmsysmon +PACKAGE=wmsysmon + +get-orig-source: + wget $(UPSTREAMGIT)/archive/master.tar.gz + git checkout upstream + git pull $(UPSTREAMGIT) + grep -oP '(?<=#define WMSYSMON_VERSION ").*(?=")' src/wmsysmon.c \ + > version + echo "`cat version`+git`date -d @\`git log -1 --pretty=format:%ct\` +%Y%m%d`" > version + cat version + git checkout master + mv -v master.tar.gz ../$(PACKAGE)_`cat version`.orig.tar.gz + rm version diff -Nru wmsysmon-0.7.7/debian/watch wmsysmon-0.7.7+git20150808/debian/watch --- wmsysmon-0.7.7/debian/watch 2015-08-25 02:59:43.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/watch 2016-11-23 13:31:23.000000000 +0000 @@ -1,4 +1,2 @@ -version=3 - -# Uncomment to find new files on sourceforge, for debscripts >= 2.9 -http://gnugeneration.com/software/wmsysmon/wmsysmon-(.*)\.tar.gz +# Upstream does not currently tag their releases. +# Run debian/rules get-orig-source to obtain a tarball. diff -Nru wmsysmon-0.7.7/debian/wmsysmon.1 wmsysmon-0.7.7+git20150808/debian/wmsysmon.1 --- wmsysmon-0.7.7/debian/wmsysmon.1 2015-08-25 02:59:43.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/wmsysmon.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -.TH wmsysmon 1 "2001-04-09" Debian "System Monitor Dockable Application" - -.SH NAME -wmsysmon \- Windowmaker dock-app for monitoring your system. - -.SH SYNOPSIS -wmsysmon -[ \fB-display\fP ] -[ \fB-geometry\fP +Xpos+Ypos ] -[ \fB-r\fP update rate in ms ] -[ \fB-l\fP blinky lights for interrupts ] -[ \fB-h\fP print help screen ] -[ \fB-v\fP print version number ] - -.SH DESCRIPTION -.B wmsysmon -is a dockable application for Windowmaker (and possibly Afterstep). It monitors Memory, Swap, Disk IO, uptime and interrupts. - -.SH OPTIONS -.TP -.BI \-display -Sets the display where wmsysmon will appear. -.TP -.BI \-geometry +Xpos+Ypos -Set the position for wmsysmon. -.TP -.BI \-r updateRate -Sets the update rate for wmsysmon. -.TP -.B \-l -Set blinky lights on. -.TP -.B \-h -Show the help screen. -.TP -.B \-v -Print wmsysmon's version number. - -.SH SEE ALSO -.BR Website - - -.SH AUTHOR -wmsysmon was written by Dave Clark and Vito Caputo -. -This manual page was written by Luca Bedogni , for the -Debian project (but may be used by others). diff -Nru wmsysmon-0.7.7/debian/wmsysmon.desktop wmsysmon-0.7.7+git20150808/debian/wmsysmon.desktop --- wmsysmon-0.7.7/debian/wmsysmon.desktop 1970-01-01 00:00:00.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/debian/wmsysmon.desktop 2016-11-24 13:55:02.000000000 +0000 @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=wmsysmon +Comment=Window Maker dockapp for monitoring your system +Exec=wmsysmon +Categories=System;Monitor; +Keywords=system;monitor;dockapp;window maker; diff -Nru wmsysmon-0.7.7/.gitignore wmsysmon-0.7.7+git20150808/.gitignore --- wmsysmon-0.7.7/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/.gitignore 2015-08-09 02:39:40.000000000 +0000 @@ -0,0 +1,3 @@ +src/wmsysmon +src/*.o +*.swp diff -Nru wmsysmon-0.7.7/src/Makefile wmsysmon-0.7.7+git20150808/src/Makefile --- wmsysmon-0.7.7/src/Makefile 2001-12-24 07:01:43.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/src/Makefile 2015-08-09 02:39:40.000000000 +0000 @@ -1,16 +1,17 @@ CC = gcc +PREFIX ?= /usr/local LIBDIR += -L/usr/X11R6/lib -LDFLAGS += -lXpm -lXext -lX11 -lm -s +LIBS = $(shell pkg-config --libs xpm xext x11) -lm #CFLAGS = -g #-DMONDEBUG -CFLAGS += -Wall -O3 -m486 -fomit-frame-pointer -I/usr/X11R6/include #-DHI_INTS #undefine HI_INTS if your x86 SMP or alpha +CFLAGS += -Wall -O3 -fomit-frame-pointer $(shell pkg-config --cflags xpm xext x11) #-DHI_INTS #undefine HI_INTS if your x86 SMP or alpha BIN = wmsysmon OBJS = wmgeneral.o \ wmsysmon.o $(BIN): $(OBJS) - $(CC) -o $(BIN) $(OBJS) $(LIBDIR) $(LDFLAGS) + $(CC) $(LDFLAGS) -o $(BIN) $(OBJS) $(LIBDIR) $(LIBS) all: wmsysmon @@ -18,4 +19,7 @@ rm -f $(OBJS) $(BIN) install: - install -g root -o root $(BIN) /usr/local/bin + mkdir -p $(DESTDIR)$(PREFIX)/bin + install -g root -o root $(BIN) $(DESTDIR)$(PREFIX)/bin + mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1 + install -m 644 wmsysmon.1 $(DESTDIR)$(PREFIX)/share/man/man1 diff -Nru wmsysmon-0.7.7/src/wmgeneral.c wmsysmon-0.7.7+git20150808/src/wmgeneral.c --- wmsysmon-0.7.7/src/wmgeneral.c 2001-12-24 07:09:25.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/src/wmgeneral.c 2015-08-09 02:39:40.000000000 +0000 @@ -24,14 +24,12 @@ XpmIcon wmgen; Pixmap pixmask; - static void GetXPM(XpmIcon *, char **); static Pixel GetColor(char *); void RedrawWindow(void); static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { - XWindowAttributes attributes; int err; @@ -46,7 +44,7 @@ wmgen->dirty_y = wmgen->attributes.height; wmgen->dirty_w = 0; wmgen->dirty_h = 0; - + if (err != XpmSuccess) { fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -55,8 +53,7 @@ static Pixel GetColor(char *name) { - - XColor color; + XColor color; XWindowAttributes attributes; XGetWindowAttributes(display, Root, &attributes); @@ -73,30 +70,29 @@ void RedrawWindow(void) { - - if(wmgen.dirty_w && wmgen.dirty_h) - XCopyArea(display, - wmgen.pixmap, - iconwin, - NormalGC, - wmgen.dirty_x, - wmgen.dirty_y, - wmgen.dirty_w, - wmgen.dirty_h, - wmgen.dirty_x, - wmgen.dirty_y); - - if(wmgen.dirty_w && wmgen.dirty_h) - XCopyArea(display, - wmgen.pixmap, - win, - NormalGC, - wmgen.dirty_x, - wmgen.dirty_y, - wmgen.dirty_w, - wmgen.dirty_h, - wmgen.dirty_x, - wmgen.dirty_y); + if (wmgen.dirty_w && wmgen.dirty_h) { + XCopyArea(display, + wmgen.pixmap, + iconwin, + NormalGC, + wmgen.dirty_x, + wmgen.dirty_y, + wmgen.dirty_w, + wmgen.dirty_h, + wmgen.dirty_x, + wmgen.dirty_y); + + XCopyArea(display, + wmgen.pixmap, + win, + NormalGC, + wmgen.dirty_x, + wmgen.dirty_y, + wmgen.dirty_w, + wmgen.dirty_h, + wmgen.dirty_x, + wmgen.dirty_y); + } #ifdef MONDEBUG printf("Dirty X: %i Y: %i width: %i height: %i\n", @@ -111,21 +107,19 @@ wmgen.dirty_y = wmgen.attributes.height; wmgen.dirty_w = 0; wmgen.dirty_h = 0; - } void RedrawWindowXY(int x, int y) { - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, - x, y, wmgen.attributes.width, wmgen.attributes.height, 0,0); + x, y, wmgen.attributes.width, wmgen.attributes.height, 0,0); XCopyArea(display, wmgen.pixmap, win, NormalGC, - x, y, wmgen.attributes.width, wmgen.attributes.height, 0,0); + x, y, wmgen.attributes.width, wmgen.attributes.height, 0,0); } void DirtyWindow(int x, int y, unsigned int w, unsigned int h) { - static int nx, ny, nw, nh; + int nx, ny, nw, nh; #ifdef MONDEBUG printf("currently dirty: X: %i Y: %i W: %u H: %u new: X: %i Y: %i W: %u H: %u\n", @@ -139,22 +133,23 @@ h); #endif - if(x < wmgen.dirty_x) nx = x; - else nx = wmgen.dirty_x; + if (x < wmgen.dirty_x) nx = x; + else nx = wmgen.dirty_x; - if(y < wmgen.dirty_y) ny = y; - else ny = wmgen.dirty_y; + if (y < wmgen.dirty_y) ny = y; + else ny = wmgen.dirty_y; - if((x + w) > (wmgen.dirty_x + wmgen.dirty_w)) nw = (x + w) - nx; - else nw = (wmgen.dirty_x + wmgen.dirty_w) - nx; + if ((x + w) > (wmgen.dirty_x + wmgen.dirty_w)) nw = (x + w) - nx; + else nw = (wmgen.dirty_x + wmgen.dirty_w) - nx; - if((y + h) > (wmgen.dirty_y + wmgen.dirty_h)) nh = (y + h) - ny; - else nh = (wmgen.dirty_y + wmgen.dirty_h) - ny; + if ((y + h) > (wmgen.dirty_y + wmgen.dirty_h)) nh = (y + h) - ny; + else nh = (wmgen.dirty_y + wmgen.dirty_h) - ny; wmgen.dirty_x = nx; wmgen.dirty_y = ny; wmgen.dirty_w = nw; wmgen.dirty_h = nh; + #ifdef MONDEBUG printf("Dirty: X: %i Y: %i W: %i H: %i\n", wmgen.dirty_x, @@ -162,44 +157,40 @@ wmgen.dirty_w, wmgen.dirty_h); #endif -}; +} void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { - int i,j,k; int width, height, numcol, depth; - int zero=0; + int zero=0; unsigned char bwrite; - int bcount; - int curpixel; + int bcount; + int curpixel; - sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth); + for (k=0; k!=depth; k++) { + zero <<=8; + zero |= xpm[1][k]; + } - for (k=0; k!=depth; k++) - { - zero <<=8; - zero |= xpm[1][k]; - } - for (i=numcol+1; i < numcol+sy+1; i++) { bcount = 0; bwrite = 0; for (j=0; j>= 1; + bwrite >>= 1; + curpixel=0; + + for (k=0; k!=depth; k++) { + curpixel <<=8; + curpixel |= xpm[i][j+k]; + } - curpixel=0; - for (k=0; k!=depth; k++) - { - curpixel <<=8; - curpixel |= xpm[i][j+k]; - } - - if ( curpixel != zero ) { + if (curpixel != zero) { bwrite += 128; } + bcount++; if (bcount == 8) { *xbm = bwrite; @@ -209,12 +200,10 @@ } } } - } void copyXPMArea(int sx, int sy, unsigned int w, unsigned int h, int dx, int dy) { - XCopyArea(display, wmgen.pixmap, wmgen.pixmap, @@ -231,7 +220,6 @@ void copyXBMArea(int sx, int sy, unsigned int w, unsigned int h, int dx, int dy) { - XCopyArea(display, wmgen.mask, wmgen.pixmap, @@ -244,32 +232,29 @@ dy); DirtyWindow(dx, dy, w, h); - } void setMaskXY(int x, int y) { - XShapeCombineMask(display, win, ShapeBounding, x, y, pixmask, ShapeSet); XShapeCombineMask(display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet); } int openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) { - unsigned int borderwidth = 1; - XClassHint classHint; - char *display_name = NULL; - char *wname = argv[0]; + XClassHint classHint; + char *display_name = NULL; + char *wname = argv[0]; XTextProperty name; - XGCValues gcv; + XGCValues gcv; unsigned long gcm; - char *geometry = NULL; + char *geometry = NULL; - int dummy=0; - int i, wx, wy, fd; + int dummy=0; + int i, wx, wy, fd; for (i=1; argv[i]; i++) { if (!strcmp(argv[i], "-display")) { @@ -284,7 +269,7 @@ if (!(display = XOpenDisplay(display_name))) { fprintf(stderr, "%s: can't open display %s\n", - wname, XDisplayName(display_name)); + wname, XDisplayName(display_name)); return -1; } fd = ConnectionNumber(display); @@ -305,15 +290,15 @@ fore_pix = GetColor("black"); XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints, - &mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy); + &mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy); mysizehints.width = 64; mysizehints.height = 64; DirtyWindow(0, 0, 64, 64); - + win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y, mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); - + iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); @@ -334,7 +319,6 @@ XSetWMName(display, win, &name); /* Create GC for drawing */ - gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; gcv.background = back_pix; @@ -342,14 +326,12 @@ NormalGC = XCreateGC(display, Root, gcm, &gcv); /* ONLYSHAPE ON */ - pixmask = XCreateBitmapFromData(display, win, pixmask_bits, pixmask_width, pixmask_height); XShapeCombineMask(display, win, ShapeBounding, 0, 0, pixmask, ShapeSet); XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, pixmask, ShapeSet); /* ONLYSHAPE OFF */ - mywmhints.initial_state = WithdrawnState; mywmhints.icon_window = iconwin; mywmhints.icon_x = mysizehints.x; diff -Nru wmsysmon-0.7.7/src/wmsysmon.1 wmsysmon-0.7.7+git20150808/src/wmsysmon.1 --- wmsysmon-0.7.7/src/wmsysmon.1 1970-01-01 00:00:00.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/src/wmsysmon.1 2015-08-09 02:39:40.000000000 +0000 @@ -0,0 +1,47 @@ +.TH wmsysmon 1 "2001-04-09" Debian "System Monitor Dockable Application" + +.SH NAME +wmsysmon \- Windowmaker dock-app for monitoring your system. + +.SH SYNOPSIS +wmsysmon +[ \fB-display\fP ] +[ \fB-geometry\fP +Xpos+Ypos ] +[ \fB-r\fP update rate in ms ] +[ \fB-l\fP blinky lights for interrupts ] +[ \fB-h\fP print help screen ] +[ \fB-v\fP print version number ] + +.SH DESCRIPTION +.B wmsysmon +is a dockable application for Windowmaker (and possibly Afterstep). It monitors Memory, Swap, Disk IO, uptime and interrupts. + +.SH OPTIONS +.TP +.BI \-display +Sets the display where wmsysmon will appear. +.TP +.BI \-geometry +Xpos+Ypos +Set the position for wmsysmon. +.TP +.BI \-r updateRate +Sets the update rate for wmsysmon. +.TP +.B \-l +Set blinky lights on. +.TP +.B \-h +Show the help screen. +.TP +.B \-v +Print wmsysmon's version number. + +.SH SEE ALSO +.BR Website + + +.SH AUTHOR +wmsysmon was written by Dave Clark and Vito Caputo +. +This manual page was written by Luca Bedogni , for the +Debian project (but may be used by others). diff -Nru wmsysmon-0.7.7/src/wmsysmon.c wmsysmon-0.7.7+git20150808/src/wmsysmon.c --- wmsysmon-0.7.7/src/wmsysmon.c 2001-12-24 07:11:58.000000000 +0000 +++ wmsysmon-0.7.7+git20150808/src/wmsysmon.c 2015-08-09 02:39:40.000000000 +0000 @@ -2,21 +2,21 @@ wmsysmon -- system monitoring dockapp Copyright (C) 1998-1999 Dave Clark - clarkd@skynet.ca - Copyright (C) 2000 Vito Caputo - swivel@gnugeneration.com + Copyright (C) 2000 Vito Caputo - swivel@gnugeneration.com - wmsysmon is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - wmsysmon is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + wmsysmon is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + wmsysmon is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include @@ -38,7 +38,6 @@ #include #include - #include "wmgeneral.h" #ifdef HI_INTS @@ -83,13 +82,13 @@ long start_time = 0; long start_uptime = 0; int counter = 0; -int Mem_l; /* line in /proc/meminfo "Mem:" is on */ -int Swap_l; /* line in /proc/meminfo "Swap:" is on */ +int Mem_l; /* line in /proc/meminfo "Mem:" is on */ +int Swap_l; /* line in /proc/meminfo "Swap:" is on */ int intr_l; /* line in /proc/stat "intr" is on */ -int rio_l; /* line in /proc/stat "disk_rio" is on */ -int wio_l; /* line in /proc/stat "disk_wio" is on */ -int page_l; /* line in /proc/stat "page" is on */ -int swap_l; /* line in /proc/stat "swap" is on */ +int rio_l; /* line in /proc/stat "disk_rio" is on */ +int wio_l; /* line in /proc/stat "disk_wio" is on */ +int page_l; /* line in /proc/stat "page" is on */ +int swap_l; /* line in /proc/stat "swap" is on */ long io_max; long io_max_diff; @@ -135,8 +134,8 @@ void DrawBar(int sx, int sy, int w, int h, float percent, int dx, int dy); void DrawLite(int state, int dx, int dy); void DrawUptime(void); -void DrawStuff( void ); -void DrawMem( void ); +void DrawStuff(void); +void DrawMem(void); void DrawMeter(unsigned int, unsigned int, int, int); int main(int argc, char *argv[]) { @@ -154,7 +153,7 @@ last_ints = _last_ints; ints = _ints; - + /* Parse Command Line */ ProgName = argv[0]; @@ -173,7 +172,7 @@ } break; case 'g': - if (strcmp(arg+1, "geometry")) { + if (strcmp(arg + 1, "geometry")) { usage(); exit(1); } @@ -202,7 +201,6 @@ wmsysmon_routine(argc, argv); - return 0; } @@ -214,26 +212,26 @@ FILE *fp; int xfd; struct pollfd pfd; - createXBMfromXPM(wmsysmon_mask_bits, wmsysmon_master_xpm, wmsysmon_mask_width, wmsysmon_mask_height); - + xfd = openXwindow(argc, argv, wmsysmon_master_xpm, wmsysmon_mask_bits, wmsysmon_mask_width, wmsysmon_mask_height); - if(xfd < 0) exit(1); + if (xfd < 0) exit(1); pfd.fd = xfd; pfd.events = (POLLIN); - /* init ints */ + /* init ints */ bzero(&_last_ints, sizeof(_last_ints)); bzero(&_ints, sizeof(_ints)); bzero(&int_peaks, sizeof(int_peaks)); - - /* init uptime */ + + /* init uptime */ fp = fopen("/proc/uptime", "r"); if (fp) { - fscanf(fp, "%ld", &start_time); + if (fscanf(fp, "%ld", &start_time) < 1) + fprintf(stderr, "warning: could not read uptime\n"); fclose(fp); start_uptime = time(NULL); } @@ -245,29 +243,28 @@ * lines, for faster lookup throughout execution. */ /* /proc/meminfo */ - for(i = 0; fgets(buf, 1024, memfp); i++) { + for (i = 0; fgets(buf, 1024, memfp); i++) { if(strstr(buf, "Mem:")) Mem_l = i; else if(strstr(buf, "Swap:")) Swap_l = i; } /* /proc/stat */ - for(i = 0; fgets(buf, 1024, statfp); i++) { - if(strstr(buf, "disk_wio")) wio_l = i; - else if(strstr(buf, "disk_rio")) rio_l = i; - else if(strstr(buf, "page")) page_l = i; - else if(strstr(buf, "swap")) swap_l = i; - else if(strstr(buf, "intr")) intr_l = i; + for (i = 0; fgets(buf, 1024, statfp); i++) { + if (strstr(buf, "disk_wio")) wio_l = i; + else if (strstr(buf, "disk_rio")) rio_l = i; + else if (strstr(buf, "page")) page_l = i; + else if (strstr(buf, "swap")) swap_l = i; + else if (strstr(buf, "intr")) intr_l = i; } - while(1) { - + while (1) { curtime = time(0); DrawUptime(); DrawStuff(); DrawMem(); RedrawWindow(); - + /* X Events */ poll(&pfd, 1, update_rate); while (XPending(display)) { @@ -284,28 +281,27 @@ exit(0); break; - default: #ifdef MONDEBUG + default: printf("got: %i\n", Event.type); #endif + break; } } - -/* usleep(update_rate); */ } } void DrawMeter(unsigned int level, unsigned int peak, int dx, int dy) { - static unsigned int a; + unsigned int a; /* meters are on a per interruptscale, dictated by the peak, maintain * this peak outside of here, you can use a fixed peak for all ints but * since we're using only 4 lines for our level, the timer interrupt * usually kills the peak for the others so they never move. */ - if(peak) { + if (peak) { a = level * 3 / peak; } else a = 0; @@ -314,7 +310,7 @@ fflush(stdout); #endif - if(a > 3) a = 3; + if (a > 3) a = 3; copyXPMArea(meter[a][0], meter[a][1], @@ -328,21 +324,17 @@ void DrawBar(int sx, int sy, int w, int h, float percent, int dx, int dy) { - static int tx; - - tx = (float)((float)w * ((float)percent / (float)100.0)); + int tx = (float)((float)w * ((float)percent / (float)100.0)); copyXPMArea(sx, sy, tx, h, dx, dy); copyXPMArea(sx, sy + h + 1, w - tx, h, dx + tx, dy); - } void DrawLite(int state, int dx, int dy) { - - switch(state) { + switch (state) { case B_RED: copyXPMArea(BREDX, BREDY, LITEW, LITEH, dx, dy); break; @@ -354,25 +346,23 @@ copyXPMArea(BOFFX, BOFFY, LITEW, LITEH, dx, dy); break; } - } void DrawUptime(void) { static int first = 1; - static int old_days = 0, old_hours = 0, old_minutes = 0; - static long uptime; - static int i; + static int old_days, old_hours, old_minutes; + long uptime; + int i; - uptime = curtime - start_uptime + start_time; /* blit minutes */ uptime /=60; i = uptime % 60; - if(old_minutes != i || first) { + if (old_minutes != i || first) { old_minutes = i; sprintf(buf, "%02i", i); #ifdef HI_INTS @@ -381,12 +371,12 @@ BlitString(buf, 45, 37); #endif } - + /* blit hours */ uptime /=60; i = uptime % 24; - if(old_hours != i || first) { + if (old_hours != i || first) { old_hours = i; sprintf(buf, "%02i", i); #ifdef HI_INTS @@ -396,11 +386,10 @@ #endif } - /* blit days */ uptime /= 24; i = uptime; - if(old_days != i || first) { + if (old_days != i || first) { old_days = i; sprintf(buf, "%03i", i); #ifdef HI_INTS @@ -416,38 +405,35 @@ void DrawStuff( void ) { - static int io_last = 0, first = 1; + static int io_last, first = 1; #ifdef HI_INTS - static int int_lites[24] = - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + static int int_lites[24]; /* to keep track of on/off status */ #else - static int int_lites[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + static int int_lites[16]; #endif - static int pagein_lite = 0, pageout_lite = 0, swapin_lite = 0, swapout_lite = 0; - static char *tok; + static int pagein_lite, pageout_lite, swapin_lite, swapout_lite; + char *tok; static char seps[] = {" "}; - static int i, ents; + int i, ents; - static long io; - static long iodiff; - static int iopercent; - - static long pageins; - static long pageouts; - static long swapins; - static long swapouts; - static long intdiff; - static long stage; - static long *tints; + long io; + long iodiff; + int iopercent; + + long pageins; + long pageouts; + long swapins; + long swapouts; + long intdiff; + long *tints; - stage = io = iodiff = iopercent = pageins = pageouts = swapins = swapouts = 0; + io = iodiff = iopercent = pageins = pageouts = swapins = swapouts = 0; statfp = freopen("/proc/stat", "r", statfp); - - for(i = 0, ents = 0; ents < 5 && fgets(buf, 1024, statfp); i++) { - if(i == rio_l) { + for (i = 0, ents = 0; ents < 5 && fgets(buf, 1024, statfp); i++) { + if (i == rio_l) { tok = strtok(buf, seps); io += atoi(tok); @@ -462,7 +448,7 @@ io += atoi(tok); tok = strtok(NULL, seps); ents++; - } else if(i == wio_l) { + } else if (i == wio_l) { tok = strtok(buf, seps); io += atoi(tok); @@ -477,16 +463,16 @@ io += atoi(tok); tok = strtok(NULL, seps); ents++; - } else if(i == page_l) { + } else if (i == page_l) { sscanf(buf, "%*s %ld %ld", &pageins, &pageouts); ents++; - } else if(i == swap_l) { + } else if (i == swap_l) { sscanf(buf, "%*s %ld %ld", &swapins, &swapouts); ents++; - } else if(i == intr_l) { + } else if (i == intr_l) { sscanf( buf, - #ifdef HI_INTS +#ifdef HI_INTS "%*s %*d %ld %ld %ld %ld %ld" "%ld %ld %ld %ld %ld %ld %ld" "%ld %ld %ld %ld %ld %ld %ld" @@ -499,7 +485,7 @@ &ints[15], &ints[16], &ints[17], &ints[18], &ints[19], &ints[20], &ints[21], &ints[22], &ints[23]); - #else +#else "%*s %*d %ld %ld %ld %ld %ld" "%ld %ld %ld %ld %ld %ld %ld" "%ld %ld %ld %ld", @@ -509,30 +495,29 @@ &ints[9], &ints[10], &ints[11], &ints[12], &ints[13], &ints[14], &ints[15]); - #endif +#endif ents++; } } /* ------------------ IO bar ------------------ */ - if(io_max == 0) io_max = io; - - if(io > io_max) iodiff = abs(io_max - io); + if (io_max == 0) io_max = io; + + if (io > io_max) iodiff = abs(io_max - io); else iodiff = 0; io_max = io; - - if(io_max_diff !=0) iopercent = ((float) iodiff / (float) io_max_diff) * 100.0; + + if (io_max_diff !=0) iopercent = ((float) iodiff / (float) io_max_diff) * 100.0; else iopercent = 0; - if(iodiff > io_max_diff) io_max_diff = iodiff; + if (iodiff > io_max_diff) io_max_diff = iodiff; if (iopercent > 100) iopercent = 100; - - if(iopercent != io_last || first) { + if (iopercent != io_last || first) { io_last = iopercent; #ifdef HI_INTS DrawBar(67, 36, 58, 4, iopercent, 3, 20); @@ -541,18 +526,17 @@ #endif } - - if(int_mode == INT_LITES) { + if (int_mode == INT_LITES) { /* top 8 ints */ for (i = 0; i < 8; i++) { - if ( ints[i] > last_ints[i] && !int_lites[i]) { + if (ints[i] > last_ints[i] && !int_lites[i]) { int_lites[i] = 1; #ifdef HI_INTS DrawLite(B_GREEN, 4 + (i * LITEW) + i, 43); #else DrawLite(B_GREEN, 4 + (i * LITEW) + i, 51); #endif - } else if(ints[i] == last_ints[i] && int_lites[i]) { + } else if (ints[i] == last_ints[i] && int_lites[i]) { int_lites[i] = 0; #ifdef HI_INTS DrawLite(B_OFF, 4 + (i * LITEW) + i, 43); @@ -563,14 +547,14 @@ } /* middle/bottom 8 */ for (i = 8; i < 16; i++) { - if ( ints[i] > last_ints[i] && !int_lites[i]) { + if (ints[i] > last_ints[i] && !int_lites[i]) { int_lites[i] = 1; #ifdef HI_INTS DrawLite(B_GREEN, 4 + ((i - 8) *LITEW) + (i - 8), 48); #else DrawLite(B_GREEN, 4 + ((i - 8) *LITEW) + (i - 8), 56); #endif - } else if(ints[i] == last_ints[i] && int_lites[i]) { + } else if (ints[i] == last_ints[i] && int_lites[i]) { int_lites[i] = 0; #ifdef HI_INTS DrawLite(B_OFF, 4 + ((i - 8) * LITEW) + (i - 8), 48); @@ -586,15 +570,15 @@ if (ints[i] > last_ints[i] && !int_lites[i] ) { int_lites[i] = 1; DrawLite(B_GREEN, 4 + ((i - 16) * LITEW) + (i - 16), 53); - } else if(ints[i] == last_ints[i] && int_lites[i]) { + } else if (ints[i] == last_ints[i] && int_lites[i]) { int_lites[i] = 0; DrawLite(B_OFF, 4 + ((i -16) * LITEW) + (i - 16), 53); } } #endif - } else if(int_mode == INT_METERS) { + } else if (int_mode == INT_METERS) { for (i = 0; i < 8; i++) { - if(last_ints[i]) { + if (last_ints[i]) { intdiff = ints[i] - last_ints[i]; int_peaks[i] = (int_peaks[i] + intdiff) >> 1; #ifdef HI_INTS @@ -612,7 +596,7 @@ } for (i = 8; i < 16; i++) { - if(last_ints[i]) { + if (last_ints[i]) { intdiff = ints[i] - last_ints[i]; int_peaks[i] = (int_peaks[i] + intdiff) >> 1; #ifdef HI_INTS @@ -631,7 +615,7 @@ #ifdef HI_INTS for (i = 16; i < 24; i++) { - if(last_ints[i]) { + if (last_ints[i]) { intdiff = ints[i] - last_ints[i]; int_peaks[i] = (int_peaks[i] + intdiff) >> 1; @@ -649,7 +633,6 @@ ints = tints; /* page in / out */ - if (pageins > last_pageins && !pagein_lite) { pagein_lite = 1; #ifdef HI_INTS @@ -657,7 +640,7 @@ #else DrawLite(B_RED, 51, 51); #endif - } else if(pagein_lite) { + } else if (pagein_lite) { pagein_lite = 0; #ifdef HI_INTS DrawLite(B_OFF, 51, 43); @@ -673,7 +656,7 @@ #else DrawLite(B_RED, 56, 51); #endif - } else if(pageout_lite) { + } else if (pageout_lite) { pageout_lite = 0; #ifdef HI_INTS DrawLite(B_OFF, 56, 43); @@ -686,15 +669,14 @@ last_pageouts = pageouts; /* swap in/out */ - - if(swapins > last_swapins && !swapin_lite) { + if (swapins > last_swapins && !swapin_lite) { swapin_lite = 1; #ifdef HI_INTS DrawLite(B_RED, 51, 48); #else DrawLite(B_RED, 51, 56); #endif - } else if(swapin_lite) { + } else if (swapin_lite) { swapin_lite = 0; #ifdef HI_INTS DrawLite(B_OFF, 51, 48); @@ -710,7 +692,7 @@ #else DrawLite(B_RED, 56, 56); #endif - } else if(swapout_lite) { + } else if (swapout_lite) { swapout_lite = 0; #ifdef HI_INTS DrawLite(B_OFF, 56, 48); @@ -723,42 +705,39 @@ last_swapouts = swapouts; first = 0; - } void DrawMem(void) { - static int last_mem = 0, last_swap = 0, first = 1; - static long mem_total = 0; - static long mem_used = 0; - static long mem_buffers = 0; - static long mem_cache = 0; - static long swap_total = 0; - static long swap_used = 0; - static long swap_free = 0; - - static int mempercent = 0; - static int swappercent = 0; - static int i, ents; - + static int last_mem, last_swap, first = 1; + long mem_total; + long mem_used; + long mem_buffers; + long mem_cache; + long swap_total; + long swap_used; + long swap_free; + int mempercent; + int swappercent; + int i, ents; counter--; - if(counter >= 0) return; /* polling /proc/meminfo is EXPENSIVE */ + if (counter >= 0) return; /* polling /proc/meminfo is EXPENSIVE */ counter = 3000000 / update_rate; memfp = freopen("/proc/meminfo", "r", memfp); - for(i = 0, ents = 0; ents < 2 && fgets(buf, 1024, memfp); i++) { - if(i == Mem_l) { + for (i = 0, ents = 0; ents < 2 && fgets(buf, 1024, memfp); i++) { + if (i == Mem_l) { sscanf(buf, "%*s %ld %ld %*d %*d %ld %ld", &mem_total, &mem_used, &mem_buffers, &mem_cache); ents++; - } else if(i == Swap_l) { + } else if (i == Swap_l) { sscanf(buf, "%*s %ld %ld %ld", &swap_total, &swap_used, @@ -770,15 +749,12 @@ /* could speed this up but we'd lose precision, look more into it to see * if precision change would be noticable, and if speed diff is significant */ - mempercent = ((float)(mem_used - mem_buffers - mem_cache) - / - (float)mem_total) * 100; - - swappercent = ((float)(swap_used) - / - (float)swap_total) * 100; + mempercent = ((float)(mem_used - mem_buffers - mem_cache) / + (float)mem_total) * 100; + + swappercent = ((float)(swap_used) / (float)swap_total) * 100; - if(mempercent != last_mem || first) { + if (mempercent != last_mem || first) { last_mem = mempercent; #ifdef HI_INTS DrawBar(67, 36, 58,4 , mempercent, 3, 4); @@ -787,7 +763,7 @@ #endif } - if(swappercent != last_swap || first) { + if (swappercent != last_swap || first) { last_swap = swappercent; #ifdef HI_INTS DrawBar(67, 36, 58, 4, swappercent, 3, 12); @@ -797,7 +773,6 @@ } first = 0; - } @@ -808,7 +783,6 @@ k = x; for (i=0; name[i]; i++) { - c = toupper(name[i]); if (c >= 'A' && c <= 'Z') { c -= 'A'; @@ -820,23 +794,15 @@ k += 6; } } - } void BlitNum(int num, int x, int y) { - static int newx; - - - newx = x; - sprintf(buf, "%03i", num); - - BlitString(buf, newx, y); - + BlitString(buf, x, y); } - + void usage(void) { @@ -854,7 +820,7 @@ "| GHIJKLMN YZ |\n" #else "| 01234567 WX | <--- 0-F are hardware interrupts 0-15\n" - "| 89ABCDEF YZ | <--- W,X are Page IN/OUT, W,X are Swap IN/OUT\n" + "| 89ABCDEF YZ | <--- W,X are Page IN/OUT, Y,Z are Swap IN/OUT\n" #endif "-------------------\n");