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.
This commit is contained in:
Neale Pickett 2008-12-14 22:39:03 -07:00
parent 15b14a2b70
commit 5292e7d8a1
3 changed files with 11 additions and 10 deletions

View File

@ -1,5 +1,5 @@
HOSTTYPE = $(shell uname -m) HOSTTYPE = $(shell uname -m)
BINDIR ?= $(HOME)/bin/$(HOSTTYPE) BINDIR = $(HOME)/bin/$(HOSTTYPE)
CFLAGS = -Wall CFLAGS = -Wall
LDLIBS = -L/usr/X11R6/lib -lX11 LDLIBS = -L/usr/X11R6/lib -lX11

8
README
View File

@ -85,12 +85,12 @@ won't lock if the cursor's at the top of the screen.
Download 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 download a [tarball of the latest
commit](http://woozle.org/~neale/repos/?p=xss;a=snapshot), or clone the commit](http://woozle.org/~neale/gitweb.cgi?p=xss;a=snapshot), or clone
git repository: the git repository:
git clone http://woozle.org/~neale/repos/xss/ git clone http://woozle.org/~neale/projects/xss
History History

11
magic.c
View File

@ -32,20 +32,21 @@
#define nsec (1000000000 / FPS) #define nsec (1000000000 / FPS)
#define max(a,b) (((a) > (b)) ? (a) : (b)) #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) \ #define sum(a, b, v, m) \
if (b < -v) { \ if (b < -v) { \
v *= -1; \ v *= -1; \
a = v - b; \ a = v - b; \
} else if (m - b <= v) { \ } else if (m - b <= v) { \
v *= -1; \ v *= -1; \
a = m - (m - b) + v; \ a = v + b; \
} else { \ } else { \
a = b + v; \ a = v + b; \
} }
#define randint(x) (random() % (x))
#define rand(l, h) (randint(h-l) + l)
int int
main(int argc, char * const argv[]) main(int argc, char * const argv[])
{ {