]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/comp_scan.c
ncurses 6.0 - patch 20170212
[ncurses.git] / ncurses / tinfo / comp_scan.c
index dea8259100a13f24939e9698160095cd7a37b057..36674c4bb6b6e4555215bdb1afdcad3b56a12fed 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -50,7 +50,7 @@
 #include <ctype.h>
 #include <tic.h>
 
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: comp_scan.c,v 1.99 2012/04/01 20:37:08 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.103 2016/05/28 23:22:52 tom Exp $")
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
@@ -189,12 +189,11 @@ next_char(void)
         * quite hard to get completely right.  Try it and see.  If you
         * succeed, don't forget to hack push_back() correspondingly.
         */
         * quite hard to get completely right.  Try it and see.  If you
         * succeed, don't forget to hack push_back() correspondingly.
         */
-       size_t used;
        size_t len;
 
        do {
        size_t len;
 
        do {
+           size_t used = 0;
            bufstart = 0;
            bufstart = 0;
-           used = 0;
            do {
                if (used + (LEXBUFSIZ / 4) >= allocated) {
                    allocated += (allocated + LEXBUFSIZ);
            do {
                if (used + (LEXBUFSIZ / 4) >= allocated) {
                    allocated += (allocated + LEXBUFSIZ);
@@ -380,7 +379,7 @@ _nc_get_token(bool silent)
 
     if (end_of_stream()) {
        yyin = 0;
 
     if (end_of_stream()) {
        yyin = 0;
-       next_char();            /* frees its allocated memory */
+       (void) next_char();     /* frees its allocated memory */
        if (tok_buf != 0) {
            if (_nc_curr_token.tk_name == tok_buf)
                _nc_curr_token.tk_name = 0;
        if (tok_buf != 0) {
            if (_nc_curr_token.tk_name == tok_buf)
                _nc_curr_token.tk_name = 0;
@@ -432,7 +431,7 @@ _nc_get_token(bool silent)
 #if NCURSES_EXT_FUNCS
            && !(ch == '.' && _nc_disable_period)
 #endif
 #if NCURSES_EXT_FUNCS
            && !(ch == '.' && _nc_disable_period)
 #endif
-           && !strchr(terminfo_punct, (char) ch)) {
+           && ((strchr) (terminfo_punct, (char) ch) == 0)) {
            if (!silent)
                _nc_warning("Illegal character (expected alphanumeric or %s) - '%s'",
                            terminfo_punct, unctrl(UChar(ch)));
            if (!silent)
                _nc_warning("Illegal character (expected alphanumeric or %s) - '%s'",
                            terminfo_punct, unctrl(UChar(ch)));
@@ -530,7 +529,7 @@ _nc_get_token(bool silent)
                                                   _nc_get_hash_table(FALSE))) {
                                    capability = TRUE;
                                }
                                                   _nc_get_hash_table(FALSE))) {
                                    capability = TRUE;
                                }
-                               *s = c0;
+                               *s = (char) c0;
                            }
                        }
                        if (capability) {
                            }
                        }
                        if (capability) {
@@ -990,10 +989,8 @@ _nc_push_token(int tokclass)
 NCURSES_EXPORT(void)
 _nc_panic_mode(char ch)
 {
 NCURSES_EXPORT(void)
 _nc_panic_mode(char ch)
 {
-    int c;
-
     for (;;) {
     for (;;) {
-       c = next_char();
+       int c = next_char();
        if (c == ch)
            return;
        if (c == EOF)
        if (c == ch)
            return;
        if (c == EOF)