diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2016-05-18 18:35:33 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2016-05-20 09:20:21 +0100 |
commit | 7d3dc0cccbf7b1a1d0a273eb78287bf8bb659fb8 (patch) | |
tree | 47860e14d64f4bec7a46791a3f58da02f45ff763 /psi | |
parent | b1b8ec293a199d58742c3ed45c47f249359e3392 (diff) | |
download | ghostpdl-7d3dc0cccbf7b1a1d0a273eb78287bf8bb659fb8.tar.gz |
Remove gs_no_glyph, gs_min_cid_glyph and gs_max_glyph
These were legacy remnants. Replace their remaining uses with the upper case,
non-deprecated equivalents.
Diffstat (limited to 'psi')
-rw-r--r-- | psi/zbfont.c | 10 | ||||
-rw-r--r-- | psi/zchar.c | 14 | ||||
-rw-r--r-- | psi/zchar32.c | 4 | ||||
-rw-r--r-- | psi/zcharout.c | 2 | ||||
-rw-r--r-- | psi/zcharx.c | 4 | ||||
-rw-r--r-- | psi/zfcid0.c | 6 | ||||
-rw-r--r-- | psi/zfcid1.c | 4 | ||||
-rw-r--r-- | psi/zfont.c | 2 | ||||
-rw-r--r-- | psi/zfont32.c | 2 | ||||
-rw-r--r-- | psi/zfont42.c | 6 |
10 files changed, 27 insertions, 27 deletions
diff --git a/psi/zbfont.c b/psi/zbfont.c index 8c8237403..d6661a40b 100644 --- a/psi/zbfont.c +++ b/psi/zbfont.c @@ -88,7 +88,7 @@ zfont_encode_char(gs_font *pfont, gs_char chr, gs_glyph_space_t gspace) int code = array_get(pfont->memory, pencoding, (long)index, &cname); if (code < 0 || !r_has_type(&cname, t_name)) - return gs_no_glyph; + return GS_NO_GLYPH; if (pfont->FontType == ft_user_defined && r_type(&pdata->BuildGlyph) == t_null) { ref nsref, tname; @@ -108,7 +108,7 @@ zfont_encode_char(gs_font *pfont, gs_char chr, gs_glyph_space_t gspace) int code; if (gspace == GLYPH_SPACE_NOGEN) - return gs_no_glyph; + return GS_NO_GLYPH; gs_sprintf(buf, "j%ld", chr); /* 'j' is arbutrary. */ code = name_ref(pfont->memory, (const byte *)buf, strlen(buf), &tname, 1); if (code < 0) { @@ -127,7 +127,7 @@ zfont_glyph_name(gs_font *font, gs_glyph index, gs_const_string *pstr) { ref nref, sref; - if (index >= gs_min_cid_glyph) { /* Fabricate a numeric name. */ + if (index >= GS_MIN_CID_GLYPH) { /* Fabricate a numeric name. */ char cid_name[sizeof(gs_glyph) * 3 + 1]; int code; @@ -148,8 +148,8 @@ static gs_char gs_font_map_glyph_by_dict(const gs_memory_t *mem, const ref *map, gs_glyph glyph) { ref *v, n; - if (glyph >= gs_min_cid_glyph) { - uint cid = glyph - gs_min_cid_glyph; + if (glyph >= GS_MIN_CID_GLYPH) { + uint cid = glyph - GS_MIN_CID_GLYPH; if (dict_find_string(map, "CIDCount", &v) > 0) { /* This is a CIDDEcoding resource. */ diff --git a/psi/zchar.c b/psi/zchar.c index 095a1fc41..a01257128 100644 --- a/psi/zchar.c +++ b/psi/zchar.c @@ -469,10 +469,10 @@ const op_def zchar_b_op_defs[] = void glyph_ref(const gs_memory_t *mem, gs_glyph glyph, ref * gref) { - if (glyph < gs_min_cid_glyph) + if (glyph < GS_MIN_CID_GLYPH) name_index_ref(mem, glyph, gref); else - make_int(gref, glyph - gs_min_cid_glyph); + make_int(gref, glyph - GS_MIN_CID_GLYPH); } /* Prepare to set up for a text operator. */ @@ -516,8 +516,8 @@ op_show_finish_setup(i_ctx_t *i_ctx_p, gs_text_enum_t * penum, int npop, SHOW_IS_ALL_OF(osenum, TEXT_FROM_STRING | TEXT_DO_NONE | TEXT_INTERVENE) && SHOW_IS_ALL_OF(penum, TEXT_FROM_STRING | TEXT_RETURN_WIDTH) && - (glyph = gs_text_current_glyph(osenum)) != gs_no_glyph && - glyph >= gs_min_cid_glyph && + (glyph = gs_text_current_glyph(osenum)) != GS_NO_GLYPH && + glyph >= GS_MIN_CID_GLYPH && /* According to PLRM, we don't need to raise a rangecheck error, if currentfont is changed in the proc of the operator 'cshow'. */ @@ -640,7 +640,7 @@ op_show_continue_dispatch(i_ctx_t *i_ctx_p, int npop, int code) /* Type 3 font, prefer BuildGlyph. */ if (level2_enabled && !r_has_type(&pfdata->BuildGlyph, t_null) && - glyph != gs_no_glyph + glyph != GS_NO_GLYPH ) { glyph_ref(imemory, glyph, op); esp[2] = pfdata->BuildGlyph; @@ -679,7 +679,7 @@ op_show_continue_dispatch(i_ctx_t *i_ctx_p, int npop, int code) if (chr != gs_no_char && !r_has_type(&pfdata->BuildChar, t_null) && - (glyph == gs_no_glyph || + (glyph == GS_NO_GLYPH || (!r_has_type(&pfdata->Encoding, t_null) && array_get(imemory, &pfdata->Encoding, (long)(chr & 0xff), &eref) >= 0 && (glyph_ref(imemory, glyph, &gref), obj_eq(imemory, &gref, &eref)))) @@ -688,7 +688,7 @@ op_show_continue_dispatch(i_ctx_t *i_ctx_p, int npop, int code) esp[2] = pfdata->BuildChar; } else { /* We might not have a glyph: substitute 0. **HACK** */ - if (glyph == gs_no_glyph) + if (glyph == GS_NO_GLYPH) make_int(op, 0); else glyph_ref(imemory, glyph, op); diff --git a/psi/zchar32.c b/psi/zchar32.c index f31293d71..01bc716f6 100644 --- a/psi/zchar32.c +++ b/psi/zchar32.c @@ -135,8 +135,8 @@ zremoveglyphs(i_ctx_t *i_ctx_p) return code; if (range.font->FontType != ft_CID_bitmap) return_error(gs_error_invalidfont); - range.cid_min = gs_min_cid_glyph + op[-2].value.intval; - range.cid_max = gs_min_cid_glyph + op[-1].value.intval; + range.cid_min = GS_MIN_CID_GLYPH + op[-2].value.intval; + range.cid_max = GS_MIN_CID_GLYPH + op[-1].value.intval; gx_purge_selected_cached_chars(range.font->dir, select_cid_range, &range); pop(3); diff --git a/psi/zcharout.c b/psi/zcharout.c index 548584d0f..a0cf6e728 100644 --- a/psi/zcharout.c +++ b/psi/zcharout.c @@ -410,7 +410,7 @@ next: if (index >= 0) { switch (r_type(elt)) { case t_integer: - *pglyph = gs_min_cid_glyph + elt[0].value.intval; + *pglyph = GS_MIN_CID_GLYPH + elt[0].value.intval; break; case t_name: *pglyph = name_index(mem, elt); diff --git a/psi/zcharx.c b/psi/zcharx.c index 7e2fc3172..f2a4ed59c 100644 --- a/psi/zcharx.c +++ b/psi/zcharx.c @@ -40,8 +40,8 @@ glyph_show_setup(i_ctx_t *i_ctx_p, gs_glyph *pglyph) case ft_CID_user_defined: case ft_CID_TrueType: case ft_CID_bitmap: - check_int_leu(*op, gs_max_glyph - gs_min_cid_glyph); - *pglyph = (gs_glyph) op->value.intval + gs_min_cid_glyph; + check_int_leu(*op, GS_MAX_GLYPH - GS_MIN_CID_GLYPH); + *pglyph = (gs_glyph) op->value.intval + GS_MIN_CID_GLYPH; break; default: check_type(*op, t_name); diff --git a/psi/zfcid0.c b/psi/zfcid0.c index ff6910871..a438cbee0 100644 --- a/psi/zfcid0.c +++ b/psi/zfcid0.c @@ -178,7 +178,7 @@ z9_glyph_data(gs_font_base *pbfont, gs_glyph glyph, gs_glyph_data_t *pgd, { gs_font_cid0 *pfont = (gs_font_cid0 *)pbfont; const font_data *pfdata = pfont_data(pfont); - long glyph_index = (long)(glyph - gs_min_cid_glyph); + long glyph_index = (long)(glyph - GS_MIN_CID_GLYPH); gs_glyph_data_t gdata; ulong fidx; int code; @@ -538,7 +538,7 @@ ztype9mapcid(i_ctx_t *i_ctx_p) pfcid = (gs_font_cid0 *)pfont; gdata.memory = pfont->memory; code = pfcid->cidata.glyph_data((gs_font_base *)pfcid, - (gs_glyph)(gs_min_cid_glyph + op->value.intval), + (gs_glyph)(GS_MIN_CID_GLYPH + op->value.intval), &gdata, &fidx); /* return code; original error-sensitive & fragile code */ @@ -552,7 +552,7 @@ ztype9mapcid(i_ctx_t *i_ctx_p) /* reload glyph for default_fallback_CID */ code = pfcid->cidata.glyph_data((gs_font_base *)pfcid, - (gs_glyph)(gs_min_cid_glyph + default_fallback_CID), + (gs_glyph)(GS_MIN_CID_GLYPH + default_fallback_CID), &gdata, &fidx); if (code < 0) { diff --git a/psi/zfcid1.c b/psi/zfcid1.c index be8cf618a..8f3a227b4 100644 --- a/psi/zfcid1.c +++ b/psi/zfcid1.c @@ -73,7 +73,7 @@ static int z11_CIDMap_proc(gs_font_cid2 *pfont, gs_glyph glyph) { const ref *pcidmap = &pfont_data(pfont)->u.type42.CIDMap; - ulong cid = glyph - gs_min_cid_glyph; + ulong cid = glyph - GS_MIN_CID_GLYPH; int gdbytes = pfont->cidata.common.GDBytes; int gnum = 0; const byte *data; @@ -527,7 +527,7 @@ ztype11mapcid(i_ctx_t *i_ctx_p) if (pfont->FontType != ft_CID_TrueType) return_error(gs_error_invalidfont); code = z11_CIDMap_proc((gs_font_cid2 *)pfont, - (gs_glyph)(gs_min_cid_glyph + op->value.intval)); + (gs_glyph)(GS_MIN_CID_GLYPH + op->value.intval)); } if (code < 0) return code; diff --git a/psi/zfont.c b/psi/zfont.c index d28777735..6c4f51bf0 100644 --- a/psi/zfont.c +++ b/psi/zfont.c @@ -41,7 +41,7 @@ static int setup_unicode_decoder(i_ctx_t *i_ctx_p, ref *Decoding); bool zfont_mark_glyph_name(const gs_memory_t *mem, gs_glyph glyph, void *ignore_data) { - return (glyph >= gs_c_min_std_encoding_glyph || glyph == gs_no_glyph ? false : + return (glyph >= gs_c_min_std_encoding_glyph || glyph == GS_NO_GLYPH ? false : name_mark_index(mem, (uint) glyph)); } diff --git a/psi/zfont32.c b/psi/zfont32.c index 313c75d97..7dcc15030 100644 --- a/psi/zfont32.c +++ b/psi/zfont32.c @@ -30,7 +30,7 @@ static gs_glyph zfont_no_encode_char(gs_font *pfont, gs_char chr, gs_glyph_space_t ignored) { - return gs_no_glyph; + return GS_NO_GLYPH; } /* <string|name> <font_dict> .buildfont32 <string|name> <font> */ diff --git a/psi/zfont42.c b/psi/zfont42.c index 21971a005..c5960a5f7 100644 --- a/psi/zfont42.c +++ b/psi/zfont42.c @@ -365,8 +365,8 @@ z42_gdir_enumerate_glyph(gs_font *font, int *pindex, pgdict = &pfont_data(font)->CharStrings; /* A trick : use zchar_enumerate_glyph to enumerate GIDs : */ code = zchar_enumerate_glyph(font->memory, pgdict, pindex, pglyph); - if (*pindex != 0 && *pglyph >= gs_min_cid_glyph) - *pglyph = *pglyph - gs_min_cid_glyph + GS_MIN_GLYPH_INDEX; + if (*pindex != 0 && *pglyph >= GS_MIN_CID_GLYPH) + *pglyph = *pglyph - GS_MIN_CID_GLYPH + GS_MIN_GLYPH_INDEX; return code; } @@ -379,7 +379,7 @@ z42_encode_char(gs_font *font, gs_char chr, gs_glyph_space_t glyph_space) { gs_glyph glyph = zfont_encode_char(font, chr, glyph_space); - return (glyph_space == GLYPH_SPACE_INDEX && glyph != gs_no_glyph ? + return (glyph_space == GLYPH_SPACE_INDEX && glyph != GS_NO_GLYPH ? glyph_to_index(font, glyph) : glyph); } static int |