From 7404f27e585163a341b474fe28cd3d0df5f7e152 Mon Sep 17 00:00:00 2001 From: handa Date: Tue, 9 Jan 2007 03:46:06 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 13 +++++++++++++ src/otfdrive.c | 19 +++++++++++-------- src/otferror.c | 4 ++-- src/otferror.h | 2 +- src/otfopen.c | 20 ++++++++++---------- 5 files changed, 37 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index db5bd86..07cb0dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2007-01-09 Kenichi Handa + + * src/otf.h: Adjusted for C++. Adjusted many prototypes to + contain `const' qualifiers. + + * src/otferror.h (otf__error): Add `const' qualifier. + + * src/otferror.c (otf__error, OTF_perror): Add `const' qualifiers. + + * src/otfdrive.c: Add many `const' qualifiers. + + * src/otfopen.c: Add many `const' qualifiers. + 2006-07-25 Kenichi Handa * Version 0.9.5 released. diff --git a/src/otfdrive.c b/src/otfdrive.c index 987c649..f917838 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -159,7 +159,8 @@ get_class_def (OTF_ClassDef *class_def, OTF_GlyphID glyph_id) } static OTF_LangSys * -get_langsys (OTF_ScriptList *script_list, char *script, char *language) +get_langsys (OTF_ScriptList *script_list, + const char *script, const char *language) { OTF_Tag script_tag = OTF_tag (script); @@ -197,7 +198,7 @@ get_langsys (OTF_ScriptList *script_list, char *script, char *language) static int setup_lookup_indices (OTF_LookupList *LookupList, OTF_FeatureList *FeatureList, - char *features, int *lookup_indices) + const char *features, int *lookup_indices) { int i, j, n = 0; OTF_Feature *feature; @@ -1347,7 +1348,8 @@ OTF_drive_gdef (OTF *otf, OTF_GlyphString *gstring) static int OTF_drive_gsub_internal (OTF *otf, OTF_GlyphString *gstring, - char *script, char *language, char *features, + const char *script, const char *language, + const char *features, int alternate_subst) { char *errfmt = "GSUB driving%s"; @@ -1419,14 +1421,14 @@ OTF_drive_gsub_internal (OTF *otf, OTF_GlyphString *gstring, int OTF_drive_gsub (OTF *otf, OTF_GlyphString *gstring, - char *script, char *language, char *features) + const char *script, const char *language, const char *features) { return OTF_drive_gsub_internal (otf, gstring, script, language, features, 0); } int OTF_drive_gpos (OTF *otf, OTF_GlyphString *gstring, - char *script, char *language, char *features) + const char *script, const char *language, const char *features) { char *errfmt = "GPOS driving%s"; int errret = -1; @@ -1478,8 +1480,8 @@ OTF_drive_gpos (OTF *otf, OTF_GlyphString *gstring, int OTF_drive_tables (OTF *otf, OTF_GlyphString *gstring, - char *script, char *language, - char *gsub_features, char *gpos_features) + const char *script, const char *language, + const char *gsub_features, const char *gpos_features) { if (OTF_drive_cmap (otf, gstring) < 0) return -1; @@ -1496,7 +1498,8 @@ OTF_drive_tables (OTF *otf, OTF_GlyphString *gstring, int OTF_drive_gsub_alternate (OTF *otf, OTF_GlyphString *gstring, - char *script, char *language, char *features) + const char *script, const char *language, + const char *features) { return OTF_drive_gsub_internal (otf, gstring, script, language, features, 1); } diff --git a/src/otferror.c b/src/otferror.c index 36093fd..015ccc7 100644 --- a/src/otferror.c +++ b/src/otferror.c @@ -44,7 +44,7 @@ static char *error_string[] = }; int -otf__error (int err, char *fmt, void *arg) +otf__error (int err, const char *fmt, const void *arg) { sprintf (error_message, "OTF-Error (%s): ", error_string[err]); sprintf (error_message + strlen (error_message), fmt, arg); @@ -53,7 +53,7 @@ otf__error (int err, char *fmt, void *arg) } void -OTF_perror (char *prefix) +OTF_perror (const char *prefix) { if (OTF_error == 0) sprintf (error_message, "%s", error_string[0]); diff --git a/src/otferror.h b/src/otferror.h index 64201c2..01c7e5e 100644 --- a/src/otferror.h +++ b/src/otferror.h @@ -24,5 +24,5 @@ write to the Free Software Foundation, Inc., 59 Temple Place, Suite #define OTF_ERROR(err, arg) \ return (otf__error ((err), errfmt, (arg)), errret) -extern int otf__error (int err, char *fmt, void *arg); +extern int otf__error (int err, const char *fmt, const void *arg); diff --git a/src/otfopen.c b/src/otfopen.c index 0f72757..ea0445b 100644 --- a/src/otfopen.c +++ b/src/otfopen.c @@ -82,7 +82,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place, Suite typedef struct { - char *name; + const char *name; long pos; long bufsize; long allocated; @@ -92,7 +92,7 @@ typedef struct typedef long OTF_StreamState; OTF_Stream * -make_stream (char *name) +make_stream (const char *name) { OTF_Stream *stream; char *errfmt = "stream creation%s"; @@ -132,7 +132,7 @@ setup_stream (OTF_Stream *stream, FILE *fp, long offset, int nbytes) } OTF_Stream * -make_stream_from_ft_face (FT_Face face, char *name) +make_stream_from_ft_face (FT_Face face, const char *name) { char *errfmt = "FT_Face stream creation for %s"; void *errret = NULL; @@ -2739,7 +2739,7 @@ read_header_part (OTF *otf, FILE *fp, FT_Face face) } static OTF_TableInfo * -get_table_info (OTF *otf, char *name) +get_table_info (OTF *otf, const char *name) { char *errfmt = "OTF Table Read%s"; OTF_TableInfo *errret = NULL; @@ -2786,7 +2786,7 @@ get_table_info (OTF *otf, char *name) freeing memory previously allocated. */ OTF * -OTF_open (char *otf_name) +OTF_open (const char *otf_name) { FILE *fp; char *errfmt = "opening otf (%s)"; @@ -2907,7 +2907,7 @@ OTF_close (OTF *otf) /*** (2-3) OTF_get_table() */ int -OTF_get_table (OTF *otf, char *name) +OTF_get_table (OTF *otf, const char *name) { OTF_TableInfo *table_info = get_table_info (otf, name); void *address; @@ -2932,7 +2932,7 @@ OTF_get_table (OTF *otf, char *name) /*** (2-4) OTF_check_table() */ int -OTF_check_table (OTF *otf, char *name) +OTF_check_table (OTF *otf, const char *name) { return (get_table_info (otf, name) ? 0 : -1); } @@ -2995,7 +2995,7 @@ OTF_get_features (OTF *otf, int gsubp) int OTF_check_features (OTF *otf, int gsubp, - OTF_Tag script, OTF_Tag language, OTF_Tag *features, + OTF_Tag script, OTF_Tag language, const OTF_Tag *features, int n_features) { OTF_ScriptList *script_list; @@ -3070,9 +3070,9 @@ OTF_check_features (OTF *otf, int gsubp, /*** (5) API miscellaneous ***/ OTF_Tag -OTF_tag (char *name) +OTF_tag (const char *name) { - unsigned char *p = (unsigned char *) name; + const unsigned char *p = (unsigned char *) name; if (! name) return (OTF_Tag) 0; -- 1.7.10.4