From beaef4a2ea9fa1d73eb624af8931ce02c21303cf Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Fri, 30 Oct 2009 11:29:43 +0300 Subject: [PATCH] stdscan.c: use TOKEN_EOS and string helpers Also tab/space cleanup Signed-off-by: Cyrill Gorcunov --- stdscan.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/stdscan.c b/stdscan.c index 33ebcf75..b7d80009 100644 --- a/stdscan.c +++ b/stdscan.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- * - * + * * Copyright 1996-2009 The NASM Authors - All Rights Reserved * See the file AUTHORS included with the NASM distribution for * the specific copyright holders. @@ -14,7 +14,7 @@ * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF @@ -111,10 +111,9 @@ int stdscan(void *private_data, struct tokenval *tv) (void)private_data; /* Don't warn that this parameter is unused */ - while (nasm_isspace(*stdscan_bufptr)) - stdscan_bufptr++; + stdscan_bufptr = nasm_skip_spaces(stdscan_bufptr); if (!*stdscan_bufptr) - return tv->t_type = 0; + return tv->t_type = TOKEN_EOS; /* we have a token; either an id, a number or a char */ if (isidstart(*stdscan_bufptr) || @@ -231,7 +230,7 @@ int stdscan(void *private_data, struct tokenval *tv) return tv->t_type = TOKEN_STR; } else if (*stdscan_bufptr == ';') { /* a comment has happened - stay */ - return tv->t_type = 0; + return tv->t_type = TOKEN_EOS; } else if (stdscan_bufptr[0] == '>' && stdscan_bufptr[1] == '>') { stdscan_bufptr += 2; return tv->t_type = TOKEN_SHR; -- 2.11.4.GIT