summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-09-14 15:03:05 +0100
committerRobin Watts <robin.watts@artifex.com>2016-09-14 16:24:54 +0100
commit6273edc2e7179a4bd1a542de69871084e1f18daa (patch)
tree67a85b6760a68df2bff404107fc260dfefeb6b32 /source/pdf
parentd79f72365de5b27b31953f614eb35f8a18b91247 (diff)
downloadmupdf-6273edc2e7179a4bd1a542de69871084e1f18daa.tar.xz
Add scripts to remove/replace 'static' from functions.
Getting a backtrace out with missing functions makes the backtrace much less useful. Some backtrace routines (such as that used by Memento on Android) are incapable of resolving static functions. We therefore provide 2 scripts (scripts/destatic.sh and scripts/restatic.sh) that respectively remove and replace the 'static' from function definitions. The scripts do not affect "static inline" or "static const" definitions, and they are are restricted to working in the source directory (excluding source/tools), thirdparty/mujs and the platform/{java,android} directories. The transformed source should NOT be checked in. To avoid problems with clashing symbols, some functions are renamed or tweaked slightly in this patch.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-form.c6
-rw-r--r--source/pdf/pdf-js.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/source/pdf/pdf-form.c b/source/pdf/pdf-form.c
index 65090a74..395703a9 100644
--- a/source/pdf/pdf-form.c
+++ b/source/pdf/pdf-form.c
@@ -125,7 +125,7 @@ pdf_obj *pdf_lookup_field(fz_context *ctx, pdf_obj *form, char *name)
return dict;
}
-static void reset_field(fz_context *ctx, pdf_document *doc, pdf_obj *field)
+static void reset_form_field(fz_context *ctx, pdf_document *doc, pdf_obj *field)
{
/* Set V to DV wherever DV is present, and delete V where DV is not.
* FIXME: we assume for now that V has not been set unequal
@@ -192,7 +192,7 @@ void pdf_field_reset(fz_context *ctx, pdf_document *doc, pdf_obj *field)
{
pdf_obj *kids = pdf_dict_get(ctx, field, PDF_NAME_Kids);
- reset_field(ctx, doc, field);
+ reset_form_field(ctx, doc, field);
if (kids)
{
@@ -317,7 +317,7 @@ static void reset_form(fz_context *ctx, pdf_document *doc, pdf_obj *fields, int
int i, n = pdf_array_len(ctx, sfields);
for (i = 0; i < n; i++)
- reset_field(ctx, doc, pdf_array_get(ctx, sfields, i));
+ reset_form_field(ctx, doc, pdf_array_get(ctx, sfields, i));
}
fz_always(ctx)
{
diff --git a/source/pdf/pdf-js.c b/source/pdf/pdf-js.c
index 065a11dd..c3e148fe 100644
--- a/source/pdf/pdf-js.c
+++ b/source/pdf/pdf-js.c
@@ -20,7 +20,7 @@ FZ_NORETURN static void rethrow(pdf_js *js)
}
/* Unpack argument object with named arguments into actual parameters. */
-static pdf_js *arguments(js_State *J, ...)
+static pdf_js *unpack_arguments(js_State *J, ...)
{
if (js_isobject(J, 1))
{
@@ -80,7 +80,7 @@ static char *pdf_from_utf8(fz_context *ctx, const char *utf8)
static void app_alert(js_State *J)
{
- pdf_js *js = arguments(J, "cMsg", "nIcon", "nType", "cTitle", 0);
+ pdf_js *js = unpack_arguments(J, "cMsg", "nIcon", "nType", "cTitle", 0);
pdf_alert_event event;
event.message = js_tostring(J, 1);
@@ -461,7 +461,7 @@ static void doc_print(js_State *J)
static void doc_mailDoc(js_State *J)
{
- pdf_js *js = arguments(J, "bUI", "cTo", "cCc", "cBcc", "cSubject", "cMessage", 0);
+ pdf_js *js = unpack_arguments(J, "bUI", "cTo", "cCc", "cBcc", "cSubject", "cMessage", 0);
pdf_mail_doc_event event;
event.ask_user = js_isdefined(J, 1) ? js_toboolean(J, 1) : 1;