summaryrefslogtreecommitdiff
path: root/src/cairo-array.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-05-03 00:26:22 -0700
committerCarl Worth <cworth@cworth.org>2006-05-03 00:26:22 -0700
commit09dfd6c3c16ed36b0e9693cfcbb3b679bd18f585 (patch)
treeb4a0154f5ba973e525febe011bc3ce595edfd5cb /src/cairo-array.c
parent253472492ee2a690646a30b32cf8180f5b6e3299 (diff)
downloadcairo-09dfd6c3c16ed36b0e9693cfcbb3b679bd18f585.tar.gz
PS: Add three new public functions for emitting DSC comments.
This commit adds the following new functions to the cairo-ps API: cairo_ps_surface_dsc_comment cairo_ps_surface_dsc_begin_setup cairo_ps_surface_dsc_begin_page_setup Many thanks are due to Michael Sweet who provided invaluble guidance during the design of this API. It is hoped that with this API in place, basically all printer control that is likely to be desired to be performed with cairo PostScript output is now possible. This commit augments the ps-features test to exercise the new API.
Diffstat (limited to 'src/cairo-array.c')
-rw-r--r--src/cairo-array.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cairo-array.c b/src/cairo-array.c
index ed9538b0d..7252101b2 100644
--- a/src/cairo-array.c
+++ b/src/cairo-array.c
@@ -200,10 +200,8 @@ _cairo_array_index (cairo_array_t *array, int index)
* which in the num_elements==0 case gets the NULL pointer here,
* but never dereferences it.
*/
- if (array->elements == NULL) {
- assert (index == 0);
+ if (index == 0 && array->num_elements == 0)
return NULL;
- }
assert (0 <= index && index < array->num_elements);