summaryrefslogtreecommitdiff
path: root/pdf/pdf_metrics.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-09-14 17:36:57 +0100
committerRobin Watts <Robin.Watts@artifex.com>2011-09-15 14:50:17 +0100
commitb51ef0eea028c73b6379e832eaa34fff3fbbb927 (patch)
tree1ab685ccd356e7fdc832b2e3322c0486b2670cfb /pdf/pdf_metrics.c
parent89ae81f651bfa112b8e07317eb6983beaf7cb212 (diff)
downloadmupdf-b51ef0eea028c73b6379e832eaa34fff3fbbb927.tar.xz
Add context to mupdf.
Huge pervasive change to lots of files, adding a context for exception handling and allocation. In time we'll move more statics into there. Also fix some for(i = 0; i < function(...); i++) calls.
Diffstat (limited to 'pdf/pdf_metrics.c')
-rw-r--r--pdf/pdf_metrics.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pdf/pdf_metrics.c b/pdf/pdf_metrics.c
index 2fc085de..62353f9f 100644
--- a/pdf/pdf_metrics.c
+++ b/pdf/pdf_metrics.c
@@ -21,12 +21,12 @@ pdf_set_default_vmtx(pdf_font_desc *font, int y, int w)
}
void
-pdf_add_hmtx(pdf_font_desc *font, int lo, int hi, int w)
+pdf_add_hmtx(fz_context *ctx, pdf_font_desc *font, int lo, int hi, int w)
{
if (font->hmtx_len + 1 >= font->hmtx_cap)
{
font->hmtx_cap = font->hmtx_cap + 16;
- font->hmtx = fz_realloc(font->hmtx, font->hmtx_cap, sizeof(pdf_hmtx));
+ font->hmtx = fz_realloc(ctx, font->hmtx, font->hmtx_cap * sizeof(pdf_hmtx));
}
font->hmtx[font->hmtx_len].lo = lo;
@@ -36,12 +36,12 @@ pdf_add_hmtx(pdf_font_desc *font, int lo, int hi, int w)
}
void
-pdf_add_vmtx(pdf_font_desc *font, int lo, int hi, int x, int y, int w)
+pdf_add_vmtx(fz_context *ctx, pdf_font_desc *font, int lo, int hi, int x, int y, int w)
{
if (font->vmtx_len + 1 >= font->vmtx_cap)
{
font->vmtx_cap = font->vmtx_cap + 16;
- font->vmtx = fz_realloc(font->vmtx, font->vmtx_cap, sizeof(pdf_vmtx));
+ font->vmtx = fz_realloc(ctx, font->vmtx, font->vmtx_cap * sizeof(pdf_vmtx));
}
font->vmtx[font->vmtx_len].lo = lo;