diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-01-30 14:05:56 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2013-01-30 14:13:01 +0100 |
commit | 29f7d13d37022303c5d93ddd2942f6b87959f432 (patch) | |
tree | 0f1eeb4f3778713fe99b34649336aa27ddaf9a71 /pdf | |
parent | 01e2ccf6ade55cc20e83b80bad81fef6627c9a05 (diff) | |
download | mupdf-29f7d13d37022303c5d93ddd2942f6b87959f432.tar.xz |
Always pass value structs (rect, matrix, etc) as values not by pointer.
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/mupdf-internal.h | 2 | ||||
-rw-r--r-- | pdf/mupdf.h | 4 | ||||
-rw-r--r-- | pdf/pdf_form.c | 6 | ||||
-rw-r--r-- | pdf/pdf_object.c | 24 | ||||
-rw-r--r-- | pdf/pdf_xobject.c | 6 |
5 files changed, 21 insertions, 21 deletions
diff --git a/pdf/mupdf-internal.h b/pdf/mupdf-internal.h index fdf6a26d..8e0d24a4 100644 --- a/pdf/mupdf-internal.h +++ b/pdf/mupdf-internal.h @@ -284,7 +284,7 @@ struct pdf_xobject_s }; pdf_xobject *pdf_load_xobject(pdf_document *doc, pdf_obj *obj); -pdf_obj *pdf_new_xobject(pdf_document *doc, fz_rect *bbox, fz_matrix *mat); +pdf_obj *pdf_new_xobject(pdf_document *doc, fz_rect bbox, fz_matrix mat); pdf_xobject *pdf_keep_xobject(fz_context *ctx, pdf_xobject *xobj); void pdf_drop_xobject(fz_context *ctx, pdf_xobject *xobj); void pdf_update_xobject_contents(pdf_document *xref, pdf_xobject *form, fz_buffer *buffer); diff --git a/pdf/mupdf.h b/pdf/mupdf.h index 72248017..475ebd79 100644 --- a/pdf/mupdf.h +++ b/pdf/mupdf.h @@ -22,8 +22,8 @@ pdf_obj *pdf_new_string(fz_context *ctx, const char *str, int len); pdf_obj *pdf_new_indirect(fz_context *ctx, int num, int gen, void *doc); pdf_obj *pdf_new_array(fz_context *ctx, int initialcap); pdf_obj *pdf_new_dict(fz_context *ctx, int initialcap); -pdf_obj *pdf_new_rect(fz_context *ctx, fz_rect *rect); -pdf_obj *pdf_new_matrix(fz_context *ctx, fz_matrix *mtx); +pdf_obj *pdf_new_rect(fz_context *ctx, fz_rect rect); +pdf_obj *pdf_new_matrix(fz_context *ctx, fz_matrix mtx); pdf_obj *pdf_copy_array(fz_context *ctx, pdf_obj *array); pdf_obj *pdf_copy_dict(fz_context *ctx, pdf_obj *dict); diff --git a/pdf/pdf_form.c b/pdf/pdf_form.c index bdec208a..8603986c 100644 --- a/pdf/pdf_form.c +++ b/pdf/pdf_form.c @@ -1186,7 +1186,7 @@ static pdf_xobject *load_or_create_form(pdf_document *doc, pdf_obj *obj, fz_rect formobj = pdf_dict_gets(ap, dn); if (formobj == NULL) { - tobj = pdf_new_xobject(doc, rect, &mat); + tobj = pdf_new_xobject(doc, *rect, mat); pdf_dict_puts(ap, dn, tobj); formobj = tobj; pdf_drop_obj(tobj); @@ -2602,11 +2602,11 @@ void pdf_field_set_text_color(pdf_document *doc, pdf_obj *field, pdf_obj *col) } } -fz_rect *fz_widget_bbox(fz_widget *widget) +fz_rect fz_widget_bbox(fz_widget *widget) { pdf_annot *annot = (pdf_annot *)widget; - return &annot->pagerect; + return annot->pagerect; } char *pdf_text_widget_text(pdf_document *doc, fz_widget *tw) diff --git a/pdf/pdf_object.c b/pdf/pdf_object.c index dba15872..9ebb4aec 100644 --- a/pdf/pdf_object.c +++ b/pdf/pdf_object.c @@ -575,7 +575,7 @@ pdf_array_contains(pdf_obj *arr, pdf_obj *obj) return 0; } -pdf_obj *pdf_new_rect(fz_context *ctx, fz_rect *rect) +pdf_obj *pdf_new_rect(fz_context *ctx, fz_rect rect) { pdf_obj *arr = NULL; pdf_obj *item = NULL; @@ -586,22 +586,22 @@ pdf_obj *pdf_new_rect(fz_context *ctx, fz_rect *rect) { arr = pdf_new_array(ctx, 4); - item = pdf_new_real(ctx, rect->x0); + item = pdf_new_real(ctx, rect.x0); pdf_array_push(arr, item); pdf_drop_obj(item); item = NULL; - item = pdf_new_real(ctx, rect->y0); + item = pdf_new_real(ctx, rect.y0); pdf_array_push(arr, item); pdf_drop_obj(item); item = NULL; - item = pdf_new_real(ctx, rect->x1); + item = pdf_new_real(ctx, rect.x1); pdf_array_push(arr, item); pdf_drop_obj(item); item = NULL; - item = pdf_new_real(ctx, rect->y1); + item = pdf_new_real(ctx, rect.y1); pdf_array_push(arr, item); pdf_drop_obj(item); item = NULL; @@ -616,7 +616,7 @@ pdf_obj *pdf_new_rect(fz_context *ctx, fz_rect *rect) return arr; } -pdf_obj *pdf_new_matrix(fz_context *ctx, fz_matrix *mtx) +pdf_obj *pdf_new_matrix(fz_context *ctx, fz_matrix mtx) { pdf_obj *arr = NULL; pdf_obj *item = NULL; @@ -627,32 +627,32 @@ pdf_obj *pdf_new_matrix(fz_context *ctx, fz_matrix *mtx) { arr = pdf_new_array(ctx, 6); - item = pdf_new_real(ctx, mtx->a); + item = pdf_new_real(ctx, mtx.a); pdf_array_push(arr, item); pdf_drop_obj(item); item = NULL; - item = pdf_new_real(ctx, mtx->b); + item = pdf_new_real(ctx, mtx.b); pdf_array_push(arr, item); pdf_drop_obj(item); item = NULL; - item = pdf_new_real(ctx, mtx->c); + item = pdf_new_real(ctx, mtx.c); pdf_array_push(arr, item); pdf_drop_obj(item); item = NULL; - item = pdf_new_real(ctx, mtx->d); + item = pdf_new_real(ctx, mtx.d); pdf_array_push(arr, item); pdf_drop_obj(item); item = NULL; - item = pdf_new_real(ctx, mtx->e); + item = pdf_new_real(ctx, mtx.e); pdf_array_push(arr, item); pdf_drop_obj(item); item = NULL; - item = pdf_new_real(ctx, mtx->f); + item = pdf_new_real(ctx, mtx.f); pdf_array_push(arr, item); pdf_drop_obj(item); item = NULL; diff --git a/pdf/pdf_xobject.c b/pdf/pdf_xobject.c index 86b45167..e236edd0 100644 --- a/pdf/pdf_xobject.c +++ b/pdf/pdf_xobject.c @@ -111,7 +111,7 @@ pdf_load_xobject(pdf_document *xref, pdf_obj *dict) } pdf_obj * -pdf_new_xobject(pdf_document *xref, fz_rect *bbox, fz_matrix *mat) +pdf_new_xobject(pdf_document *xref, fz_rect bbox, fz_matrix mat) { int idict_num; pdf_obj *idict = NULL; @@ -185,9 +185,9 @@ pdf_new_xobject(pdf_document *xref, fz_rect *bbox, fz_matrix *mat) form->me = NULL; form->iteration = 0; - form->bbox = *bbox; + form->bbox = bbox; - form->matrix = *mat; + form->matrix = mat; form->isolated = 0; form->knockout = 0; |