libctx changes for compiled fonts
Ralph Giles <[email protected]> Mon, 25 Oct 2004 19:56:54 -0700
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
This is a code review submission for already committed code. The patch
below was necessary for iccfont.c to build with the libctx memory ptr
changes. This had broken compiled-in font support (bug 687758).
http://ghostscript.com/pipermail/gs-cvs/2004-October/004948.html
Modified Files:
cfonts.mak iccfont.c
Log Message:
Add libctx memory pointers where required in the compiled-fonts code. This
was missed in the initial commit. Also, add the OBJ directory to the include
path when compiling the font data, since stdpre.h now requires the generate
arch.h header. Closes bug 687758.
Index: cfonts.mak
===================================================================
RCS file: /cvs/ghostscript/gs/src/cfonts.mak,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cfonts.mak 21 Feb 2002 22:24:51 -0000 1.4
+++ cfonts.mak 26 Oct 2004 02:50:56 -0000 1.5
@@ -35,7 +35,7 @@
CFGEN=$(CFGENDIR)$(D)
CFOBJ=$(CFOBJDIR)$(D)
-CFCC=$(CC_) $(I_)$(PSSRCDIR)$(_I)
+CFCC=$(CC_) $(I_)$(PSSRCDIR)$(_I) $(I_)$(PSOBJDIR)$(_I)
CFO_=$(O_)$(CFOBJ)
# Define how to invoke the font2c program.
Index: iccfont.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/iccfont.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- iccfont.c 7 Oct 2004 05:18:34 -0000 1.10
+++ iccfont.c 26 Oct 2004 02:50:56 -0000 1.11
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1998, 1999 artofcode LLC. All rights reserved.
+/* Copyright (C) 1992-2004 artofcode LLC. All rights reserved.
This software is provided AS-IS with no warranty, either express or
implied.
@@ -131,13 +131,13 @@
if (glyph == GS_NO_GLYPH)
code = gs_note_error(e_undefined);
else if ((code = gs_c_glyph_name(glyph, &gstr)) >= 0)
- code = name_ref(gstr.data, gstr.size, &kname, 0);
+ code = name_ref(imemory, gstr.data, gstr.size, &kname, 0);
kp->num_enc_keys--;
} else { /* must have kp->num_str_keys != 0 */
code = cfont_next_string(&kep->strings);
if (code != 1)
return (code < 0 ? code : gs_note_error(e_Fatal));
- code = name_ref(kep->strings.next.value.const_bytes,
+ code = name_ref(imemory, kep->strings.next.value.const_bytes,
r_size(&kep->strings.next), &kname, 0);
kp->num_str_keys--;
}
@@ -254,7 +254,7 @@
if (code != 1)
return (code < 0 ? code : gs_note_error(e_Fatal));
- code = name_ref(senum.next.value.const_bytes,
+ code = name_ref(imemory, senum.next.value.const_bytes,
r_size(&senum.next), &nref, 0);
if (code < 0)
return code;
@@ -317,7 +317,7 @@
private int
cfont_name_create(i_ctx_t *i_ctx_p, ref * pnref, const char *str)
{
- return name_ref((const byte *)str, strlen(str), pnref, 0);
+ return name_ref(imemory, (const byte *)str, strlen(str), pnref, 0);
}
/* Create an object by parsing a string. */
@@ -329,7 +329,7 @@
int code;
scanner_state_init(&sstate, false);
- s_init(&s, i_ctx_p->memory);
+ s_init(&s, imemory);
sread_string(&s, (const byte *)str, len);
code = scan_token(i_ctx_p, &s, pref, &sstate);
return (code <= 0 ? code : gs_note_error(e_Fatal));