summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-01-09 15:43:18 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-01-09 15:43:18 +0100
commite5cc0021654fde80e19c419242b64f2f88ac75d9 (patch)
treef0795e0282076f74c2105c03486e3025314d454a /hwpfilter
parent9c5494bfd781a32882b1cdfa2ab8645df960d85b (diff)
New loplugin:externvar: hwpfilter
Change-Id: I275d67b2878400cd0774f21b1a7489a0dd392e82
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/fontmap.cxx2
-rw-r--r--hwpfilter/source/formula.cxx3
-rw-r--r--hwpfilter/source/grammar.cxx16
-rw-r--r--hwpfilter/source/lexer.cxx10
-rw-r--r--hwpfilter/source/nodes.h5
5 files changed, 15 insertions, 21 deletions
diff --git a/hwpfilter/source/fontmap.cxx b/hwpfilter/source/fontmap.cxx
index 8de154283ba1..7207e75aad91 100644
--- a/hwpfilter/source/fontmap.cxx
+++ b/hwpfilter/source/fontmap.cxx
@@ -126,7 +126,7 @@ const char* RepFontTab[] =
"\xb1\xc3\xbc\xad" /* 3 */
};
#elif defined(LINUX)
-const char* RepFontTab[] =
+const char* const RepFontTab[] =
{
"\xb9\xe9\xb9\xac \xb9\xd9\xc5\xc1", /* 0 */
"\xb9\xe9\xb9\xac \xb5\xb8\xbf\xf2", /* 1 */
diff --git a/hwpfilter/source/formula.cxx b/hwpfilter/source/formula.cxx
index 941922845080..8b6ce28a94a5 100644
--- a/hwpfilter/source/formula.cxx
+++ b/hwpfilter/source/formula.cxx
@@ -25,9 +25,6 @@
#include "mapping.h"
#include "hwpeq.h"
#include <iostream>
-#include <list>
-
-extern std::list<Node*> nodelist;
#ifndef DEBUG
diff --git a/hwpfilter/source/grammar.cxx b/hwpfilter/source/grammar.cxx
index 80d2d175a6e9..a3ce4d3a8253 100644
--- a/hwpfilter/source/grammar.cxx
+++ b/hwpfilter/source/grammar.cxx
@@ -36,11 +36,15 @@
#include "lexer.hxx"
#include "nodes.h"
+extern "C" {
+#include "grammar.h"
+}
+
std::list<Node*> nodelist;
void yyerror(const char *);
-Node *top=nullptr;
+static Node *top=nullptr;
int Node::count = 0;
@@ -50,12 +54,6 @@ int Node::count = 0;
int debug(const char *format, ...);
#endif
-
-typedef union {
- char *dval;
- char *str;
- Node *ptr;
-} YYSTYPE;
#include <stdio.h>
#define YYFINAL 102
@@ -389,7 +387,7 @@ static const short yycheck[] = { 11,
#ifndef YYPURE
-int yychar; /* the lookahead symbol */
+static int yychar; /* the lookahead symbol */
YYSTYPE yylval; /* the semantic value of the */
/* lookahead symbol */
@@ -398,7 +396,7 @@ YYLTYPE yylloc; /* location data for the lookahead */
/* symbol */
#endif
-int yynerrs; /* number of parse errors so far */
+static int yynerrs; /* number of parse errors so far */
#endif /* not YYPURE */
#if YYDEBUG != 0
diff --git a/hwpfilter/source/lexer.cxx b/hwpfilter/source/lexer.cxx
index 0c52851d26dc..915b7b094107 100644
--- a/hwpfilter/source/lexer.cxx
+++ b/hwpfilter/source/lexer.cxx
@@ -91,9 +91,6 @@
typedef struct yy_buffer_state *YY_BUFFER_STATE;
-extern int yyleng;
-extern FILE *yyin, *yyout;
-
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
@@ -179,7 +176,7 @@ static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
-int yyleng;
+static int yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = nullptr;
@@ -209,9 +206,8 @@ static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
static void yy_flex_free YY_PROTO(( void * ));
typedef unsigned char YY_CHAR;
-FILE *yyin = nullptr, *yyout = nullptr;
+static FILE *yyin = nullptr, *yyout = nullptr;
typedef int yy_state_type;
-extern char *yytext;
#define yytext_ptr yytext
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
@@ -933,7 +929,7 @@ static char *yy_last_accepting_cpos;
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+static char *yytext;
#define INITIAL 0
#include <stdlib.h>
#include <string.h>
diff --git a/hwpfilter/source/nodes.h b/hwpfilter/source/nodes.h
index 60626c530d6c..01fc85fad7ef 100644
--- a/hwpfilter/source/nodes.h
+++ b/hwpfilter/source/nodes.h
@@ -20,6 +20,9 @@
#ifndef INCLUDED_HWPFILTER_SOURCE_NODES_H
#define INCLUDED_HWPFILTER_SOURCE_NODES_H
+#include <sal/config.h>
+
+#include <list>
#include <stdio.h>
#include <stdlib.h>
#include <osl/diagnose.h>
@@ -92,7 +95,7 @@ public:
Node *next;
};
-//static LinkedList<Node> nodelist;
+extern std::list<Node *> nodelist;
#endif