summaryrefslogtreecommitdiff
path: root/fitz/base_object.c
AgeCommit message (Collapse)Author
2012-01-27Rename pdf_xref type to pdf_document.Tor Andersson
2012-01-27Whitespace fixes.Tor Andersson
2012-01-13Rework pdf_resolve_indirect to make it idempotent.Robin Watts
pdf_resolve_indirect(x) = pdf_resolve_indirect(pdf_resolve_indirect(x)) now - as long as it doesn't throw an exception. Update the rest of the code to minimise unnecessary function calls. Previously, we were calling one function to find out if an object was a dict, only for that to call a function to see if it needed to resolve the object, then calling another function to actually get the dict, only to have that call the function to check for the dict needing resolving again!
2012-01-06Add 'marking' functions for dictionaries.Robin Watts
In various places in the code, we add markers (".seen") to dictionaries as we traverse them to ensure that we don't go into infinite loops. Adding a dictionary entry is bad as it's a) an expensive operation, b) a potentially destructive one, and c) produces another possible point of failure (as mallocs can fail). Instead, add a flag to each dict to allow them to be marked/unmarked and use that instead. Thanks to Zeniko for pointing out various places that could usefully be protected against infinite recursion.
2011-12-16Fix another Memento_label warning.Robin Watts
Missed this one last time.
2011-12-16Fix Memento_label related warnings in non-memento builds.Robin Watts
2011-12-16Add fz_malloc_struct, and make code use it.Robin Watts
The new fz_malloc_struct(A,B) macro allocates sizeof(B) bytes using fz_malloc, and then passes the resultant pointer to Memento_label to label it with "B". This costs nothing in non-memento builds, but gives much nicer listings of leaked blocks when memento is enabled.
2011-12-15Various Memsqueezing fixes.Robin Watts
Fixes for leaks (and SEGVs, division by zeros etc) seen when Memsqueezing.
2011-12-08Stylistic changes when testing pointer values for NULL.Tor Andersson
Also: use 'cannot' instead of 'failed to' in error messages.
2011-12-08Merge branch 'master' into contextRobin Watts
2011-12-08Round instead of truncate when converting reals to ints in fz_to_int.Tor Andersson
2011-11-25Merge branch 'master' into contextRobin Watts
2011-11-17Bug 692487: Make pdfclean keep internal links where possible.Robin Watts
Take on a (cosmetically tweaked) version of Zenikos patch to allow pdfclean to keep link destinations that are in preserved pages.
2011-11-15Merge branch 'master' into contextRobin Watts
Mostly redoing the xps_context to xps_document change and adding contexts to newly written code. Conflicts: apps/pdfapp.c apps/pdfapp.h apps/x11_main.c apps/xpsdraw.c draw/draw_device.c draw/draw_scale.c fitz/base_object.c fitz/fitz.h pdf/mupdf.h pdf/pdf_interpret.c pdf/pdf_outline.c pdf/pdf_page.c xps/muxps.h xps/xps_doc.c xps/xps_xml.c
2011-10-04Move to exception handling rather than error passing throughout.Robin Watts
This frees us from passing errors back everywhere, and hence enables us to pass results back as return values. Rather than having to explicitly check for errors everywhere and bubble them, we now allow exception handling to do the work for us; the downside to this is that we no longer emit as much debugging information as we did before (though this could be put back in). For now, the debugging information we have lost has been retained in comments with 'RJW:' at the start. This code needs fuller testing, but is being committed as a work in progress.
2011-09-21Add warning context.Tor Andersson
2011-09-21Rename malloc functions for arrays (fz_calloc and fz_realloc).Tor Andersson
2011-09-21Don't thread ctx through safe fz_obj functions.Tor Andersson
2011-09-20Keep dicts that have more than 100 entries sorted.Sebastian Rasmussen
2011-09-20Return expected location when finding keys in dicts.Sebastian Rasmussen
2011-09-20Move array/dict growing into separate functions.Sebastian Rasmussen
2011-09-15Add context to mupdf.Robin Watts
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.
2011-09-14Initial import of exception handling codeRobin Watts
Import exception handling code from WSS, modified to fit into the fitz world. With this code we have 'real' fz_try/fz_catch/fz_rethrow functions, handling a fz_except type. We therefore rename the existing fz_throw/ fz_catch/fz_rethrow to be fz_error_make/fz_error_handle/fz_error_note. We don't actually use fz_try/fz_catch/fz_rethrow yet...
2011-04-10Make fz_obj struct opaque.Tor Andersson