Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
SECTION:
tokenType = SECTION;
- return 1;
+ return EXIT_SUCCESS;
SSECTION:
tokenType = SSECTION;
- return 1;
+ return EXIT_SUCCESS;
M1:
if (istAlpha()) {
NPARA:
tokenType = NPARA;
- return 1;
+ return EXIT_SUCCESS;
MOT:
tokenType = MOT;
- return 1;
+ return EXIT_SUCCESS;
MC2:
if (isSeparator() || c == WEOF) {
MOTCLE:
tokenType = MOTCLE;
- return 1;
+ return EXIT_SUCCESS;
FIN:
tokenType = FIN;
- return 1;
+ return EXIT_SUCCESS;
error:
tokenType = FIN;
- return -1;
+ return EXIT_FAILURE;
}
int main() {
c = fgetwc(source); // lecture du premier caractere
do {
int scanrt = scanner();
- if (scanrt == -1) {
+ if (scanrt == EXIT_FAILURE) {
wprintf(L"Scanner error with token value: %ls\n", token[tokenFound].value);
exit(EXIT_FAILURE);
}
if (source != NULL) fclose(source); // fermeture du fichier source
if (target != NULL) fclose(target); // fermeture du fichier target
- return 0;
+ return EXIT_SUCCESS;
}