From 0001b62478ba047d2c942e2bb0712e6b48693ab9 Mon Sep 17 00:00:00 2001 From: ketmar Date: Thu, 23 Aug 2012 23:54:33 +0000 Subject: [PATCH] urasm: cosmetix FossilOrigin-Name: 91cbf104baccbb9c4f5b04cda030e7a074446aab8599465d50de523175c24f46 --- src/urasm.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/urasm.c b/src/urasm.c index 0d85948..e4ca299 100644 --- a/src/urasm.c +++ b/src/urasm.c @@ -724,6 +724,12 @@ static inline char *strSkipSpaces (char *s) { } +static inline char *strSkipSpacesColons (char *s) { + while (*s && (isspace(*s) || *s == ':')) ++s; + return s; +} + + static int32_t getExprArg (int *defined) { int error = 0; char *a = strSkipSpaces(curLine); @@ -827,11 +833,11 @@ static int skipComma (void) { } +// ??? static void skipInstruction (void) { char *str = curLine; - int cnt; // - for (cnt = 1; cnt > 0; --cnt) { + for (int cnt = 1; cnt > 0; --cnt) { while (*str && isspace(*str)) ++str; // skip spaces while (*str && !isspace(*str)) ++str; // skip non-spaces while (*str && isspace(*str)) ++str; // skip spaces @@ -846,17 +852,15 @@ static void skipInstruction (void) { // label processor // static MAYBE_UNUSED void removeSpacesAndColons (void) { - char *ep = curLine; + char *ep = strSkipSpacesColons(curLine); // - while (*ep && (isspace(*ep) || *ep == ':')) ++ep; memmove(curLine, ep, strlen(ep)+1); } static void checkExprEnd (void) { - char *ep = curLine; + char *ep = strSkipSpaces(curLine); // - while (*ep && isspace(*ep)) ++ep; memmove(curLine, ep, strlen(ep)+1); if (curLine[0] && curLine[0] != ':') fatal("end of expression expected"); } @@ -868,7 +872,7 @@ static void removeLabel (void) { // if (ep[0] && !isspace(ep[0])) for (ep = curLine; *ep && !isspace(*ep) && *ep != ':'; ++ep) ; // skip text // skip spaces and colons - while (*ep && (isspace(*ep) || *ep == ':')) ++ep; + ep = strSkipSpacesColons(ep); memmove(curLine, ep, strlen(ep)+1); } -- 2.11.4.GIT