diff --git a/lib/conf-lex.l b/lib/conf-lex.l index fdbd2360..02c7447b 100644 --- a/lib/conf-lex.l +++ b/lib/conf-lex.l @@ -1,7 +1,7 @@ %{ /* conf-lex.l - Part of libsensors, a Linux library for reading sensor data. - Copyright (c) 1998, 1999 Frodo Looijaard + Copyright (c) 1998, 1999 Frodo Looijaard This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -245,7 +245,7 @@ ignore{BLANK}* { if (! sensors_yylval.name) sensors_fatal_error("conf-lex.l", "Allocating a new string"); - + return NAME; } @@ -296,7 +296,7 @@ ignore{BLANK}* { BEGIN(ERR); return ERROR; } - + \" { buffer_add_char("\0"); sensors_yylval.name = strdup(buffer); diff --git a/lib/conf-parse.y b/lib/conf-parse.y index 1937f544..af2e4fdb 100644 --- a/lib/conf-parse.y +++ b/lib/conf-parse.y @@ -85,7 +85,7 @@ static sensors_chip *current_chip = NULL; sensors_bus_id bus; sensors_chip_name chip; sensors_config_line line; -} +} %left '-' '+' %left '*' '/' @@ -211,13 +211,13 @@ chip_statement: CHIP chip_name_list new_el.ignores_count = new_el.ignores_max = 0; new_el.chips = $2; chip_add_el(&new_el); - current_chip = sensors_config_chips + + current_chip = sensors_config_chips + sensors_config_chips_count - 1; } ; chip_name_list: chip_name - { + { $$.fits = NULL; $$.fits_count = $$.fits_max = 0; fits_add_el(&$1,$$); @@ -227,14 +227,14 @@ chip_name_list: chip_name fits_add_el(&$2,$$); } ; - -expression: FLOAT - { $$ = malloc_expr(); - $$->data.val = $1; + +expression: FLOAT + { $$ = malloc_expr(); + $$->data.val = $1; $$->kind = sensors_kind_val; } | NAME - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->data.var = $1; $$->kind = sensors_kind_var; } @@ -243,35 +243,35 @@ expression: FLOAT $$->kind = sensors_kind_source; } | expression '+' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_add; $$->data.subexpr.sub1 = $1; $$->data.subexpr.sub2 = $3; } | expression '-' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_sub; $$->data.subexpr.sub1 = $1; $$->data.subexpr.sub2 = $3; } | expression '*' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_multiply; $$->data.subexpr.sub1 = $1; $$->data.subexpr.sub2 = $3; } | expression '/' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_divide; $$->data.subexpr.sub1 = $1; $$->data.subexpr.sub2 = $3; } | '-' expression %prec NEG - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_negate; $$->data.subexpr.sub1 = $2; @@ -280,14 +280,14 @@ expression: FLOAT | '(' expression ')' { $$ = $2; } | '^' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_exp; $$->data.subexpr.sub1 = $2; $$->data.subexpr.sub2 = NULL; } | '`' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_log; $$->data.subexpr.sub1 = $2; @@ -318,7 +318,7 @@ string: NAME ; chip_name: NAME - { int res = sensors_parse_chip_name($1,&$$); + { int res = sensors_parse_chip_name($1,&$$); free($1); if (res) { sensors_yyerror("Parse error in chip name");