PDF shim: fz_var for locals set inside fz_try (gcc -Wclobbered on Linux)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
76b78782d5
commit
3b23a92b3c
10 files changed
+20
No files matched your search
@@ -41,6 +41,7 @@ static int quiet_elem(fz_context *ctx, pdf_obj *elem, int page, int inherited)
|
||||
int pg, i, on = 0;
|
||||
if (!pdf_is_dict(ctx, elem) || pdf_mark_obj(ctx, elem))
|
||||
return 0;
|
||||
fz_var(on);
|
||||
fz_try(ctx)
|
||||
{
|
||||
pg = pdf_dict_gets(ctx, elem, "Pg") ? pdf_to_num(ctx, pdf_dict_gets(ctx, elem, "Pg")) : inherited;
|
||||
|
||||
@@ -86,6 +86,7 @@ static pdf_obj *spliced(fz_context *ctx, pdf_document *pdf, pdf_obj *action, int
|
||||
if (pdf_mark_obj(ctx, action))
|
||||
return NULL;
|
||||
(*n)++;
|
||||
fz_var(out);
|
||||
fz_try(ctx)
|
||||
out = spliced(ctx, pdf, pdf_dict_get(ctx, action, PDF_NAME(Next)), n);
|
||||
fz_always(ctx)
|
||||
@@ -212,6 +213,8 @@ restart:
|
||||
if (unseen(ctx, pdf_annot_obj(ctx, widget)))
|
||||
{
|
||||
pdf_obj *field = pdf_keep_obj(ctx, pdf_annot_obj(ctx, widget));
|
||||
fz_var(widget);
|
||||
fz_var(n);
|
||||
fz_try(ctx)
|
||||
{
|
||||
pdf_delete_annot(ctx, page, widget);
|
||||
|
||||
@@ -189,6 +189,7 @@ static pdf_obj *check_name(fz_context *ctx, pdf_obj *fields, const char *prefix,
|
||||
if (!name[0] || strchr(name, '.'))
|
||||
fz_throw(ctx, FZ_ERROR_ARGUMENT, "a bad field name");
|
||||
fz_var(full);
|
||||
fz_var(found);
|
||||
fz_try(ctx)
|
||||
{
|
||||
full = fz_asprintf(ctx, "%s%s", prefix, name);
|
||||
|
||||
@@ -327,6 +327,7 @@ int ely_insert_file(fz_context *ctx, fz_document *doc, int at, const char *path,
|
||||
fz_var(links);
|
||||
fz_var(n);
|
||||
fz_var(begun);
|
||||
fz_var(room);
|
||||
fz_try(ctx)
|
||||
{
|
||||
pdf = ely_pdf_of(ctx, doc);
|
||||
|
||||
@@ -155,6 +155,7 @@ void ely_close(fz_context *ctx, fz_document *doc)
|
||||
int ely_needs_password(fz_context *ctx, fz_document *doc)
|
||||
{
|
||||
int locked = 0;
|
||||
fz_var(locked);
|
||||
fz_try(ctx)
|
||||
locked = fz_needs_password(ctx, doc);
|
||||
fz_catch(ctx)
|
||||
@@ -166,6 +167,7 @@ int ely_needs_password(fz_context *ctx, fz_document *doc)
|
||||
int ely_authenticate(fz_context *ctx, fz_document *doc, const char *password)
|
||||
{
|
||||
int access = 0;
|
||||
fz_var(access);
|
||||
fz_try(ctx)
|
||||
access = fz_authenticate_password(ctx, doc, password);
|
||||
fz_catch(ctx)
|
||||
|
||||
@@ -121,6 +121,7 @@ int ely_optimize(fz_context *ctx, fz_document *doc, const char *raw, const char
|
||||
int ely_repaired(fz_context *ctx, fz_document *doc)
|
||||
{
|
||||
int repaired = 0;
|
||||
fz_var(repaired);
|
||||
fz_try(ctx)
|
||||
repaired = pdf_was_repaired(ctx, ely_pdf_of(ctx, doc));
|
||||
fz_catch(ctx)
|
||||
|
||||
@@ -59,6 +59,8 @@ restart:
|
||||
if (touches(pdf_bound_annot(ctx, annot), area))
|
||||
{
|
||||
pdf_obj *field = pdf_keep_obj(ctx, pdf_annot_obj(ctx, annot));
|
||||
fz_var(annot);
|
||||
fz_var(widgets);
|
||||
fz_try(ctx)
|
||||
{
|
||||
pdf_delete_annot(ctx, page, annot);
|
||||
@@ -129,6 +131,7 @@ static int chars_in(fz_context *ctx, fz_document *doc, int number, fz_rect area)
|
||||
fz_stext_page *text = NULL;
|
||||
int n = 0;
|
||||
fz_var(text);
|
||||
fz_var(n);
|
||||
fz_try(ctx)
|
||||
{
|
||||
fz_stext_block *block;
|
||||
@@ -154,6 +157,7 @@ static int light_in(fz_context *ctx, fz_document *doc, int number, fz_rect area)
|
||||
fz_pixmap *pix = NULL;
|
||||
int n = 0;
|
||||
fz_var(pix);
|
||||
fz_var(n);
|
||||
fz_try(ctx)
|
||||
{
|
||||
fz_page *page = fz_load_page(ctx, doc, number);
|
||||
@@ -283,6 +287,7 @@ static int image_light(fz_context *ctx, fz_image *image, fz_matrix ctm, fz_rect
|
||||
return 0;
|
||||
fz_var(pix);
|
||||
fz_var(draw);
|
||||
fz_var(box);
|
||||
fz_try(ctx)
|
||||
{
|
||||
unsigned char *s;
|
||||
|
||||
@@ -10,6 +10,7 @@ enum { MAY_PRINT = 1, MAY_COPY = 2, MAY_EDIT = 4, MAY_ANNOTATE = 8, MAY_FILL = 1
|
||||
int ely_permissions(fz_context *ctx, fz_document *doc)
|
||||
{
|
||||
int may = 0;
|
||||
fz_var(may);
|
||||
fz_try(ctx)
|
||||
{
|
||||
pdf_document *pdf = ely_pdf_of(ctx, doc);
|
||||
|
||||
@@ -189,6 +189,8 @@ static void put_field(fz_context *ctx, fz_output *out, pdf_document *pdf, pdf_ob
|
||||
fz_rect r;
|
||||
int number = placed(ctx, pdf, field, &r), signd = pdf_signature_is_signed(ctx, pdf, field);
|
||||
char *name = pdf_load_field_name(ctx, field);
|
||||
fz_var(number);
|
||||
fz_var(r);
|
||||
fz_try(ctx)
|
||||
{
|
||||
fz_write_printf(ctx, out, "%s{\"page\":%d,\"object\":%d,\"rect\":[%g,%g,%g,%g],\"signed\":%s,\"name\":",
|
||||
@@ -401,6 +403,7 @@ void ely_unsign(fz_context *ctx, pdf_document *pdf)
|
||||
int ely_signed(fz_context *ctx, fz_document *doc)
|
||||
{
|
||||
int n = 0;
|
||||
fz_var(n);
|
||||
fz_try(ctx)
|
||||
n = signed_fields(ctx, ely_pdf_of(ctx, doc), 0);
|
||||
fz_catch(ctx)
|
||||
|
||||
@@ -169,6 +169,7 @@ static int reachable(fz_context *ctx, pdf_document *pdf, pdf_page *page, fz_stex
|
||||
fz_var(t.at);
|
||||
fz_var(t.c);
|
||||
pdf_begin_operation(ctx, pdf, "Look at text");
|
||||
fz_var(ok);
|
||||
fz_try(ctx)
|
||||
{
|
||||
block_targets(ctx, block, ely_to_user(ctx, page), &t);
|
||||
@@ -203,6 +204,7 @@ static void reachable_all(fz_context *ctx, pdf_document *pdf, pdf_page *page, fz
|
||||
fz_var(t.seen);
|
||||
fz_var(count);
|
||||
pdf_begin_operation(ctx, pdf, "Look at text");
|
||||
fz_var(all);
|
||||
fz_try(ctx)
|
||||
{
|
||||
for (block = text->first_block; block; block = block->next)
|
||||
|
||||
Reference in new issue
Block a user