summaryrefslogtreecommitdiff
path: root/fitz/res_halftone.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2011-08-06 02:34:39 +0200
committerTor Andersson <tor.andersson@artifex.com>2011-08-06 02:34:39 +0200
commit70d7705aaa7a31436b50976482825e9f8c1f6c4e (patch)
treee8b641b46b3c79468809d4d2316562db84adf825 /fitz/res_halftone.c
parent7926d3cbd583e45e59532fa473713e7d54424811 (diff)
downloadmupdf-70d7705aaa7a31436b50976482825e9f8c1f6c4e.tar.xz
Cosmetic style fixes.
Diffstat (limited to 'fitz/res_halftone.c')
-rw-r--r--fitz/res_halftone.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/fitz/res_halftone.c b/fitz/res_halftone.c
index 6a7a8f42..e45454ea 100644
--- a/fitz/res_halftone.c
+++ b/fitz/res_halftone.c
@@ -9,7 +9,7 @@ fz_new_halftone(int comps)
ht = fz_malloc(sizeof(fz_halftone) + (comps-1)*sizeof(fz_pixmap *));
ht->refs = 1;
ht->n = comps;
- for (i=0; i < comps; i++)
+ for (i = 0; i < comps; i++)
ht->comp[i] = NULL;
return ht;
@@ -29,10 +29,8 @@ fz_drop_halftone(fz_halftone *ht)
if (!ht || --ht->refs != 0)
return;
- for (i=0; i < ht->n; i++)
- {
+ for (i = 0; i < ht->n; i++)
fz_drop_pixmap(ht->comp[i]);
- }
fz_free(ht);
}
@@ -60,19 +58,8 @@ static unsigned char mono_ht[] =
fz_halftone *fz_get_default_halftone(int num_comps)
{
fz_halftone *ht = fz_new_halftone(num_comps);
-
- if (ht == NULL)
- return NULL;
-
- /* Only support 1 component for now */
- assert(num_comps == 1);
-
+ assert(num_comps == 1); /* Only support 1 component for now */
ht->comp[0] = fz_new_pixmap_with_data(NULL, 16, 16, mono_ht);
- if (ht->comp[0] == NULL)
- {
- fz_drop_halftone(ht);
- return NULL;
- }
return ht;
}
@@ -85,7 +72,7 @@ static void make_ht_line(unsigned char *buf, fz_halftone *ht, int x, int y, int
*/
int k, n;
n = ht->n;
- for (k=0; k < n; k++)
+ for (k = 0; k < n; k++)
{
fz_pixmap *tile = ht->comp[k];
unsigned char *b = buf++;