git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
390a621
)
some indenting/style fixes.
author
kramm
<kramm>
Thu, 28 Oct 2004 16:30:52 +0000
(16:30 +0000)
committer
kramm
<kramm>
Thu, 28 Oct 2004 16:30:52 +0000
(16:30 +0000)
lib/modules/swfshape.c
patch
|
blob
|
history
diff --git
a/lib/modules/swfshape.c
b/lib/modules/swfshape.c
index
3ecd8ff
..
7fca06e
100644
(file)
--- a/
lib/modules/swfshape.c
+++ b/
lib/modules/swfshape.c
@@
-34,8
+34,10
@@
#define FILL_CLIPPED 0x41
void swf_ShapeFree(SHAPE * s)
#define FILL_CLIPPED 0x41
void swf_ShapeFree(SHAPE * s)
-{ if (s)
- { if (s->linestyle.data) free(s->linestyle.data);
+{
+ if(!s)
+ return;
+ if (s->linestyle.data) free(s->linestyle.data);
s->linestyle.data = NULL;
s->linestyle.n = 0;
if (s->fillstyle.data) free(s->fillstyle.data);
s->linestyle.data = NULL;
s->linestyle.n = 0;
if (s->fillstyle.data) free(s->fillstyle.data);
@@
-43,16
+45,17
@@
void swf_ShapeFree(SHAPE * s)
s->fillstyle.n = 0;
if (s->data) free(s->data);
s->data = NULL;
s->fillstyle.n = 0;
if (s->data) free(s->data);
s->data = NULL;
- }
- free(s);
+ free(s);
}
int swf_ShapeNew(SHAPE * * s)
}
int swf_ShapeNew(SHAPE * * s)
-{ SHAPE * sh;
- if (!s) return -1;
- sh = (SHAPE *)malloc(sizeof(SHAPE)); s[0] = sh;
- if (sh) memset(sh,0x00,sizeof(SHAPE));
- return sh?0:-1;
+{
+ SHAPE * sh;
+ if (!s) return -1;
+ sh = (SHAPE *)malloc(sizeof(SHAPE));
+ *s = sh;
+ memset(sh,0,sizeof(SHAPE));
+ return 0;
}
int swf_GetSimpleShape(TAG * t,SHAPE * * s) // without Linestyle/Fillstyle Record
}
int swf_GetSimpleShape(TAG * t,SHAPE * * s) // without Linestyle/Fillstyle Record
@@
-169,8
+172,6
@@
int swf_SetFillStyle(TAG * t,FILLSTYLE * f)
{ if ((!t)||(!f)) return -1;
swf_SetU8(t,f->type);
{ if ((!t)||(!f)) return -1;
swf_SetU8(t,f->type);
- // no gradients yet!
-
switch (f->type)
{ case FILL_SOLID:
if (swf_GetTagID(t)!=ST_DEFINESHAPE3) swf_SetRGB(t,&f->color);
switch (f->type)
{ case FILL_SOLID:
if (swf_GetTagID(t)!=ST_DEFINESHAPE3) swf_SetRGB(t,&f->color);