X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fget-data.c;h=66dd19f2397d7636228f2069eea4406eb07945ae;hb=0fc606c52d7cec253af9b7463b15baabfbc9a33a;hp=dff449851bd91ff8a5bc3b3b18a26b196242f603;hpb=5e328ed3392221e6c201a60e6d4e6638fe7f32de;p=pspp diff --git a/src/language/data-io/get-data.c b/src/language/data-io/get-data.c index dff449851b..66dd19f239 100644 --- a/src/language/data-io/get-data.c +++ b/src/language/data-io/get-data.c @@ -98,9 +98,9 @@ cmd_get_data (struct lexer *lexer, struct dataset *ds) goto error; struct spreadsheet *spreadsheet = NULL; - if ( 0 == strncasecmp (tok, "GNM", 3)) + if (0 == strncasecmp (tok, "GNM", 3)) spreadsheet = gnumeric_probe (filename, true); - else if ( 0 == strncasecmp (tok, "ODS", 3)) + else if (0 == strncasecmp (tok, "ODS", 3)) spreadsheet = ods_probe (filename, true); if (spreadsheet == NULL) @@ -159,9 +159,9 @@ parse_get_psql (struct lexer *lexer, struct dataset *ds) lex_get (lexer); - while (lex_match (lexer, T_SLASH) ) + while (lex_match (lexer, T_SLASH)) { - if ( lex_match_id (lexer, "ASSUMEDSTRWIDTH")) + if (lex_match_id (lexer, "ASSUMEDSTRWIDTH")) { lex_match (lexer, T_EQUALS); if (lex_force_int (lexer)) @@ -170,7 +170,7 @@ parse_get_psql (struct lexer *lexer, struct dataset *ds) lex_get (lexer); } } - else if ( lex_match_id (lexer, "BSIZE")) + else if (lex_match_id (lexer, "BSIZE")) { lex_match (lexer, T_EQUALS); if (lex_force_int (lexer)) @@ -179,14 +179,14 @@ parse_get_psql (struct lexer *lexer, struct dataset *ds) lex_get (lexer); } } - else if ( lex_match_id (lexer, "UNENCRYPTED")) + else if (lex_match_id (lexer, "UNENCRYPTED")) { psql.allow_clear = true; } else if (lex_match_id (lexer, "SQL")) { lex_match (lexer, T_EQUALS); - if ( ! lex_force_string (lexer) ) + if (! lex_force_string (lexer)) goto error; ds_put_substring (&psql.sql, lex_tokss (lexer)); @@ -197,7 +197,7 @@ parse_get_psql (struct lexer *lexer, struct dataset *ds) struct dictionary *dict = NULL; struct casereader *reader = psql_open_reader (&psql, &dict); - if ( reader ) + if (reader) { dataset_set_dict (ds, dict); dataset_set_source (ds, reader); @@ -243,9 +243,9 @@ parse_spreadsheet (struct lexer *lexer, char **filename, lex_get (lexer); - while (lex_match (lexer, T_SLASH) ) + while (lex_match (lexer, T_SLASH)) { - if ( lex_match_id (lexer, "ASSUMEDSTRWIDTH")) + if (lex_match_id (lexer, "ASSUMEDSTRWIDTH")) { lex_match (lexer, T_EQUALS); if (lex_force_int (lexer)) @@ -259,7 +259,7 @@ parse_spreadsheet (struct lexer *lexer, char **filename, lex_match (lexer, T_EQUALS); if (lex_match_id (lexer, "NAME")) { - if ( ! lex_force_string (lexer) ) + if (! lex_force_string (lexer)) goto error; opts->sheet_name = ss_xstrdup (lex_tokss (lexer)); @@ -297,7 +297,7 @@ parse_spreadsheet (struct lexer *lexer, char **filename, } else if (lex_match_id (lexer, "RANGE")) { - if ( ! lex_force_string (lexer) ) + if (! lex_force_string (lexer)) goto error; opts->cell_range = ss_xstrdup (lex_tokss (lexer)); @@ -314,7 +314,7 @@ parse_spreadsheet (struct lexer *lexer, char **filename, { lex_match (lexer, T_EQUALS); - if ( lex_match_id (lexer, "ON")) + if (lex_match_id (lexer, "ON")) { opts->read_names = true; } @@ -425,7 +425,7 @@ parse_get_txt (struct lexer *lexer, struct dataset *ds) DP_DELIMITED, &has_type); else { - lex_error_expecting (lexer, "FIXED", "DELIMITED", NULL_SENTINEL); + lex_error_expecting (lexer, "FIXED", "DELIMITED"); goto error; } if (!ok) @@ -463,7 +463,7 @@ parse_get_txt (struct lexer *lexer, struct dataset *ds) } else { - lex_error_expecting (lexer, "LINE", "VARIABLES", NULL_SENTINEL); + lex_error_expecting (lexer, "LINE", "VARIABLES"); goto error; } } @@ -560,7 +560,7 @@ parse_get_txt (struct lexer *lexer, struct dataset *ds) break; else { - lex_error_expecting (lexer, "VARIABLES", NULL_SENTINEL); + lex_error_expecting (lexer, "VARIABLES"); goto error; } } @@ -686,7 +686,7 @@ parse_get_txt (struct lexer *lexer, struct dataset *ds) error: data_parser_destroy (parser); - dict_destroy (dict); + dict_unref (dict); fh_unref (fh); free (name); free (encoding);