From 99ba154018b7c4a2c47b4c7e721ffe6d9164f9f3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 20 Sep 2011 15:50:07 +0200 Subject: Reshuffle exception context code to fit Tor's aesthetic sense. --- apps/pdfclean.c | 6 ++---- apps/pdfdraw.c | 3 ++- apps/pdfextract.c | 6 ++---- apps/pdfinfo.c | 5 ++--- apps/pdfshow.c | 6 ++---- apps/x11_main.c | 4 ++-- apps/xpsdraw.c | 4 ++-- 7 files changed, 14 insertions(+), 20 deletions(-) (limited to 'apps') diff --git a/apps/pdfclean.c b/apps/pdfclean.c index 1767ebc5..2a8c54f2 100644 --- a/apps/pdfclean.c +++ b/apps/pdfclean.c @@ -720,7 +720,7 @@ int main(int argc, char **argv) if (argc - fz_optind > 0) subset = 1; - ctx = fz_context_init(&fz_alloc_default); + ctx = fz_new_context(&fz_alloc_default); if (ctx == NULL) die(fz_error_note(1, "failed to initialise context")); @@ -782,9 +782,7 @@ int main(int argc, char **argv) fz_free(xref->ctx, renumbermap); pdf_free_xref(xref); - fz_flush_warnings(); - fz_context_fin(ctx); - + fz_free_context(ctx); return 0; } diff --git a/apps/pdfdraw.c b/apps/pdfdraw.c index ddaf10c5..2c2e476b 100644 --- a/apps/pdfdraw.c +++ b/apps/pdfdraw.c @@ -343,7 +343,7 @@ int main(int argc, char **argv) if (accelerate) fz_accelerate(); - ctx = fz_context_init(&fz_alloc_default); + ctx = fz_new_context(&fz_alloc_default); if (ctx == NULL) { fprintf(stderr, "Failed to init context\n"); @@ -410,5 +410,6 @@ int main(int argc, char **argv) fz_flush_warnings(); + fz_free_context(ctx); return 0; } diff --git a/apps/pdfextract.c b/apps/pdfextract.c index 2f5baec5..96ea7e87 100644 --- a/apps/pdfextract.c +++ b/apps/pdfextract.c @@ -198,7 +198,7 @@ int main(int argc, char **argv) infile = argv[fz_optind++]; - ctx = fz_context_init(&fz_alloc_default); + ctx = fz_new_context(&fz_alloc_default); if (ctx == NULL) die(fz_error_note(1, "failed to initialise context")); @@ -221,9 +221,7 @@ int main(int argc, char **argv) } pdf_free_xref(xref); - fz_flush_warnings(); - fz_context_fin(ctx); - + fz_free_context(ctx); return 0; } diff --git a/apps/pdfinfo.c b/apps/pdfinfo.c index f7ee1800..2006b0be 100644 --- a/apps/pdfinfo.c +++ b/apps/pdfinfo.c @@ -981,7 +981,7 @@ int main(int argc, char **argv) if (fz_optind == argc) infousage(); - ctx = fz_context_init(&fz_alloc_default); + ctx = fz_new_context(&fz_alloc_default); if (ctx == NULL) die(fz_error_make("failed to initialise context")); @@ -1025,7 +1025,6 @@ int main(int argc, char **argv) showinfo(filename, show, "1-"); closexref(); - fz_context_fin(ctx); - + fz_free_context(ctx); return 0; } diff --git a/apps/pdfshow.c b/apps/pdfshow.c index bbb6747e..653ffff6 100644 --- a/apps/pdfshow.c +++ b/apps/pdfshow.c @@ -214,7 +214,7 @@ int main(int argc, char **argv) filename = argv[fz_optind++]; - ctx = fz_context_init(&fz_alloc_default); + ctx = fz_new_context(&fz_alloc_default); if (ctx == NULL) die(fz_error_note(1, "failed to initialise context")); @@ -239,9 +239,7 @@ int main(int argc, char **argv) } pdf_free_xref(xref); - fz_flush_warnings(); - fz_context_fin(ctx); - + fz_free_context(ctx); return 0; } diff --git a/apps/x11_main.c b/apps/x11_main.c index f0f4f66d..a8c92074 100644 --- a/apps/x11_main.c +++ b/apps/x11_main.c @@ -584,7 +584,7 @@ int main(int argc, char **argv) if (accelerate) fz_accelerate(); - ctx = fz_context_init(&fz_alloc_default); + ctx = fz_new_context(&fz_alloc_default); if (ctx == NULL) { fprintf(stderr, "failed to initialise context"); @@ -750,7 +750,7 @@ int main(int argc, char **argv) XCloseDisplay(xdpy); - fz_context_fin(ctx); + fz_free_context(ctx); return 0; } diff --git a/apps/xpsdraw.c b/apps/xpsdraw.c index 8283216a..719719ea 100644 --- a/apps/xpsdraw.c +++ b/apps/xpsdraw.c @@ -311,7 +311,7 @@ int main(int argc, char **argv) if (accelerate) fz_accelerate(); - fzctx = fz_context_init(&fz_alloc_default); + fzctx = fz_new_context(&fz_alloc_default); if (fzctx == NULL) { fprintf(stderr, "failed to initialise context"); @@ -369,7 +369,7 @@ int main(int argc, char **argv) } fz_free_glyph_cache(fzctx, glyphcache); - fz_context_fin(fzctx); + fz_free_context(fzctx); return 0; } -- cgit v1.2.3