From c56ff4f393b978c52b0d3a4896b9ca4a06f47bb4 Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 4 Jun 2015 11:00:54 +0000 Subject: [PATCH] - config-lexer.c:ccomment(): cleaned up style issues git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@6042 82007160-df01-0410-b94d-b575c5fd34c7 --- src/config-lexer.l | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/src/config-lexer.l b/src/config-lexer.l index b333e60..2dbb210 100644 --- a/src/config-lexer.l +++ b/src/config-lexer.l @@ -253,33 +253,39 @@ OFF { /* C-comment ignoring routine -kre*/ -void ccomment(void) +void +ccomment(void) { - int c; + int c = 0; /* log(L_NOTICE, "got comment"); */ while (1) { - while ((c = input()) != '*' && c != EOF) - if (c == '\n') ++linenum; - if (c == '*') - { - while ((c = input()) == '*'); - if (c == '/') break; - else if (c == '\n') - ++linenum; - } + while ((c = input()) != '*' && c != EOF) + if (c == '\n') + ++linenum; + + if (c == '*') + { + while ((c = input()) == '*') + /* Nothing */ ; + if (c == '/') + break; + else if (c == '\n') + ++linenum; + } + if (c == EOF) { - YY_FATAL_ERROR("EOF in comment"); - /* XXX hack alert this disables - * the stupid unused function warning - * gcc generates - */ - if(1 == 0) - yy_fatal_error("EOF in comment"); - break; + YY_FATAL_ERROR("EOF in comment"); + + /* XXX hack alert this disables + * the stupid unused function warning + * gcc generates + */ + if (1 == 0) + yy_fatal_error("EOF in comment"); + break; } } } - -- 2.30.2