git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
implemented conditional compilation
[swftools.git]
/
lib
/
devices
/
ops.c
diff --git
a/lib/devices/ops.c
b/lib/devices/ops.c
index
911bc47
..
cb0c6f1
100644
(file)
--- a/
lib/devices/ops.c
+++ b/
lib/devices/ops.c
@@
-21,12
+21,16
@@
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
+#ifndef WIN32
#include <unistd.h>
#include <unistd.h>
+#endif
#include <memory.h>
#include <memory.h>
+#include <string.h>
#include "../types.h"
#include "../mem.h"
#include "../gfxdevice.h"
#include "../gfxtools.h"
#include "../types.h"
#include "../mem.h"
#include "../gfxdevice.h"
#include "../gfxtools.h"
+#include "ops.h"
typedef struct _internal {
gfxdevice_t*out;
typedef struct _internal {
gfxdevice_t*out;
@@
-110,7
+114,7
@@
void ops_fillbitmap(struct _gfxdevice*dev, gfxline_t*line, gfximage_t*img, gfxma
gfximage_t img2;
img2.width = img->width;
img2.height = img->height;
gfximage_t img2;
img2.width = img->width;
img2.height = img->height;
- img2.data = malloc(img->width*img->height*4);
+ img2.data = (gfxcolor_t*)malloc(img->width*img->height*4);
int x,y;
for(y=0;y<img->height;y++) {
gfxcolor_t*in = &img->data[y*img->width];
int x,y;
for(y=0;y<img->height;y++) {
gfxcolor_t*in = &img->data[y*img->width];
@@
-142,7
+146,7
@@
void ops_drawchar(struct _gfxdevice*dev, gfxfont_t*font, int glyphnr, gfxcolor_t
i->out->drawchar(i->out, font, glyphnr, color, matrix);
}
i->out->drawchar(i->out, font, glyphnr, color, matrix);
}
-void ops_drawlink(struct _gfxdevice*dev, gfxline_t*line, char*action)
+void ops_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action)
{
internal_t*i = (internal_t*)dev->internal;
i->out->drawlink(i->out, line, action);
{
internal_t*i = (internal_t*)dev->internal;
i->out->drawlink(i->out, line, action);
@@
-156,7
+160,9
@@
void ops_endpage(struct _gfxdevice*dev)
gfxresult_t* ops_finish(struct _gfxdevice*dev)
{
gfxresult_t* ops_finish(struct _gfxdevice*dev)
{
- free(dev->internal);dev->internal = 0;
+ if(dev->internal)
+ free(dev->internal);
+ dev->internal = 0;
return 0;
}
return 0;
}