diff options
Diffstat (limited to 'src/Type1/token.c')
-rw-r--r-- | src/Type1/token.c | 143 |
1 files changed, 72 insertions, 71 deletions
diff --git a/src/Type1/token.c b/src/Type1/token.c index 054e1ea..ef28990 100644 --- a/src/Type1/token.c +++ b/src/Type1/token.c @@ -27,6 +27,7 @@ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ +/* $XFree86: xc/lib/font/Type1/token.c,v 1.5 2001/01/17 19:43:24 dawes Exp $ */ /* Authors: Sig Nin & Carol Thompson IBM Almaden Research Laboratory */ #include "t1stdio.h" #include "util.h" @@ -97,8 +98,8 @@ static double Exp10T[128] = { 1e56, 1e57, 1e58, 1e59, 1e60, 1e61, 1e62, 1e63 }; -static double P10(exponent) - long exponent; +static double +P10(long exponent) { double value, power; @@ -201,15 +202,15 @@ isWHITE_SPACE(ch)\ #define DONE (256) /* Get the next input character */ -static int next_char(ch) - int ch; +static int +next_char(int ch) { return(next_ch()); } /* Add character to token */ -static int add_char(ch) - int ch; +static int +add_char(int ch) { save_ch(ch); return(next_ch()); @@ -221,8 +222,8 @@ static int add_char(ch) */ /* Skip white space */ -static int skip_space(ch) - int ch; +static int +skip_space(int ch) { do { ch = next_ch(); @@ -231,8 +232,8 @@ static int skip_space(ch) } /* Skip comments */ -static int skip_comment(ch) - int ch; +static int +skip_comment(int ch) { do { ch = next_ch(); @@ -259,23 +260,23 @@ static long r_base; static long r_value; static long r_scale; -static int add_sign(ch) - int ch; +static int +add_sign(int ch) { m_sign = ch; save_unsafe_ch(ch); return(next_ch()); } -static int add_1st_digits(ch) - int ch; +static int +add_1st_digits(int ch) { m_sign = '+'; return(add_digits(ch)); } -static int add_digits(ch) - int ch; +static int +add_digits(int ch) { long value, p_value, scale; int digit; @@ -366,15 +367,15 @@ static int add_digits(ch) return(ch); } -static int add_1st_decpt(ch) - int ch; +static int +add_1st_decpt(int ch) { m_sign = '+'; return(add_decpt(ch)); } -static int add_decpt(ch) - int ch; +static int +add_decpt(int ch) { /* On entry, expect m_sign to be set to '+' or '-' */ m_value = 0; @@ -383,8 +384,8 @@ static int add_decpt(ch) return(next_ch()); } -static int add_fraction(ch) - int ch; +static int +add_fraction(int ch) { long value, scale; int digit; @@ -480,16 +481,16 @@ static int add_fraction(ch) return(ch); } -static int add_e_sign(ch) - int ch; +static int +add_e_sign(int ch) { e_sign = ch; save_ch(ch); return(next_ch()); } -static int add_exponent(ch) - int ch; +static int +add_exponent(int ch) { long value, p_value; long scale = 0; @@ -558,8 +559,8 @@ static int add_exponent(ch) return(ch); } -static int add_radix(ch) - int ch; +static int +add_radix(int ch) { if (2 <= m_value && m_value <= 36 && m_scale == 0) { r_base = m_value; @@ -572,8 +573,8 @@ static int add_radix(ch) } } -static int add_r_digits(ch) - int ch; +static int +add_r_digits(int ch) { unsigned long value; long radix, scale; @@ -654,8 +655,8 @@ static int add_r_digits(ch) */ /* Done: Radix Number */ -static int RADIX_NUMBER(ch) - int ch; +static int +RADIX_NUMBER(int ch) { back_ch_not_white(ch); if (r_scale == 0) { @@ -669,8 +670,8 @@ static int RADIX_NUMBER(ch) } /* Done: Integer */ -static int INTEGER(ch) - int ch; +static int +INTEGER(int ch) { back_ch_not_white(ch); if (m_scale == 0) { @@ -685,8 +686,8 @@ static int INTEGER(ch) } /* Done: Real */ -static int REAL(ch) - int ch; +static int +REAL(int ch) { double temp; @@ -722,8 +723,8 @@ static int REAL(ch) */ /* Done: Hex String */ -static int HEX_STRING(ch) - int ch; +static int +HEX_STRING(int ch) { int value; @@ -795,8 +796,8 @@ static int HEX_STRING(ch) * "\\", "\(", and "\)", simply store the second * character. */ -static void save_digraph(ch) - int ch; +static void +save_digraph(int ch) { int value; @@ -858,8 +859,8 @@ static void save_digraph(ch) } /* Done: String */ -static int STRING(ch) - int ch; +static int +STRING(int ch) { int nest_level = 1; @@ -925,8 +926,8 @@ static int STRING(ch) * start out looking like something else). */ -static int AAH_NAME(ch) - int ch; +static int +AAH_NAME(int ch) { do { save_ch(ch); @@ -939,8 +940,8 @@ static int AAH_NAME(ch) } /* Done: Name */ -static int NAME(ch) - int ch; +static int +NAME(int ch) { save_unsafe_ch(ch); ch = next_ch(); @@ -979,8 +980,8 @@ static int NAME(ch) } /* Done: Literal Name */ -static int LITERAL_NAME(ch) - int ch; +static int +LITERAL_NAME(int ch) { if (isNAME(ch)) { save_unsafe_ch(ch); @@ -1017,8 +1018,8 @@ static int LITERAL_NAME(ch) } /* Done: immediate Name */ -static int IMMED_NAME(ch) - int ch; +static int +IMMED_NAME(int ch) { ch = next_ch(); if (isNAME(ch)) { @@ -1056,8 +1057,8 @@ static int IMMED_NAME(ch) } /* Done: Name found while looking for something else */ -static int OOPS_NAME(ch) - int ch; +static int +OOPS_NAME(int ch) { back_ch_not_white(ch); tokenType = TOKEN_NAME; @@ -1070,40 +1071,40 @@ static int OOPS_NAME(ch) */ /* Done: Unmatched Right Angle-Bracket */ -static int RIGHT_ANGLE(ch) - int ch; +static int +RIGHT_ANGLE(int ch) { tokenType = TOKEN_RIGHT_ANGLE; return(DONE); } /* Done: Unmatched Right Parenthesis */ -static int RIGHT_PAREN(ch) - int ch; +static int +RIGHT_PAREN(int ch) { tokenType = TOKEN_RIGHT_PAREN; return(DONE); } /* Done: Left Brace */ -static int LEFT_BRACE(ch) - int ch; +static int +LEFT_BRACE(int ch) { tokenType = TOKEN_LEFT_BRACE; return(DONE); } /* Done: Right Brace */ -static int RIGHT_BRACE(ch) - int ch; +static int +RIGHT_BRACE(int ch) { tokenType = TOKEN_RIGHT_BRACE; return(DONE); } /* Done: Left Bracket */ -static int LEFT_BRACKET(ch) - int ch; +static int +LEFT_BRACKET(int ch) { save_unsafe_ch(ch); tokenType = TOKEN_LEFT_BRACKET; @@ -1111,8 +1112,8 @@ static int LEFT_BRACKET(ch) } /* Done: Right Bracket */ -static int RIGHT_BRACKET(ch) - int ch; +static int +RIGHT_BRACKET(int ch) { save_unsafe_ch(ch); tokenType = TOKEN_RIGHT_BRACKET; @@ -1120,16 +1121,16 @@ static int RIGHT_BRACKET(ch) } /* Done: Break */ -static int BREAK_SIGNAL(ch) - int ch; +static int +BREAK_SIGNAL(int ch) { tokenType = TOKEN_BREAK; return(DONE); } /* Done: No Token Found */ -static int NO_TOKEN(ch) - int ch; +static int +NO_TOKEN(int ch) { tokenType = TOKEN_EOF; return(DONE); @@ -1159,13 +1160,13 @@ static int NO_TOKEN(ch) * * ------------------------------------------------------------------- */ -void scan_token(inputP) - psobj *inputP; +void +scan_token(psobj *inputP) { int ch; unsigned char *stateP = s0; unsigned char entry; - int (*actionP)(); + int (*actionP)(int); /* Define input source */ inputFileP = inputP->data.fileP; |