X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Flexer%2Fformat-parser.c;h=7e0caf3e1b30d19713264a722fd56a7532ec3864;hb=d2a96ae99e49b5264ca68ace469e20fa5e2e605b;hp=b05a5926cd4a19e204f525e6e303c8cdbee1fa6e;hpb=3816248a008a4af75aac6319d0c9929cb7ff679e;p=pspp diff --git a/src/language/lexer/format-parser.c b/src/language/lexer/format-parser.c index b05a5926cd..7e0caf3e1b 100644 --- a/src/language/lexer/format-parser.c +++ b/src/language/lexer/format-parser.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. - Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -48,7 +47,7 @@ missing, *WIDTH or *DECIMALS or both will be set to 0. */ bool parse_abstract_format_specifier (struct lexer *lexer, char type[FMT_TYPE_LEN_MAX + 1], - int *width, int *decimals) + int *width, int *decimals) { struct substring s; struct substring type_ss, width_ss, decimals_ss; @@ -61,7 +60,7 @@ parse_abstract_format_specifier (struct lexer *lexer, char type[FMT_TYPE_LEN_MAX s = ds_ss (lex_tokstr (lexer)); ss_get_chars (&s, ss_span (s, ss_cstr (CC_LETTERS)), &type_ss); ss_get_chars (&s, ss_span (s, ss_cstr (CC_DIGITS)), &width_ss); - if (ss_match_char (&s, '.')) + if (ss_match_char (&s, '.')) { has_decimals = true; ss_get_chars (&s, ss_span (s, ss_cstr (CC_DIGITS)), &decimals_ss); @@ -111,16 +110,16 @@ parse_format_specifier (struct lexer *lexer, struct fmt_spec *format) msg (SE, _("Unknown format type \"%s\"."), type); return false; } - + return true; } /* Parses a token containing just the name of a format type and returns true if successful. */ bool -parse_format_specifier_name (struct lexer *lexer, enum fmt_type *type) +parse_format_specifier_name (struct lexer *lexer, enum fmt_type *type) { - if (lex_token (lexer) != T_ID) + if (lex_token (lexer) != T_ID) { lex_error (lexer, _("expecting format type")); return false;