git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
darwin fixes
[swftools.git]
/
lib
/
gfxpoly
/
poly.c
diff --git
a/lib/gfxpoly/poly.c
b/lib/gfxpoly/poly.c
index
efb51fe
..
eb1b6b1
100644
(file)
--- a/
lib/gfxpoly/poly.c
+++ b/
lib/gfxpoly/poly.c
@@
-19,7
+19,7
@@
void gfxpoly_fail(char*expr, char*file, int line, const char*function)
exit(1);
}
exit(1);
}
- void*md5 = init_md5();
+ void*md5 = initialize_md5();
int s,t;
gfxpolystroke_t*stroke = current_polygon->strokes;
int s,t;
gfxpolystroke_t*stroke = current_polygon->strokes;
@@
-167,6
+167,7
@@
int gfxpoly_size(gfxpoly_t*poly)
char gfxpoly_check(gfxpoly_t*poly)
{
char gfxpoly_check(gfxpoly_t*poly)
{
+ current_polygon = poly;
dict_t*d = dict_new2(&point_type);
int s,t;
gfxpolystroke_t*stroke = poly->strokes;
dict_t*d = dict_new2(&point_type);
int s,t;
gfxpolystroke_t*stroke = poly->strokes;
@@
-200,10
+201,10
@@
void gfxpoly_dump(gfxpoly_t*poly)
{
int s,t;
double g = poly->gridsize;
{
int s,t;
double g = poly->gridsize;
- fprintf(stderr, "polyon %08x (gridsize: %f)\n", poly, poly->gridsize);
+ fprintf(stderr, "polyon %08x (gridsize: %f)\n", (int)poly, poly->gridsize);
gfxpolystroke_t*stroke = poly->strokes;
for(;stroke;stroke=stroke->next) {
gfxpolystroke_t*stroke = poly->strokes;
for(;stroke;stroke=stroke->next) {
- fprintf(stderr, "%08x", stroke);
+ fprintf(stderr, "%08x", (int)stroke);
for(s=0;s<stroke->num_points-1;s++) {
point_t a = stroke->points[s];
point_t b = stroke->points[s+1];
for(s=0;s<stroke->num_points-1;s++) {
point_t a = stroke->points[s];
point_t b = stroke->points[s+1];
@@
-259,8
+260,8
@@
static void event_dump(event_t*e)
}
}
}
}
-static inline max32(int32_t v1, int32_t v2) {return v1>v2?v1:v2;}
-static inline min32(int32_t v1, int32_t v2) {return v1<v2?v1:v2;}
+static inline int32_t max32(int32_t v1, int32_t v2) {return v1>v2?v1:v2;}
+static inline int32_t min32(int32_t v1, int32_t v2) {return v1<v2?v1:v2;}
static void segment_dump(segment_t*s)
{
static void segment_dump(segment_t*s)
{
@@
-304,6
+305,11
@@
static void segment_init(segment_t*s, int32_t x1, int32_t y1, int32_t x2, int32_
s->nr = segment_count++;
#ifdef CHECKS
s->nr = segment_count++;
#ifdef CHECKS
+ /* notice: on some systems (with some compilers), for the line
+ (1073741823,-1073741824)->(1073741823,1073741823)
+ we get LINE_EQ(s->a, s) == 1.
+ That's why we now clamp to 26 bit.
+ */
assert(LINE_EQ(s->a, s) == 0);
assert(LINE_EQ(s->b, s) == 0);
assert(LINE_EQ(s->a, s) == 0);
assert(LINE_EQ(s->b, s) == 0);