From 5292e7d8a1120739ef699a8bf5b01ae164a5bd15 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sun, 14 Dec 2008 22:39:03 -0700 Subject: [PATCH] Fix URLs in README, plus two cosmetic fixes to source One was to make the sum function in magic a little more legible. The other was to make BINDIR in Makefile overrideable. --- Makefile | 2 +- README | 8 ++++---- magic.c | 11 ++++++----- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index c361b52..b746593 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ HOSTTYPE = $(shell uname -m) -BINDIR ?= $(HOME)/bin/$(HOSTTYPE) +BINDIR = $(HOME)/bin/$(HOSTTYPE) CFLAGS = -Wall LDLIBS = -L/usr/X11R6/lib -lX11 diff --git a/README b/README index 0ab319e..c72e603 100644 --- a/README +++ b/README @@ -85,12 +85,12 @@ won't lock if the cursor's at the top of the screen. Download -------- -You can [browse the source](http://woozle.org/~neale/repos/?p=xss), +You can [browse the source](http://woozle.org/~neale/gitweb.cgi?p=xss), download a [tarball of the latest -commit](http://woozle.org/~neale/repos/?p=xss;a=snapshot), or clone the -git repository: +commit](http://woozle.org/~neale/gitweb.cgi?p=xss;a=snapshot), or clone +the git repository: - git clone http://woozle.org/~neale/repos/xss/ + git clone http://woozle.org/~neale/projects/xss History diff --git a/magic.c b/magic.c index c1e4bd4..2aa1b34 100644 --- a/magic.c +++ b/magic.c @@ -32,20 +32,21 @@ #define nsec (1000000000 / FPS) #define max(a,b) (((a) > (b)) ? (a) : (b)) + +#define randint(x) (random() % (x)) +#define rand(l, h) (randint(h-l) + l) + #define sum(a, b, v, m) \ if (b < -v) { \ v *= -1; \ a = v - b; \ } else if (m - b <= v) { \ v *= -1; \ - a = m - (m - b) + v; \ + a = v + b; \ } else { \ - a = b + v; \ + a = v + b; \ } -#define randint(x) (random() % (x)) -#define rand(l, h) (randint(h-l) + l) - int main(int argc, char * const argv[]) {