summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2013-03-21 22:03:12 +0000
committerRobin Watts <robin.watts@artifex.com>2013-03-22 01:06:10 +0000
commit7b334e226f7ac03352461935e7193d4c9a27ddca (patch)
treed4d768c49164a9c885c9f5d784c6a88cc99ae80b /pdf
parentbf08301ded2f44e33bebf5572587a9c7102dcc98 (diff)
downloadmupdf-7b334e226f7ac03352461935e7193d4c9a27ddca.tar.xz
Squash some warnings.
Some -Wshadow ones, plus some 'set but not used' ones.
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdf_font.c2
-rw-r--r--pdf/pdf_form.c7
-rw-r--r--pdf/pdf_function.c2
-rw-r--r--pdf/pdf_lex.c6
-rw-r--r--pdf/pdf_stream.c8
-rw-r--r--pdf/pdf_write.c1
6 files changed, 12 insertions, 14 deletions
diff --git a/pdf/pdf_font.c b/pdf/pdf_font.c
index d3f25304..50b41702 100644
--- a/pdf/pdf_font.c
+++ b/pdf/pdf_font.c
@@ -1218,7 +1218,6 @@ fz_rect *pdf_measure_text(fz_context *ctx, pdf_font_desc *fontdesc, unsigned cha
float pdf_text_stride(fz_context *ctx, pdf_font_desc *fontdesc, float fontsize, unsigned char *buf, int len, float room, int *count)
{
pdf_hmtx h;
- int gid;
int i = 0;
float x = 0.0;
@@ -1226,7 +1225,6 @@ float pdf_text_stride(fz_context *ctx, pdf_font_desc *fontdesc, float fontsize,
{
float span;
- gid = pdf_font_cid_to_gid(ctx, fontdesc, buf[i]);
h = pdf_lookup_hmtx(ctx, fontdesc, buf[i]);
span = h.w * fontsize / 1000.0;
diff --git a/pdf/pdf_form.c b/pdf/pdf_form.c
index 168e56aa..01f82d74 100644
--- a/pdf/pdf_form.c
+++ b/pdf/pdf_form.c
@@ -1720,7 +1720,6 @@ static void execute_action(pdf_document *doc, pdf_obj *obj, pdf_obj *a)
static void update_text_markup_appearance(pdf_document *doc, pdf_obj *annot, fz_annot_type type)
{
- fz_context *ctx = doc->ctx;
float color[3];
float alpha;
float line_height;
@@ -1807,6 +1806,8 @@ void pdf_update_appearance(pdf_document *doc, pdf_obj *obj)
case FZ_ANNOT_HIGHLIGHT:
update_text_markup_appearance(doc, obj, type);
break;
+ default:
+ break;
}
pdf_dict_dels(obj, "Dirty");
@@ -2005,9 +2006,9 @@ static void toggle_check_box(pdf_document *doc, pdf_obj *obj)
/* For radio buttons, first turn off all buttons in the group and
* then set the one that was clicked */
pdf_obj *kids = pdf_dict_gets(grp, "Kids");
- int i, n = pdf_array_len(kids);
- for (i = 0; i < n; i++)
+ len = pdf_array_len(kids);
+ for (i = 0; i < len; i++)
check_off(ctx, pdf_array_get(kids, i));
pdf_dict_puts(obj, "AS", key);
diff --git a/pdf/pdf_function.c b/pdf/pdf_function.c
index c6511372..b6b46358 100644
--- a/pdf/pdf_function.c
+++ b/pdf/pdf_function.c
@@ -1120,7 +1120,7 @@ eval_sample_func(fz_context *ctx, pdf_function *func, float *in, float *out)
else
{
- float x = interpolate_sample(func, scale, e0, e1, efrac, func->m - 1, i);
+ x = interpolate_sample(func, scale, e0, e1, efrac, func->m - 1, i);
out[i] = lerp(x, 0, 1, func->u.sa.decode[i][0], func->u.sa.decode[i][1]);
out[i] = fz_clamp(out[i], func->range[i][0], func->range[i][1]);
}
diff --git a/pdf/pdf_lex.c b/pdf/pdf_lex.c
index c0d72da9..233ffb6d 100644
--- a/pdf/pdf_lex.c
+++ b/pdf/pdf_lex.c
@@ -88,7 +88,7 @@ lex_number(fz_stream *f, pdf_lexbuf *buf, int c)
while (1)
{
- int c = fz_read_byte(f);
+ c = fz_read_byte(f);
switch (c)
{
case '.':
@@ -114,7 +114,7 @@ loop_after_dot:
d = 1;
while (1)
{
- int c = fz_read_byte(f);
+ c = fz_read_byte(f);
switch (c)
{
case RANGE_0_9:
@@ -139,7 +139,7 @@ underflow:
/* Ignore any digits after here, because they are too small */
while (1)
{
- int c = fz_read_byte(f);
+ c = fz_read_byte(f);
switch (c)
{
case RANGE_0_9:
diff --git a/pdf/pdf_stream.c b/pdf/pdf_stream.c
index 2639c9e1..0af1ddcf 100644
--- a/pdf/pdf_stream.c
+++ b/pdf/pdf_stream.c
@@ -54,7 +54,8 @@ build_filter(fz_stream *chain, pdf_document * xref, pdf_obj * f, pdf_obj * p, in
char *s = pdf_to_name(f);
int predictor = pdf_to_int(pdf_dict_gets(p, "Predictor"));
- int columns = pdf_to_int(pdf_dict_gets(p, "Columns"));
+ pdf_obj *columns_obj = pdf_dict_gets(p, "Columns");
+ int columns = pdf_to_int(columns_obj);
int colors = pdf_to_int(pdf_dict_gets(p, "Colors"));
int bpc = pdf_to_int(pdf_dict_gets(p, "BitsPerComponent"));
@@ -69,7 +70,6 @@ build_filter(fz_stream *chain, pdf_document * xref, pdf_obj * f, pdf_obj * p, in
pdf_obj *k = pdf_dict_gets(p, "K");
pdf_obj *eol = pdf_dict_gets(p, "EndOfLine");
pdf_obj *eba = pdf_dict_gets(p, "EncodedByteAlign");
- pdf_obj *columns = pdf_dict_gets(p, "Columns");
pdf_obj *rows = pdf_dict_gets(p, "Rows");
pdf_obj *eob = pdf_dict_gets(p, "EndOfBlock");
pdf_obj *bi1 = pdf_dict_gets(p, "BlackIs1");
@@ -80,7 +80,7 @@ build_filter(fz_stream *chain, pdf_document * xref, pdf_obj * f, pdf_obj * p, in
params->u.fax.k = (k ? pdf_to_int(k) : 0);
params->u.fax.end_of_line = (eol ? pdf_to_bool(eol) : 0);
params->u.fax.encoded_byte_align = (eba ? pdf_to_bool(eba) : 0);
- params->u.fax.columns = (columns ? pdf_to_int(columns) : 1728);
+ params->u.fax.columns = (columns_obj ? columns : 1728);
params->u.fax.rows = (rows ? pdf_to_int(rows) : 0);
params->u.fax.end_of_block = (eob ? pdf_to_bool(eob) : 1);
params->u.fax.black_is_1 = (bi1 ? pdf_to_bool(bi1) : 0);
@@ -90,7 +90,7 @@ build_filter(fz_stream *chain, pdf_document * xref, pdf_obj * f, pdf_obj * p, in
k ? pdf_to_int(k) : 0,
eol ? pdf_to_bool(eol) : 0,
eba ? pdf_to_bool(eba) : 0,
- columns ? pdf_to_int(columns) : 1728,
+ columns_obj ? columns : 1728,
rows ? pdf_to_int(rows) : 0,
eob ? pdf_to_bool(eob) : 1,
bi1 ? pdf_to_bool(bi1) : 0);
diff --git a/pdf/pdf_write.c b/pdf/pdf_write.c
index fa397b2c..b7f2bdef 100644
--- a/pdf/pdf_write.c
+++ b/pdf/pdf_write.c
@@ -1993,7 +1993,6 @@ make_page_offset_hints(pdf_document *xref, pdf_write_options *opts, fz_buffer *b
for (i=0; i < opts->page_count; i++)
{
int count = 0;
- int j;
page_objects *po = opts->page_object_lists->page[i];
for (j = 0; j < po->len; j++)
{