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.35.tar.gz
[xscreensaver]
/
hacks
/
critical.c
diff --git
a/hacks/critical.c
b/hacks/critical.c
index 6f9fa76061320a06e908cc47a3a003eef3083f5d..81fd0c1a1056547e789302e5082bb4f03541f596 100644
(file)
--- a/
hacks/critical.c
+++ b/
hacks/critical.c
@@
-100,8
+100,10
@@
model_allocate (int model_w, int model_h)
mm->height = model_h;
mm->cells = malloc (sizeof (unsigned short) * model_w * model_h);
mm->height = model_h;
mm->cells = malloc (sizeof (unsigned short) * model_w * model_h);
- if (!mm->cells)
+ if (!mm->cells) {
+ free (mm);
return 0;
return 0;
+ }
return mm;
}
return mm;
}
@@
-216,21
+218,21
@@
setup_colormap (struct state *st, XColor **colors, int *n_colors)
if (!strcmp (color_scheme, "random"))
{
if (!strcmp (color_scheme, "random"))
{
- make_random_colormap (st->
dpy
, st->wattr.visual,
+ make_random_colormap (st->
wattr.screen
, st->wattr.visual,
st->wattr.colormap,
*colors, n_colors,
True, True, &writable, True);
}
else if (!strcmp (color_scheme, "smooth"))
{
st->wattr.colormap,
*colors, n_colors,
True, True, &writable, True);
}
else if (!strcmp (color_scheme, "smooth"))
{
- make_smooth_colormap (st->
dpy
, st->wattr.visual,
+ make_smooth_colormap (st->
wattr.screen
, st->wattr.visual,
st->wattr.colormap,
*colors, n_colors,
True, &writable, True);
}
else
{
st->wattr.colormap,
*colors, n_colors,
True, &writable, True);
}
else
{
- make_uniform_colormap (st->
dpy
, st->wattr.visual,
+ make_uniform_colormap (st->
wattr.screen
, st->wattr.visual,
st->wattr.colormap,
*colors, n_colors, True,
&writable, True);
st->wattr.colormap,
*colors, n_colors, True,
&writable, True);
@@
-242,7
+244,7
@@
setup_colormap (struct state *st, XColor **colors, int *n_colors)
static void
free_colormap (struct state *st, XColor **colors, int n_colors)
{
static void
free_colormap (struct state *st, XColor **colors, int n_colors)
{
- free_colors (st->
dpy
, st->wattr.colormap, *colors, n_colors);
+ free_colors (st->
wattr.screen
, st->wattr.colormap, *colors, n_colors);
free (*colors);
}
free (*colors);
}
@@
-290,7
+292,7
@@
critical_init (Display *dpy, Window window)
model_w = 80;
st->settings.cell_size = st->wattr.width / model_w;
model_h = st->settings.cell_size ?
model_w = 80;
st->settings.cell_size = st->wattr.width / model_w;
model_h = st->settings.cell_size ?
- st->wattr.height / st->settings.cell_size :
0
;
+ st->wattr.height / st->settings.cell_size :
1
;
/* Construct the initial model state. */
/* Construct the initial model state. */
@@
-319,7
+321,7
@@
critical_init (Display *dpy, Window window)
st->fgc = XCreateGC (st->dpy, st->window, 0, &st->gcv);
st->fgc = XCreateGC (st->dpy, st->window, 0, &st->gcv);
-#ifdef HAVE_
COCOA
+#ifdef HAVE_
JWXYZ
jwxyz_XSetAntiAliasing (dpy, st->fgc, False);
jwxyz_XSetAntiAliasing (dpy, st->bgc, False);
#endif
jwxyz_XSetAntiAliasing (dpy, st->fgc, False);
jwxyz_XSetAntiAliasing (dpy, st->bgc, False);
#endif