summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-09-13 15:47:58 +0100
committerRobin Watts <robin.watts@artifex.com>2013-09-13 16:02:32 +0100
commitaefe6a511b3cb901034e5995fd882e334e40f2bb (patch)
tree74005b19d77e704480b2c7c43c3ed51c15b17dcf /source/fitz
parenta0a92b5cf0fa076c923e7a5aa911dfff28aea351 (diff)
downloadmupdf-aefe6a511b3cb901034e5995fd882e334e40f2bb.tar.xz
Fix various compile warnings spotted by the cluster.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/buffer.c2
-rw-r--r--source/fitz/crypt-aes.c6
-rw-r--r--source/fitz/draw-device.c8
-rw-r--r--source/fitz/draw-edge.c1
-rw-r--r--source/fitz/draw-glyph.c9
-rw-r--r--source/fitz/draw-path.c6
-rw-r--r--source/fitz/draw-scale-simple.c2
-rw-r--r--source/fitz/font.c1
-rw-r--r--source/fitz/halftone.c2
-rw-r--r--source/fitz/load-tiff.c4
-rw-r--r--source/fitz/pixmap.c9
-rw-r--r--source/fitz/stext-device.c3
-rw-r--r--source/fitz/xml.c8
13 files changed, 32 insertions, 29 deletions
diff --git a/source/fitz/buffer.c b/source/fitz/buffer.c
index 3d80fbbd..07ce9361 100644
--- a/source/fitz/buffer.c
+++ b/source/fitz/buffer.c
@@ -341,7 +341,7 @@ fz_buffer_cat_pdf_string(fz_context *ctx, fz_buffer *buffer, const char *text)
*d++ = c;
}
}
- *d++ = ')';
+ *d = ')';
buffer->len += len;
}
diff --git a/source/fitz/crypt-aes.c b/source/fitz/crypt-aes.c
index 6ce14903..f98fb8fd 100644
--- a/source/fitz/crypt-aes.c
+++ b/source/fitz/crypt-aes.c
@@ -325,7 +325,7 @@ int aes_setkey_dec(aes_context *ctx, const unsigned char *key, int keysize)
*RK++ = *SK++;
*RK++ = *SK++;
*RK++ = *SK++;
- *RK++ = *SK++;
+ *RK = *SK;
memset( &cty, 0, sizeof( aes_context ) );
return 0;
@@ -428,7 +428,7 @@ void aes_crypt_ecb( aes_context *ctx,
( RSb[ ( Y0 >> 16 ) & 0xFF ] << 16 ) ^
( RSb[ ( Y3 >> 24 ) & 0xFF ] << 24 );
- X3 = *RK++ ^ ( RSb[ ( Y3 ) & 0xFF ] ) ^
+ X3 = *RK ^ ( RSb[ ( Y3 ) & 0xFF ] ) ^
( RSb[ ( Y2 >> 8 ) & 0xFF ] << 8 ) ^
( RSb[ ( Y1 >> 16 ) & 0xFF ] << 16 ) ^
( RSb[ ( Y0 >> 24 ) & 0xFF ] << 24 );
@@ -458,7 +458,7 @@ void aes_crypt_ecb( aes_context *ctx,
( FSb[ ( Y0 >> 16 ) & 0xFF ] << 16 ) ^
( FSb[ ( Y1 >> 24 ) & 0xFF ] << 24 );
- X3 = *RK++ ^ ( FSb[ ( Y3 ) & 0xFF ] ) ^
+ X3 = *RK ^ ( FSb[ ( Y3 ) & 0xFF ] ) ^
( FSb[ ( Y0 >> 8 ) & 0xFF ] << 8 ) ^
( FSb[ ( Y1 >> 16 ) & 0xFF ] << 16 ) ^
( FSb[ ( Y2 >> 24 ) & 0xFF ] << 24 );
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c
index 79886405..bcd93edb 100644
--- a/source/fitz/draw-device.c
+++ b/source/fitz/draw-device.c
@@ -1482,7 +1482,7 @@ fz_draw_begin_group(fz_device *devp, const fz_rect *rect, int isolated, int knoc
{
fz_draw_device *dev = devp->user;
fz_irect bbox;
- fz_pixmap *dest, *shape;
+ fz_pixmap *dest;
fz_context *ctx = dev->ctx;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model = state->dest->colorspace;
@@ -1515,12 +1515,12 @@ fz_draw_begin_group(fz_device *devp, const fz_rect *rect, int isolated, int knoc
{
/* We can render direct to any existing shape plane.
* If there isn't one, we don't need to make one. */
- state[1].shape =shape = state[0].shape;
+ state[1].shape = state[0].shape;
}
else
{
- state[1].shape = shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox);
- fz_clear_pixmap(dev->ctx, shape);
+ state[1].shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox);
+ fz_clear_pixmap(dev->ctx, state[1].shape);
}
state[1].alpha = alpha;
diff --git a/source/fitz/draw-edge.c b/source/fitz/draw-edge.c
index fcce6f5c..59d92967 100644
--- a/source/fitz/draw-edge.c
+++ b/source/fitz/draw-edge.c
@@ -922,7 +922,6 @@ fz_scan_convert_sharp(fz_gel *gel, int eofill, const fz_irect *clip,
y += height;
if (y >= clip->y0)
{
- height -= y - clip->y0;
y = clip->y0;
break;
}
diff --git a/source/fitz/draw-glyph.c b/source/fitz/draw-glyph.c
index 223e48d6..73f2eb71 100644
--- a/source/fitz/draw-glyph.c
+++ b/source/fitz/draw-glyph.c
@@ -254,6 +254,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo
fz_var(locked);
fz_var(caching);
+ fz_var(val);
memset(&key, 0, sizeof key);
size = fz_subpixel_adjust(ctm, &subpix_ctm, &key.e, &key.f);
@@ -296,6 +297,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo
locked = 1;
caching = 0;
+ val = NULL;
fz_try(ctx)
{
@@ -323,7 +325,6 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo
else
{
fz_warn(ctx, "assert: uninitialized font structure");
- val = NULL;
}
if (val && do_cache)
{
@@ -344,8 +345,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo
fz_drop_glyph(ctx, val);
move_to_front(cache, entry);
val = fz_keep_glyph(ctx, entry->val);
- fz_unlock(ctx, FZ_LOCK_GLYPHCACHE);
- return val;
+ goto unlock_and_return_val;
}
entry = entry->bucket_next;
}
@@ -380,6 +380,9 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo
}
}
+unlock_and_return_val:
+ {
+ }
}
fz_always(ctx)
{
diff --git a/source/fitz/draw-path.c b/source/fitz/draw-path.c
index 1d2d7500..03b83f78 100644
--- a/source/fitz/draw-path.c
+++ b/source/fitz/draw-path.c
@@ -55,7 +55,7 @@ bezier(fz_gel *gel, const fz_matrix *ctm, float flatness,
yabcd = yabc + ybcd;
xab *= 0.5f; yab *= 0.5f;
- xbc *= 0.5f; ybc *= 0.5f;
+ /* xbc *= 0.5f; ybc *= 0.5f; */
xcd *= 0.5f; ycd *= 0.5f;
xabc *= 0.25f; yabc *= 0.25f;
@@ -529,7 +529,7 @@ fz_stroke_bezier(struct sctx *s,
yabcd = yabc + ybcd;
xab *= 0.5f; yab *= 0.5f;
- xbc *= 0.5f; ybc *= 0.5f;
+ /* xbc *= 0.5f; ybc *= 0.5f; */
xcd *= 0.5f; ycd *= 0.5f;
xabc *= 0.25f; yabc *= 0.25f;
@@ -734,7 +734,7 @@ fz_dash_bezier(struct sctx *s,
yabcd = yabc + ybcd;
xab *= 0.5f; yab *= 0.5f;
- xbc *= 0.5f; ybc *= 0.5f;
+ /* xbc *= 0.5f; ybc *= 0.5f; */
xcd *= 0.5f; ycd *= 0.5f;
xabc *= 0.25f; yabc *= 0.25f;
diff --git a/source/fitz/draw-scale-simple.c b/source/fitz/draw-scale-simple.c
index 08dedf0b..1ec6ffd8 100644
--- a/source/fitz/draw-scale-simple.c
+++ b/source/fitz/draw-scale-simple.c
@@ -1469,7 +1469,7 @@ fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float
*/
int row_index = contrib_rows->index[row];
int row_min = contrib_rows->index[row_index++];
- int row_len = contrib_rows->index[row_index++];
+ int row_len = contrib_rows->index[row_index];
while (max_row < row_min+row_len)
{
/* Scale another row */
diff --git a/source/fitz/font.c b/source/fitz/font.c
index 165b6880..334f076a 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -906,6 +906,7 @@ fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *tr
FT_Outline_Translate(&face->glyph->outline, -strength * 32, -strength * 32);
}
+ cc.path = NULL;
fz_try(ctx)
{
cc.ctx = ctx;
diff --git a/source/fitz/halftone.c b/source/fitz/halftone.c
index 15aebead..26dbc941 100644
--- a/source/fitz/halftone.c
+++ b/source/fitz/halftone.c
@@ -158,7 +158,7 @@ static void do_threshold_1(unsigned char *ht_line, unsigned char *pixmap, unsign
}
while (--w);
if (bit != 0x80)
- *out++ = h;
+ *out = h;
}
fz_bitmap *fz_halftone_pixmap(fz_context *ctx, fz_pixmap *pix, fz_halftone *ht)
diff --git a/source/fitz/load-tiff.c b/source/fitz/load-tiff.c
index fbe84740..f473802b 100644
--- a/source/fitz/load-tiff.c
+++ b/source/fitz/load-tiff.c
@@ -781,7 +781,7 @@ fz_pixmap *
fz_load_tiff(fz_context *ctx, unsigned char *buf, int len)
{
fz_pixmap *image;
- struct tiff tiff;
+ struct tiff tiff = { 0 };
fz_try(ctx)
{
@@ -842,7 +842,7 @@ fz_load_tiff(fz_context *ctx, unsigned char *buf, int len)
void
fz_load_tiff_info(fz_context *ctx, unsigned char *buf, int len, int *wp, int *hp, int *xresp, int *yresp, fz_colorspace **cspacep)
{
- struct tiff tiff;
+ struct tiff tiff = { 0 };
fz_try(ctx)
{
diff --git a/source/fitz/pixmap.c b/source/fitz/pixmap.c
index 2cc6a98c..8b3ac6a6 100644
--- a/source/fitz/pixmap.c
+++ b/source/fitz/pixmap.c
@@ -648,7 +648,6 @@ fz_output_png_header(fz_output *out, int w, int h, int n, int savealpha)
unsigned char head[13];
fz_context *ctx;
int color;
- int sn, dn;
fz_png_output_context *poc;
if (!out)
@@ -661,12 +660,10 @@ fz_output_png_header(fz_output *out, int w, int h, int n, int savealpha)
poc = fz_malloc_struct(ctx, fz_png_output_context);
- sn = n;
- dn = n;
- if (!savealpha && dn > 1)
- dn--;
+ if (!savealpha && n > 1)
+ n--;
- switch (dn)
+ switch (n)
{
default:
case 1: color = 0; break;
diff --git a/source/fitz/stext-device.c b/source/fitz/stext-device.c
index 89cf8566..20e5e525 100644
--- a/source/fitz/stext-device.c
+++ b/source/fitz/stext-device.c
@@ -56,6 +56,7 @@ fz_text_char_bbox(fz_rect *bbox, fz_text_span *span, int i)
if (!span || i >= span->len)
{
*bbox = fz_empty_rect;
+ return bbox;
}
ch = &span->text[i];
if (i == span->len-1)
@@ -622,7 +623,9 @@ fz_add_text_char_imp(fz_context *ctx, fz_text_device *dev, fz_text_style *style,
else
{
can_append = 0;
+#ifdef DEBUG_SPANS
spacing = 0;
+#endif
}
}
diff --git a/source/fitz/xml.c b/source/fitz/xml.c
index 8c97562c..958eb51c 100644
--- a/source/fitz/xml.c
+++ b/source/fitz/xml.c
@@ -144,7 +144,7 @@ static int xml_parse_entity(int *c, char *a)
*c = '"';
return 6;
}
- *c = *a++;
+ *c = *a;
return 1;
}
@@ -290,7 +290,7 @@ parse_comment:
if (*p == '[') goto parse_cdata;
if (*p++ != '-') return "syntax error in comment (<! not followed by --)";
if (*p++ != '-') return "syntax error in comment (<!- not followed by -)";
- mark = p;
+ /* mark = p; */
while (*p) {
if (p[0] == '-' && p[1] == '-' && p[2] == '>') {
p += 3;
@@ -304,7 +304,7 @@ parse_cdata:
if (p[1] != 'C' || p[2] != 'D' || p[3] != 'A' || p[4] != 'T' || p[5] != 'A' || p[6] != '[')
return "syntax error in CDATA section";
p += 7;
- mark = p;
+ /* mark = p; */
while (*p) {
if (p[0] == ']' && p[1] == ']' && p[2] == '>') {
p += 3;
@@ -326,7 +326,7 @@ parse_processing_instruction:
parse_closing_element:
while (iswhite(*p)) ++p;
- mark = p;
+ /* mark = p; */
while (isname(*p)) ++p;
while (iswhite(*p)) ++p;
if (*p != '>')