* lexer.l,config_gram.y,config.[hc]: changed reading of numbers to integers except of default_bitclock which is the only real number.

No signs are allowed as negative values do not make sense for current config values.
* buspirate.c: include own header file buspirate.h
* doc/.cvsignore: add programmers.texi to ignore list

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1105 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Rene Liebscher
2012-11-04 17:18:59 +00:00
parent dd3ce5f0e1
commit 673f43f37d
8 changed files with 67 additions and 18 deletions

View File

@@ -122,7 +122,7 @@ void free_token(TOKEN * tkn)
tkn->value.string = NULL;
break;
}
free(tkn);
}
}
@@ -149,15 +149,29 @@ TOKEN * number(char * text)
tkn = new_token(TKN_NUMBER);
tkn->value.type = V_NUM;
tkn->value.number = atof(text);
tkn->value.number = atoi(text);
#if DEBUG
fprintf(stderr, "NUMBER(%g)\n", tkn->value.number);
fprintf(stderr, "NUMBER(%d)\n", tkn->value.number);
#endif
return tkn;
}
TOKEN * number_real(char * text)
{
struct token_t * tkn;
tkn = new_token(TKN_NUMBER);
tkn->value.type = V_NUM_REAL;
tkn->value.number_real = atof(text);
#if DEBUG
fprintf(stderr, "NUMBER(%g)\n", tkn->value.number_real);
#endif
return tkn;
}
TOKEN * hexnumber(char * text)
{
@@ -223,16 +237,20 @@ void print_token(TOKEN * tkn)
fprintf(stderr, "token = %d = ", tkn->primary);
switch (tkn->value.type) {
case V_NUM:
fprintf(stderr, "NUMBER, value=%g", tkn->value.number);
case V_NUM:
fprintf(stderr, "NUMBER, value=%d", tkn->value.number);
break;
case V_STR:
fprintf(stderr, "STRING, value=%s", tkn->value.string);
case V_NUM_REAL:
fprintf(stderr, "NUMBER, value=%g", tkn->value.number_real);
break;
default:
fprintf(stderr, "<other>");
case V_STR:
fprintf(stderr, "STRING, value=%s", tkn->value.string);
break;
default:
fprintf(stderr, "<other>");
break;
}