summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2009-12-02 22:58:30 +0100
committerSebastian Rasmussen <sebras@hotmail.com>2009-12-02 22:58:30 +0100
commitff9d3beea5976c998896678ae5f4fe7e1c42ed61 (patch)
tree67461f825625b89b0debd023afd2ab3752df2df4
parente82242e0ad0f8d286796d5a6b8c262cd4e28d6bc (diff)
downloadmupdf-ff9d3beea5976c998896678ae5f4fe7e1c42ed61.tar.xz
Have image and colorspace freeing adhere to common naming scheme.
-rw-r--r--fitz/fitz_tree.h4
-rw-r--r--fitz/res_colorspace.c4
-rw-r--r--fitz/res_image.c4
-rw-r--r--mupdf/pdf_colorspace1.c12
-rw-r--r--mupdf/pdf_image.c12
5 files changed, 18 insertions, 18 deletions
diff --git a/fitz/fitz_tree.h b/fitz/fitz_tree.h
index 74962048..29da14cb 100644
--- a/fitz/fitz_tree.h
+++ b/fitz/fitz_tree.h
@@ -319,7 +319,7 @@ struct fz_colorspace_s
void (*convcolor)(fz_colorspace *ss, float *sv, fz_colorspace *ds, float *dv);
void (*toxyz)(fz_colorspace *, float *src, float *xyz);
void (*fromxyz)(fz_colorspace *, float *xyz, float *dst);
- void (*drop)(fz_colorspace *);
+ void (*freefunc)(fz_colorspace *);
};
struct fz_colorcube1_s { unsigned char v[17]; };
@@ -386,7 +386,7 @@ struct fz_image_s
{
int refs;
fz_error (*loadtile)(fz_image*,fz_pixmap*);
- void (*drop)(fz_image*);
+ void (*freefunc)(fz_image*);
fz_colorspace *cs;
int w, h, n, a;
};
diff --git a/fitz/res_colorspace.c b/fitz/res_colorspace.c
index 63378538..9de10973 100644
--- a/fitz/res_colorspace.c
+++ b/fitz/res_colorspace.c
@@ -29,8 +29,8 @@ fz_dropcolorspace(fz_colorspace *cs)
return;
if (cs && --cs->refs == 0)
{
- if (cs->drop)
- cs->drop(cs);
+ if (cs->freefunc)
+ cs->freefunc(cs);
fz_free(cs);
}
}
diff --git a/fitz/res_image.c b/fitz/res_image.c
index f906f0ae..e5918c64 100644
--- a/fitz/res_image.c
+++ b/fitz/res_image.c
@@ -13,8 +13,8 @@ fz_dropimage(fz_image *image)
{
if (image && --image->refs == 0)
{
- if (image->drop)
- image->drop(image);
+ if (image->freefunc)
+ image->freefunc(image);
if (image->cs)
fz_dropcolorspace(image->cs);
fz_free(image);
diff --git a/mupdf/pdf_colorspace1.c b/mupdf/pdf_colorspace1.c
index 584520de..b6038afe 100644
--- a/mupdf/pdf_colorspace1.c
+++ b/mupdf/pdf_colorspace1.c
@@ -6,7 +6,7 @@
static void initcs(fz_colorspace *cs, char *name, int n,
void(*to)(fz_colorspace*,float*,float*),
void(*from)(fz_colorspace*,float*,float*),
- void(*drop)(fz_colorspace*))
+ void(*freefunc)(fz_colorspace*))
{
strlcpy(cs->name, name, sizeof cs->name);
cs->refs = 1;
@@ -14,7 +14,7 @@ static void initcs(fz_colorspace *cs, char *name, int n,
cs->convcolor = pdf_convcolor;
cs->toxyz = to;
cs->fromxyz = from;
- cs->drop = drop;
+ cs->freefunc = freefunc;
cs->n = n;
}
@@ -444,7 +444,7 @@ static void separationtoxyz(fz_colorspace *fzcs, float *sep, float *xyz)
}
static void
-dropseparation(fz_colorspace *fzcs)
+freeseparation(fz_colorspace *fzcs)
{
struct separation *cs = (struct separation *)fzcs;
fz_dropcolorspace(cs->base);
@@ -490,7 +490,7 @@ loadseparation(fz_colorspace **csp, pdf_xref *xref, fz_obj *array)
initcs((fz_colorspace*)cs,
n == 1 ? "Separation" : "DeviceN", n,
- separationtoxyz, nil, dropseparation);
+ separationtoxyz, nil, freeseparation);
cs->base = fz_keepcolorspace(base);
cs->tint = pdf_keepfunction(tint);
@@ -524,7 +524,7 @@ indexedtoxyz(fz_colorspace *fzcs, float *ind, float *xyz)
#endif
static void
-dropindexed(fz_colorspace *fzcs)
+freeindexed(fz_colorspace *fzcs)
{
pdf_indexed *cs = (pdf_indexed *)fzcs;
if (cs->base) fz_dropcolorspace(cs->base);
@@ -552,7 +552,7 @@ loadindexed(fz_colorspace **csp, pdf_xref *xref, fz_obj *array)
cs = fz_malloc(sizeof(pdf_indexed));
- initcs((fz_colorspace*)cs, "Indexed", 1, nil, nil, dropindexed);
+ initcs((fz_colorspace*)cs, "Indexed", 1, nil, nil, freeindexed);
cs->base = fz_keepcolorspace(base);
cs->high = fz_toint(highobj);
diff --git a/mupdf/pdf_image.c b/mupdf/pdf_image.c
index db67acd5..424806ab 100644
--- a/mupdf/pdf_image.c
+++ b/mupdf/pdf_image.c
@@ -5,8 +5,8 @@
#include "fitz.h"
#include "mupdf.h"
-// this should be called from fz_dropimage
-void pdf_dropimage(fz_image *fzimg)
+static void
+pdf_freeimage(fz_image *fzimg)
{
pdf_image *img = (pdf_image*)fzimg;
fz_dropbuffer(img->samples);
@@ -36,7 +36,7 @@ pdf_loadinlineimage(pdf_image **imgp, pdf_xref *xref,
img->super.refs = 1;
img->super.cs = nil;
img->super.loadtile = pdf_loadtile;
- img->super.drop = pdf_dropimage;
+ img->super.freefunc = pdf_freeimage;
img->super.n = 0;
img->super.a = 0;
img->indexed = nil;
@@ -76,7 +76,7 @@ pdf_loadinlineimage(pdf_image **imgp, pdf_xref *xref,
error = pdf_loadcolorspace(&img->super.cs, xref, cso);
if (error)
{
- pdf_dropimage((fz_image *) img);
+ pdf_freeimage((fz_image *) img);
return fz_rethrow(error, "cannot load colorspace");
}
@@ -339,7 +339,7 @@ pdf_loadimage(pdf_image **imgp, pdf_xref *xref, fz_obj *dict)
if (mask)
{
fz_warn("image has both a mask and a soft mask. ignoring the soft mask.");
- pdf_dropimage((fz_image*)mask);
+ pdf_freeimage((fz_image*)mask);
mask = nil;
}
error = pdf_loadimage(&mask, xref, obj);
@@ -425,7 +425,7 @@ pdf_loadimage(pdf_image **imgp, pdf_xref *xref, fz_obj *dict)
img->super.refs = 1;
img->super.loadtile = pdf_loadtile;
- img->super.drop = pdf_dropimage;
+ img->super.freefunc = pdf_freeimage;
img->super.cs = cs;
img->super.w = w;
img->super.h = h;