summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-06-13 16:29:58 +0100
committerRobin Watts <robin.watts@artifex.com>2012-06-13 16:46:53 +0100
commit2032c57a56631435de30df689fc78939f1650bf8 (patch)
treeeaa9932fffabfa04b2dff20211597941f1113451
parentf67c1db3c59121e55bd6e2fddc08f350c2633ca6 (diff)
downloadmupdf-2032c57a56631435de30df689fc78939f1650bf8.tar.xz
Tweak pdf_new_{rect,matrix,xobject} to avoid warnings.
These functions currently call pdf_array_put, but this fails to extend the array. Change to use pdf_array_push instead.
-rw-r--r--pdf/pdf_object.c20
-rw-r--r--pdf/pdf_xobject.c4
2 files changed, 12 insertions, 12 deletions
diff --git a/pdf/pdf_object.c b/pdf/pdf_object.c
index 60f10a54..2f96f213 100644
--- a/pdf/pdf_object.c
+++ b/pdf/pdf_object.c
@@ -579,22 +579,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);
- pdf_array_put(arr, 0, item);
+ pdf_array_push(arr, item);
pdf_drop_obj(item);
item = NULL;
item = pdf_new_real(ctx, rect->y0);
- pdf_array_put(arr, 1, item);
+ pdf_array_push(arr, item);
pdf_drop_obj(item);
item = NULL;
item = pdf_new_real(ctx, rect->x1 - rect->x0);
- pdf_array_put(arr, 2, item);
+ pdf_array_push(arr, item);
pdf_drop_obj(item);
item = NULL;
item = pdf_new_real(ctx, rect->y1 - rect->y0);
- pdf_array_put(arr, 3, item);
+ pdf_array_push(arr, item);
pdf_drop_obj(item);
item = NULL;
}
@@ -620,32 +620,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);
- pdf_array_put(arr, 0, item);
+ pdf_array_push(arr, item);
pdf_drop_obj(item);
item = NULL;
item = pdf_new_real(ctx, mtx->b);
- pdf_array_put(arr, 1, item);
+ pdf_array_push(arr, item);
pdf_drop_obj(item);
item = NULL;
item = pdf_new_real(ctx, mtx->c);
- pdf_array_put(arr, 2, item);
+ pdf_array_push(arr, item);
pdf_drop_obj(item);
item = NULL;
item = pdf_new_real(ctx, mtx->d);
- pdf_array_put(arr, 3, item);
+ pdf_array_push(arr, item);
pdf_drop_obj(item);
item = NULL;
item = pdf_new_real(ctx, mtx->e);
- pdf_array_put(arr, 4, item);
+ pdf_array_push(arr, item);
pdf_drop_obj(item);
item = NULL;
item = pdf_new_real(ctx, mtx->f);
- pdf_array_put(arr, 5, item);
+ pdf_array_push(arr, item);
pdf_drop_obj(item);
item = NULL;
}
diff --git a/pdf/pdf_xobject.c b/pdf/pdf_xobject.c
index 877a8a28..f21ecaf6 100644
--- a/pdf/pdf_xobject.c
+++ b/pdf/pdf_xobject.c
@@ -156,11 +156,11 @@ pdf_new_xobject(pdf_document *xref, fz_rect *bbox, fz_matrix *mat)
res = pdf_new_dict(ctx, 0);
procset = pdf_new_array(ctx, 2);
obj = fz_new_name(ctx, "PDF");
- pdf_array_put(procset, 0, obj);
+ pdf_array_push(procset, obj);
pdf_drop_obj(obj);
obj = NULL;
obj = fz_new_name(ctx, "Text");
- pdf_array_put(procset, 1, obj);
+ pdf_array_push(procset, obj);
pdf_drop_obj(obj);
obj = NULL;
pdf_dict_puts(res, "ProcSet", procset);