changeset 1019:1a9bfdd32aa3

rename getc() to getChar() to avoid name clash on FreeBSD
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Tue, 24 Mar 2009 13:50:34 +0100
parents 1949cc16378f
children b991c2d1adef
files src/cssparser.cc src/cssparser.hh
diffstat 2 files changed, 37 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/src/cssparser.cc	Mon Mar 23 12:07:37 2009 +0100
+++ b/src/cssparser.cc	Tue Mar 24 13:50:34 2009 +0100
@@ -374,7 +374,7 @@
 /*
  * Gets the next character from the buffer, or EOF.
  */
-int CssParser::getc()
+int CssParser::getChar()
 {
    int c;
 
@@ -383,16 +383,16 @@
    else
       c = buf[bufptr];
 
-   /* The buffer pointer is increased in any case, so that Css_ungetc works
+   /* The buffer pointer is increased in any case, so that ungetChar works
     * correctly at the end of the buffer. */
    bufptr++;
    return c;
 }
 
 /*
- * Undoes the last Css_getc().
+ * Undoes the last getChar().
  */
-void CssParser::ungetc()
+void CssParser::ungetChar()
 {
    bufptr--;
 }
@@ -406,24 +406,24 @@
    ttype = CSS_TK_CHAR; /* init */
    spaceSeparated = false;
 
-   c = getc();
+   c = getChar();
 
    while (true) {
       if (isspace(c)) { // ignore whitespace
          spaceSeparated = true;
-         c = getc();
+         c = getChar();
       } else if (c == '/') { // ignore comments
-         d = getc();
+         d = getChar();
          if (d == '*') {
-            c = getc();
-            d = getc();
+            c = getChar();
+            d = getChar();
             while (d != EOF && (c != '*' || d != '/')) {
                c = d;
-               d = getc();
+               d = getChar();
             }
-            c = getc();
+            c = getChar();
          } else {
-            ungetc();
+            ungetChar();
             break;
          }
       } else {
@@ -435,7 +435,7 @@
    if (c == '-') {
       if (i < maxStrLen - 1)
          tval[i++] = c;
-      c = getc();
+      c = getChar();
    }
 
    if (isdigit(c)) {
@@ -445,16 +445,16 @@
             tval[i++] = c;
          }
          /* else silently truncated */
-         c = getc();
+         c = getChar();
       } while (isdigit(c));
       if (c != '.')
-         ungetc();
+         ungetChar();
 
       /* ...but keep going to see whether it's really a float */
    }
 
    if (c == '.') {
-      c = getc();
+      c = getChar();
       if (isdigit(c)) {
          ttype = CSS_TK_FLOAT;
          if (i < maxStrLen - 1)
@@ -463,17 +463,17 @@
             if (i < maxStrLen - 1)
                tval[i++] = c;
             /* else silently truncated */
-            c = getc();
+            c = getChar();
          } while (isdigit(c));
 
-         ungetc();
+         ungetChar();
          tval[i] = 0;
          DEBUG_MSG(DEBUG_TOKEN_LEVEL, "token number %s\n", tval);
          return;
       } else {
-         ungetc();
+         ungetChar();
          if (ttype == CSS_TK_DECINT) {
-            ungetc();
+            ungetChar();
          } else {
             c = '.';
          }
@@ -487,9 +487,9 @@
    }
 
    if (i) {
-      ungetc(); /* ungetc '-' */
+      ungetChar(); /* ungetChar '-' */
       i--;
-      c = getc();
+      c = getChar();
    }
 
    if (isalpha(c) || c == '_' || c == '-') {
@@ -497,16 +497,16 @@
 
       tval[0] = c;
       i = 1;
-      c = getc();
+      c = getChar();
       while (isalnum(c) || c == '_' || c == '-') {
          if (i < maxStrLen - 1) {
             tval[i] = c;
             i++;
          }                      /* else silently truncated */
-         c = getc();
+         c = getChar();
       }
       tval[i] = 0;
-      ungetc();
+      ungetChar();
       DEBUG_MSG(DEBUG_TOKEN_LEVEL, "token symbol '%s'\n", tval);
       return;
    }
@@ -516,24 +516,24 @@
       ttype = CSS_TK_STRING;
 
       i = 0;
-      c = getc();
+      c = getChar();
 
       while (c != EOF && c != c1) {
          if (c == '\\') {
-            d = getc();
+            d = getChar();
             if (isxdigit(d)) {
                /* Read hex Unicode char. (Actually, strings are yet only 8
                 * bit.) */
                hexbuf[0] = d;
                j = 1;
-               d = getc();
+               d = getChar();
                while (j < 4 && isxdigit(d)) {
                   hexbuf[j] = d;
                   j++;
-                  d = getc();
+                  d = getChar();
                }
                hexbuf[j] = 0;
-               ungetc();
+               ungetChar();
                c = strtol(hexbuf, NULL, 16);
             } else {
                /* Take character literally. */
@@ -545,10 +545,10 @@
             tval[i] = c;
             i++;
          }                      /* else silently truncated */
-         c = getc();
+         c = getChar();
       }
       tval[i] = 0;
-      /* No Css_ungetc(). */
+      /* No ungetChar(). */
       DEBUG_MSG(DEBUG_TOKEN_LEVEL, "token string '%s'\n", tval);
       return;
    }
@@ -561,16 +561,16 @@
 
       tval[0] = c;
       i = 1;
-      c = getc();
+      c = getChar();
       while (isxdigit(c)) {
          if (i < maxStrLen - 1) {
             tval[i] = c;
             i++;
          }                      /* else silently truncated */
-         c = getc();
+         c = getChar();
       }
       tval[i] = 0;
-      ungetc();
+      ungetChar();
       DEBUG_MSG(DEBUG_TOKEN_LEVEL, "token color '%s'\n", tval);
       return;
    }
--- a/src/cssparser.hh	Mon Mar 23 12:07:37 2009 +0100
+++ b/src/cssparser.hh	Tue Mar 24 13:50:34 2009 +0100
@@ -24,8 +24,8 @@
 
       CssParser(CssContext *context, CssOrigin origin,
                 const char *buf, int buflen);
-      int getc();
-      void ungetc();
+      int getChar();
+      void ungetChar();
       void nextToken();
       bool tokenMatchesProperty(CssPropertyName prop, CssValueType * type);
       bool parseValue(CssPropertyName prop, CssValueType type,