diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2010-06-22 17:12:03 +0000 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2010-06-22 17:12:03 +0000 |
commit | 5ee07fbe62a2f9d9732e156f9a203d783e77f3ff (patch) | |
tree | dbbca38cfa72a5e0739136fffd08df3a36b6e258 | |
parent | c8c9cb68277193ede32a16cb3c47830101ec830b (diff) |
Whitespace and indentation fixes.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11419 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r-- | xps/xpscff.c | 2 | ||||
-rw-r--r-- | xps/xpsglyphs.c | 9 | ||||
-rw-r--r-- | xps/xpshdp.c | 2 | ||||
-rw-r--r-- | xps/xpsimage.c | 31 | ||||
-rw-r--r-- | xps/xpsjpeg.c | 15 | ||||
-rw-r--r-- | xps/xpspage.c | 4 | ||||
-rw-r--r-- | xps/xpspath.c | 7 | ||||
-rw-r--r-- | xps/xpstiff.c | 11 | ||||
-rw-r--r-- | xps/xpstile.c | 20 | ||||
-rw-r--r-- | xps/xpstop.c | 14 | ||||
-rw-r--r-- | xps/xpsttf.c | 13 |
11 files changed, 61 insertions, 67 deletions
diff --git a/xps/xpscff.c b/xps/xpscff.c index f18764c4f..f630612af 100644 --- a/xps/xpscff.c +++ b/xps/xpscff.c @@ -770,7 +770,7 @@ xps_post_callback_build_char(gs_show_enum *penum, gs_state *pgs, w2[0] = 0; w2[1] = 1; - pbbox = &pt1->FontBBox; + pbbox = &pt1->FontBBox; w2[2] = pbbox->p.x * 0.001; w2[3] = pbbox->p.y * 0.001; w2[4] = pbbox->q.x * 0.001; diff --git a/xps/xpsglyphs.c b/xps/xpsglyphs.c index 2076d9b2d..9ca65a9e6 100644 --- a/xps/xpsglyphs.c +++ b/xps/xpsglyphs.c @@ -11,7 +11,7 @@ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information. */ -/* XPS interpreter - */ +/* XPS interpreter - text drawing support */ #include "ghostxps.h" @@ -213,8 +213,8 @@ xps_flush_text_buffer(xps_context_t *ctx, xps_font_t *font, GlyphIndices = GlyphMapping ( ";" GlyphMapping ) GlyphMapping = ( [ClusterMapping] GlyphIndex ) [GlyphMetrics] ClusterMapping = "(" ClusterCodeUnitCount [":" ClusterGlyphCount] ")" - ClusterCodeUnitCount = * DIGIT - ClusterGlyphCount = * DIGIT + ClusterCodeUnitCount = * DIGIT + ClusterGlyphCount = * DIGIT GlyphIndex = * DIGIT GlyphMetrics = "," AdvanceWidth ["," uOffset ["," vOffset]] AdvanceWidth = ["+"] RealNum @@ -603,8 +603,7 @@ xps_parse_glyphs(xps_context_t *ctx, gs_setcharmatrix(ctx->pgs, &matrix); - gs_matrix_multiply(&matrix, &font->font->orig_FontMatrix, - &font->font->FontMatrix); + gs_matrix_multiply(&matrix, &font->font->orig_FontMatrix, &font->font->FontMatrix); code = xps_begin_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag); if (code) diff --git a/xps/xpshdp.c b/xps/xpshdp.c index 815380c9c..9cb0218d6 100644 --- a/xps/xpshdp.c +++ b/xps/xpshdp.c @@ -19,7 +19,7 @@ int xps_decode_hdphoto(gs_memory_t *mem, byte *buf, int len, xps_image_t *image, - unsigned char **profile, int *profile_size) + unsigned char **profile, int *profile_size) { *profile = NULL; return gs_throw(-1, "HD-Photo codec is not available"); diff --git a/xps/xpsimage.c b/xps/xpsimage.c index 8aabc25c4..78b7304d7 100644 --- a/xps/xpsimage.c +++ b/xps/xpsimage.c @@ -162,14 +162,14 @@ xps_decode_image(xps_context_t *ctx, char *profilename, int profile_comp, else if (memcmp(buf, "\211PNG\r\n\032\n", 8) == 0) { error = xps_decode_png(ctx->memory, buf, len, image, - &embedded_profile, &profile_size); + &embedded_profile, &profile_size); if (error) return gs_rethrow(error, "could not decode image"); } else if (memcmp(buf, "II", 2) == 0 && buf[2] == 0xBC) { error = xps_decode_hdphoto(ctx->memory, buf, len, image, - &embedded_profile, &profile_size); + &embedded_profile, &profile_size); if (error) return gs_rethrow(error, "could not decode image"); } @@ -192,7 +192,7 @@ xps_decode_image(xps_context_t *ctx, char *profilename, int profile_comp, { if (profile_comp == image->comps) { - /* Profile is OK for this image. Change color space type. */ + /* Profile is OK for this image. Change color space type. */ if (has_alpha) { image->colorspace = XPS_ICC_A; @@ -204,17 +204,17 @@ xps_decode_image(xps_context_t *ctx, char *profilename, int profile_comp, } } - /* See if we need to use the embedded profile. Only used if we - have one and a valid external profile was not specified */ + /* See if we need to use the embedded profile. + * Only used if we have one and a valid external profile was not specified */ image->embeddedprofile = false; - if (image->colorspace != XPS_ICC_A && image->colorspace != XPS_ICC && - embedded_profile != NULL) + if (image->colorspace != XPS_ICC_A && image->colorspace != XPS_ICC && embedded_profile != NULL) { - /* See if we can set up to use the embedded profile. Note - these profiles are NOT added to the xps color cache. - As such, they must be destroyed when the image brush ends. - Hence we need to make a note that we are using an embedded - profile. */ + /* See if we can set up to use the embedded profile. Note + these profiles are NOT added to the xps color cache. + As such, they must be destroyed when the image brush ends. + Hence we need to make a note that we are using an embedded + profile. + */ /* Create the profile */ iccprofile = gsicc_profile_new(NULL, ctx->memory, NULL, 0); @@ -231,14 +231,13 @@ xps_decode_image(xps_context_t *ctx, char *profilename, int profile_comp, if (iccprofile->profile_handle == NULL) { - /* Problem with profile. Just ignore it */ + /* Problem with profile. Just ignore it */ gsicc_profile_reference(iccprofile, -1); } else { /* Check the profile is OK for channel data count. - Need to be careful here since alpha is put into - comps */ + * Need to be careful here since alpha is put into comps */ if ((image->comps - has_alpha) == gsicc_getsrc_channel_count(iccprofile)) { /* Use the embedded profile */ @@ -255,7 +254,7 @@ xps_decode_image(xps_context_t *ctx, char *profilename, int profile_comp, } else { - /* Problem with profile. Just ignore it */ + /* Problem with profile. Just ignore it */ gsicc_profile_reference(iccprofile, -1); } diff --git a/xps/xpsjpeg.c b/xps/xpsjpeg.c index 8a59d1e2f..947754e01 100644 --- a/xps/xpsjpeg.c +++ b/xps/xpsjpeg.c @@ -30,7 +30,7 @@ xps_report_error(stream_state * st, const char *str) } int -xps_decode_jpeg(gs_memory_t *mem, byte *rbuf, int rlen, xps_image_t *image, +xps_decode_jpeg(gs_memory_t *mem, byte *rbuf, int rlen, xps_image_t *image, unsigned char **profile, int *profile_size) { jpeg_decompress_data jddp; @@ -68,8 +68,9 @@ xps_decode_jpeg(gs_memory_t *mem, byte *rbuf, int rlen, xps_image_t *image, wp.ptr = 0; wp.limit = 0; - /* Set up to save the ICC marker APP2. According to the spec - we should be getting APP1 APP2 and APP13. Library gets APP0 and APP14 */ + /* Set up to save the ICC marker APP2. + * According to the spec we should be getting APP1 APP2 and APP13. + * Library gets APP0 and APP14. */ jpeg_save_markers(&(jddp.dinfo), 0xe2, 0xFFFF); code = s_DCTD_template.process((stream_state*)&state, &rp, &wp, true); @@ -78,15 +79,15 @@ xps_decode_jpeg(gs_memory_t *mem, byte *rbuf, int rlen, xps_image_t *image, /* Check if we had an ICC profile */ curr_marker = jddp.dinfo.marker_list; - while (curr_marker != NULL) + while (curr_marker != NULL) { if (curr_marker->marker == 0xe2) { - /* Found ICC profile. Create a buffer and copy over now. Strip - JPEG APP2 14 byte header */ + /* Found ICC profile. Create a buffer and copy over now. + * Strip JPEG APP2 14 byte header */ *profile = (unsigned char*) gs_alloc_bytes(mem, curr_marker->data_length - 14, "JPEG ICC Profile"); if (*profile != NULL) - { + { /* If we can't create it, just ignore */ memcpy(*profile, &(curr_marker->data[14]), (curr_marker->data_length) - 14); *profile_size = curr_marker->data_length - 14; diff --git a/xps/xpspage.c b/xps/xpspage.c index 0d617b2f3..a0218cc00 100644 --- a/xps/xpspage.c +++ b/xps/xpspage.c @@ -228,8 +228,8 @@ xps_parse_fixed_page(xps_context_t *ctx, xps_part_t *part) /* Initialize the default profiles in the ctx to what is in the manager */ ctx->gray->cmm_icc_profile_data = ctx->pgs->icc_manager->default_gray; ctx->srgb->cmm_icc_profile_data = ctx->pgs->icc_manager->default_rgb; - /* scrgb really needs to be a bit different. Unless we are handling nonlinearity - before conversion from float . ToDo. */ + /* scrgb really needs to be a bit different. + * Unless we are handling nonlinearity before conversion from float. ToDo. */ ctx->scrgb->cmm_icc_profile_data = ctx->pgs->icc_manager->default_rgb; ctx->cmyk->cmm_icc_profile_data = ctx->pgs->icc_manager->default_cmyk; diff --git a/xps/xpspath.c b/xps/xpspath.c index c25dce0d1..db1583ba2 100644 --- a/xps/xpspath.c +++ b/xps/xpspath.c @@ -588,10 +588,9 @@ static void xps_parse_arc_segment(xps_context_t *ctx, xps_item_t *root, int stroking, int *skipped_stroke) { /* ArcSegment pretty much follows the SVG algorithm for converting an - arc in endpoint representation to an arc in centerpoint - representation. Once in centerpoint it can be given to the - graphics library in the form of a postscript arc. - */ + * arc in endpoint representation to an arc in centerpoint + * representation. Once in centerpoint it can be given to the + * graphics library in the form of a postscript arc. */ float rotation_angle; int is_large_arc, is_clockwise; diff --git a/xps/xpstiff.c b/xps/xpstiff.c index 1b96949dc..82366fabc 100644 --- a/xps/xpstiff.c +++ b/xps/xpstiff.c @@ -656,8 +656,7 @@ xps_decode_tiff_strips(gs_memory_t *mem, xps_tiff_t *tiff, xps_image_t *image) break; } - /* Note xres and yres could be 0 even if unit was set. If so - default to 96dpi */ + /* Note xres and yres could be 0 even if unit was set. If so default to 96dpi */ if (image->xres == 0 || image->yres == 0) { image->xres = 96; @@ -899,8 +898,8 @@ xps_read_tiff_tag(gs_memory_t *mem, xps_tiff_t *tiff, unsigned offset) tiff->iccprofile = (unsigned char*) gs_alloc_bytes(mem, count , "TIFF ICC Profile"); if (!tiff->iccprofile) return gs_throw(-1, "could not allocate embedded icc profile"); - /* ICC profile data type is set to UNDEFINED. TBYTE reading not correct - in xps_read_tiff_tag_value */ + /* ICC profile data type is set to UNDEFINED. + * TBYTE reading not correct in xps_read_tiff_tag_value */ xps_read_tiff_bytes((unsigned char *) tiff->iccprofile, tiff, value, count); tiff->profile_size = count; break; @@ -938,9 +937,7 @@ xps_read_tiff_tag(gs_memory_t *mem, xps_tiff_t *tiff, unsigned offset) return gs_throw(-1, "tiled tiffs not supported"); default: - /* - printf("unknown tag: %d t=%d n=%d\n", tag, type, count); - */ + /* printf("unknown tag: %d t=%d n=%d\n", tag, type, count); */ break; } diff --git a/xps/xpstile.c b/xps/xpstile.c index fe6e6a444..1defe2201 100644 --- a/xps/xpstile.c +++ b/xps/xpstile.c @@ -123,7 +123,8 @@ xps_paint_tiling_brush(const gs_client_color *pcc, gs_state *pgs) return 0; } -int xps_high_level_pattern(xps_context_t *ctx) +int +xps_high_level_pattern(xps_context_t *ctx) { gs_matrix m; gs_rect bbox; @@ -136,7 +137,7 @@ int xps_high_level_pattern(xps_context_t *ctx) gs_pattern1_instance_t *pinst = (gs_pattern1_instance_t *)gs_currentcolor(ctx->pgs)->pattern; - code = gx_pattern_cache_add_dummy_entry((gs_imager_state *)ctx->pgs, + code = gx_pattern_cache_add_dummy_entry((gs_imager_state *)ctx->pgs, pinst, ctx->pgs->device->color_info.depth); if (code < 0) return code; @@ -161,26 +162,27 @@ int xps_high_level_pattern(xps_context_t *ctx) gs_grestore(ctx->pgs); return code; } - code = dev_proc(ctx->pgs->device, pattern_manage)(ctx->pgs->device, pinst->id, pinst, + code = dev_proc(ctx->pgs->device, pattern_manage)(ctx->pgs->device, pinst->id, pinst, pattern_manage__start_accum); if (code < 0) { gs_grestore(ctx->pgs); return code; } - xps_paint_tiling_brush(&pdc->ccolor, ctx->pgs); + xps_paint_tiling_brush(&pdc->ccolor, ctx->pgs); code = gs_grestore(ctx->pgs); - if (code < 0) + if (code < 0) return code; - code = dev_proc(ctx->pgs->device, pattern_manage)(ctx->pgs->device, gx_no_bitmap_id, NULL, + code = dev_proc(ctx->pgs->device, pattern_manage)(ctx->pgs->device, gx_no_bitmap_id, NULL, pattern_manage__finish_accum); return code; } -static int xps_remap_pattern(const gs_client_color *pcc, gs_state *pgs) +static int +xps_remap_pattern(const gs_client_color *pcc, gs_state *pgs) { const gs_client_pattern *ppat = gs_getpattern(pcc); struct tile_closure_s *c = ppat->client_data; @@ -191,7 +193,7 @@ static int xps_remap_pattern(const gs_client_color *pcc, gs_state *pgs) * that is 'behind' that, the actual output device, so we use the one from * the saved XPS graphics state. */ - code = dev_proc(ctx->pgs->device, pattern_manage)(ctx->pgs->device, ppat->uid.id, ppat, + code = dev_proc(ctx->pgs->device, pattern_manage)(ctx->pgs->device, ppat->uid.id, ppat, pattern_manage__can_accum); if (code == 1) { @@ -210,7 +212,7 @@ static int xps_remap_pattern(const gs_client_color *pcc, gs_state *pgs) int xps_parse_tiling_brush(xps_context_t *ctx, char *base_uri, xps_resource_t *dict, xps_item_t *root, - int (*func)(xps_context_t*, char*, xps_resource_t*, xps_item_t*, void*), void *user) + int (*func)(xps_context_t*, char*, xps_resource_t*, xps_item_t*, void*), void *user) { xps_item_t *node; int code; diff --git a/xps/xpstop.c b/xps/xpstop.c index efcbcdb96..11fe803d4 100644 --- a/xps/xpstop.c +++ b/xps/xpstop.c @@ -121,7 +121,7 @@ xps_imp_allocate_interp_instance(pl_interp_instance_t **ppinstance, /* Declare PDL client support for high level patterns, for the benefit * of pdfwrite and other high-level devices */ - ctx->pgs->have_pattern_streams = true; + ctx->pgs->have_pattern_streams = true; ctx->fontdir = NULL; ctx->file = NULL; ctx->zip_count = 0; @@ -203,7 +203,7 @@ xps_imp_set_device(pl_interp_instance_t *pinstance, gx_device *pdevice) if (code < 0) goto cleanup_setdevice; - gs_setaccuratecurves(ctx->pgs, true); /* NB not sure */ + gs_setaccuratecurves(ctx->pgs, true); /* NB not sure */ gs_setfilladjust(ctx->pgs, 0, 0); /* gsave and grestore (among other places) assume that */ @@ -270,9 +270,7 @@ xps_imp_process(pl_interp_instance_t *pinstance, stream_cursor_read *cursor) if (!instance->scratch_file) { instance->scratch_file = gp_open_scratch_file(ctx->memory, - "ghostxps-scratch-", - instance->scratch_name, - "wb"); + "ghostxps-scratch-", instance->scratch_name, "wb"); if (!instance->scratch_file) { gs_catch(gs_error_invalidfileaccess, "cannot open scratch file"); @@ -409,11 +407,11 @@ xps_imp_remove_device(pl_interp_instance_t *pinstance) xps_interp_instance_t *instance = (xps_interp_instance_t *)pinstance; xps_context_t *ctx = instance->ctx; - int code = 0; /* first error status encountered */ + int code = 0; /* first error status encountered */ int error; - /* return to original gstate */ - gs_grestore_only(ctx->pgs); /* destroys gs_save stack */ + /* return to original gstate */ + gs_grestore_only(ctx->pgs); /* destroys gs_save stack */ /* Deselect device */ /* NB */ diff --git a/xps/xpsttf.c b/xps/xpsttf.c index b52511ce3..e55c2d036 100644 --- a/xps/xpsttf.c +++ b/xps/xpsttf.c @@ -115,8 +115,8 @@ xps_true_callback_encode_char(gs_font *pfont, gs_char chr, gs_glyph_space_t spc) static gs_char xps_true_callback_decode_glyph(gs_font *pfont, gs_glyph glyph) { - /* We should do a reverse cmap lookup here to match PS/PDF. */ - /* However, a complete rearchitecture of our text and font processing + /* We should do a reverse cmap lookup here to match PS/PDF. + * However, a complete rearchitecture of our text and font processing * would be necessary to match XPS unicode mapping with the * cluster maps. Alas, we cheat similarly to PCL. */ return xps_last_char; @@ -157,7 +157,7 @@ xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *ps if (table_offset < 0) return gs_throw(-1, "no post table"); - /* this shoudn't happen but... */ + /* this shoudn't happen but... */ if ( table_length == 0 ) return gs_throw(-1, "zero-size post table"); @@ -217,7 +217,7 @@ xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *ps glyph_name_index -= 258; /* The string we want is the index'th pascal string, - so we "hop" to each length byte "index" times. */ + * so we "hop" to each length byte "index" times. */ while (glyph_name_index > 0) { pascal_stringp += ((int)(*pascal_stringp)+1); @@ -235,8 +235,8 @@ xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *ps return gs_throw(-1, "data out of range"); /* sigh - we have to allocate a copy of the data - by the - time a high level device makes use of it the font data - may be freed. This is a necessary leak. */ + * time a high level device makes use of it the font data + * may be freed. This is a necessary leak. */ mydata = gs_alloc_bytes(pfont->memory, pstr->size + 1, "glyph to name"); if ( mydata == 0 ) return -1; @@ -244,7 +244,6 @@ xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *ps pstr->data = mydata; mydata[pstr->size] = 0; - // dprintf2("glyph name (tbl) %d = %s\n", glyph, pstr->data); return 0; } |