projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.38.tar.gz
[xscreensaver]
/
hacks
/
glx
/
hydrostat.c
diff --git
a/hacks/glx/hydrostat.c
b/hacks/glx/hydrostat.c
index ea3de9dfb7df595d2629166c5d34d158128ce56e..2254483784460a9111ad392c82ff5556e70bfb24 100644
(file)
--- a/
hacks/glx/hydrostat.c
+++ b/
hacks/glx/hydrostat.c
@@
-33,7
+33,7
@@
"*wireframe: False \n" \
"*suppressRotationAnimation: True\n" \
"*wireframe: False \n" \
"*suppressRotationAnimation: True\n" \
-# define re
fresh
_hydrostat 0
+# define re
lease
_hydrostat 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@
-508,10
+508,10
@@
make_squid (ModeInfo *mi, int which)
static int
cmp_squid (const void *aa, const void *bb)
{
static int
cmp_squid (const void *aa, const void *bb)
{
-
const squid *a = (squid *)
aa;
-
const squid *b = (squid *)
bb;
- return ((int) (
b
->pos.y * 10000) -
- (int) (
a
->pos.y * 10000));
+
squid * const *a =
aa;
+
squid * const *b =
bb;
+ return ((int) (
(*b)
->pos.y * 10000) -
+ (int) (
(*a)
->pos.y * 10000));
}
}
@@
-647,14
+647,7
@@
init_hydrostat (ModeInfo *mi)
hydrostat_configuration *bp;
int i;
hydrostat_configuration *bp;
int i;
- if (!bps) {
- bps = (hydrostat_configuration *)
- calloc (MI_NUM_SCREENS(mi), sizeof (hydrostat_configuration));
- if (!bps) {
- fprintf(stderr, "%s: out of memory\n", progname);
- exit(1);
- }
- }
+ MI_INIT (mi, bps);
bp = &bps[MI_SCREEN(mi)];
bp = &bps[MI_SCREEN(mi)];
@@
-764,10
+757,12
@@
draw_hydrostat (ModeInfo *mi)
ENTRYPOINT void
ENTRYPOINT void
-
releas
e_hydrostat (ModeInfo *mi)
+
fre
e_hydrostat (ModeInfo *mi)
{
hydrostat_configuration *bp = &bps[MI_SCREEN(mi)];
int i;
{
hydrostat_configuration *bp = &bps[MI_SCREEN(mi)];
int i;
+ if (!bp->squids)
+ return;
for (i = 0; i < MI_COUNT(mi); i++)
free_squid (bp->squids[i]);
free (bp->squids);
for (i = 0; i < MI_COUNT(mi); i++)
free_squid (bp->squids[i]);
free (bp->squids);