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.19.tar.gz
[xscreensaver]
/
hacks
/
glx
/
polyhedra.c
diff --git
a/hacks/glx/polyhedra.c
b/hacks/glx/polyhedra.c
index 72538b34a0042e35b2746ea83c7d10c8804e64a9..26f66d3a5338d232eba795ff55695ba0786b8146 100644
(file)
--- a/
hacks/glx/polyhedra.c
+++ b/
hacks/glx/polyhedra.c
@@
-91,23
+91,23
@@
extern const char *progname;
} while(0)
#define Malloc(lvalue,n,type) do {\
} while(0)
#define Malloc(lvalue,n,type) do {\
- if (!(lvalue = (type*)
malloc((n) *
sizeof(type)))) \
-
Err("out of memory"
);\
+ if (!(lvalue = (type*)
calloc((n),
sizeof(type)))) \
+
abort(
);\
} while(0)
#define Realloc(lvalue,n,type) do {\
if (!(lvalue = (type*) realloc(lvalue, (n) * sizeof(type)))) \
} while(0)
#define Realloc(lvalue,n,type) do {\
if (!(lvalue = (type*) realloc(lvalue, (n) * sizeof(type)))) \
-
Err("out of memory"
);\
+
abort(
);\
} while(0)
#define Calloc(lvalue,n,type) do {\
if (!(lvalue = (type*) calloc(n, sizeof(type))))\
} while(0)
#define Calloc(lvalue,n,type) do {\
if (!(lvalue = (type*) calloc(n, sizeof(type))))\
-
Err("out of memory"
);\
+
abort(
);\
} while(0)
#define Matalloc(lvalue,n,m,type) do {\
if (!(lvalue = (type**) matalloc(n, (m) * sizeof(type))))\
} while(0)
#define Matalloc(lvalue,n,m,type) do {\
if (!(lvalue = (type**) matalloc(n, (m) * sizeof(type))))\
-
Err("out of memory"
);\
+
abort(
);\
} while(0)
#define Sprintfrac(lvalue,x) do {\
} while(0)
#define Sprintfrac(lvalue,x) do {\
@@
-200,6
+200,16
@@
static const struct {
* Dihedral Schwarz Triangles (D5 only)
***************************************************************************/
* Dihedral Schwarz Triangles (D5 only)
***************************************************************************/
+ /* {"3|2 5/2", "xyz",
+ "xyz",
+ "xyz",
+ "",
+ "",
+ 0, 0},
+*/
+
+
+
/* (2 2 5) (D1/5) */
/* 1 */ {"2 5|2", "Pentagonal Prism",
"Pentagonal Dipyramid",
/* (2 2 5) (D1/5) */
/* 1 */ {"2 5|2", "Pentagonal Prism",
"Pentagonal Dipyramid",
@@
-447,7
+457,7
@@
static const struct {
"Catalan Solid",
30, 14},
"Catalan Solid",
30, 14},
- /* 33 */ {"2 3 5|", "Truncated Icosidodec
hed
on",
+ /* 33 */ {"2 3 5|", "Truncated Icosidodec
ahedr
on",
"Disdyakistriacontahedron",
"Icosahedral (I[1])",
"Archimedian Solid",
"Disdyakistriacontahedron",
"Icosahedral (I[1])",
"Archimedian Solid",
@@
-2263,7
+2273,7
@@
construct_polyhedron (Polyhedron *P, Vector *v, int V, Vector *f, int F,
facelets++;
} else if (P->even != -1) {
facelets++;
} else if (P->even != -1) {
- if (hit[i]) {
+ if (hit
&& hit
[i]) {
push_face3 (result, P->incid[3][i], P->incid[0][i], ii);
push_face3 (result, P->incid[1][i], P->incid[2][i], ii);
} else {
push_face3 (result, P->incid[3][i], P->incid[0][i], ii);
push_face3 (result, P->incid[1][i], P->incid[2][i], ii);
} else {
@@
-2418,7
+2428,7
@@
construct_polyhedra (polyhedron ***polyhedra_ret)
int count = 0;
polyhedron **result;
int count = 0;
polyhedron **result;
- Malloc (result, last_uniform * 2 +
1
, polyhedron*);
+ Malloc (result, last_uniform * 2 +
3
, polyhedron*);
while (index < last_uniform) {
char sym[4];
while (index < last_uniform) {
char sym[4];
@@
-2443,5
+2453,6
@@
construct_polyhedra (polyhedron ***polyhedra_ret)
}
*polyhedra_ret = result;
}
*polyhedra_ret = result;
+ count++; /* leave room for teapot */
return count;
}
return count;
}