You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2015/07/25 02:06:39 UTC
lucy-clownfish git commit: Fix compiler warnings
Repository: lucy-clownfish
Updated Branches:
refs/heads/master 0ee7bbfdf -> dc56ae32a
Fix compiler warnings
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/dc56ae32
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/dc56ae32
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/dc56ae32
Branch: refs/heads/master
Commit: dc56ae32ace222b20cfce76d1cfd1c39709718e3
Parents: 0ee7bbf
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sat Jul 25 02:03:40 2015 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sat Jul 25 02:03:40 2015 +0200
----------------------------------------------------------------------
compiler/src/CFCC.c | 23 -----
compiler/src/CFCLexHeader.c | 184 ++++++++++++++++---------------------
compiler/src/CFCLexHeader.l | 2 +
compiler/src/CFCParamList.c | 4 +-
compiler/src/CFCParseHeader.y | 16 ++--
compiler/src/CFCPerlMethod.c | 5 -
6 files changed, 92 insertions(+), 142 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/dc56ae32/compiler/src/CFCC.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCC.c b/compiler/src/CFCC.c
index 4b5fb0f..ad7f882 100644
--- a/compiler/src/CFCC.c
+++ b/compiler/src/CFCC.c
@@ -46,9 +46,6 @@ static const CFCMeta CFCC_META = {
(CFCBase_destroy_t)CFCC_destroy
};
-static char*
-S_callback_decs(CFCClass *klass);
-
CFCC*
CFCC_new(CFCHierarchy *hierarchy, const char *header, const char *footer) {
CFCC *self = (CFCC*)CFCBase_allocate(&CFCC_META);
@@ -81,26 +78,6 @@ CFCC_destroy(CFCC *self) {
CFCBase_destroy((CFCBase*)self);
}
-static char*
-S_callback_decs(CFCClass *klass) {
- CFCMethod **fresh_methods = CFCClass_fresh_methods(klass);
- char *cb_decs = CFCUtil_strdup("");
-
- for (int meth_num = 0; fresh_methods[meth_num] != NULL; meth_num++) {
- CFCMethod *method = fresh_methods[meth_num];
-
- // Define callback to NULL.
- if (CFCMethod_novel(method) && !CFCMethod_final(method)) {
- char *override_sym = CFCMethod_full_override_sym(method, klass);
- cb_decs = CFCUtil_cat(cb_decs, "#define ", override_sym, " NULL\n",
- NULL);
- FREEMEM(override_sym);
- }
- }
-
- return cb_decs;
-}
-
void
CFCC_write_html_docs(CFCC *self) {
CFCCHtml_write_html_docs(self->html_gen);
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/dc56ae32/compiler/src/CFCLexHeader.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCLexHeader.c b/compiler/src/CFCLexHeader.c
index 866b79f..be6bfb0 100644
--- a/compiler/src/CFCLexHeader.c
+++ b/compiler/src/CFCLexHeader.c
@@ -1,6 +1,5 @@
-#line 2 "../src/CFCLexHeader.c"
-#line 4 "../src/CFCLexHeader.c"
+#line 3 "<stdout>"
#define YY_INT_ALIGNED short int
@@ -9,7 +8,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -162,7 +161,12 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
-extern int yyleng;
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+extern yy_size_t yyleng;
extern FILE *yyin, *yyout;
@@ -184,6 +188,13 @@ extern FILE *yyin, *yyout;
if ( yytext[yyl] == '\n' )\
--yylineno;\
}while(0)
+ #define YY_LINENO_REWIND_TO(dst) \
+ do {\
+ const char *p;\
+ for ( p = yy_cp-1; p >= (dst); --p)\
+ if ( *p == '\n' )\
+ --yylineno;\
+ }while(0)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
@@ -201,11 +212,6 @@ extern FILE *yyin, *yyout;
#define unput(c) yyunput( c, (yytext_ptr) )
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -223,7 +229,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- int yy_n_chars;
+ yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -293,8 +299,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
-int yyleng;
+static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
+yy_size_t yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
@@ -322,7 +328,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
void *yyalloc (yy_size_t );
void *yyrealloc (void *,yy_size_t );
@@ -354,7 +360,7 @@ void yyfree (void * );
/* Begin user sect3 */
-#define yywrap(n) 1
+#define yywrap() 1
#define YY_SKIP_YYWRAP
typedef unsigned char YY_CHAR;
@@ -624,12 +630,21 @@ char *yytext;
return CFC_TOKENTYPE_IDENTIFIER;
}
}
+#define YY_NO_INPUT 1
-#line 629 "../src/CFCLexHeader.c"
+#line 636 "<stdout>"
#define INITIAL 0
#define CBLOCK 1
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif
@@ -657,7 +672,7 @@ FILE *yyget_out (void );
void yyset_out (FILE * out_str );
-int yyget_leng (void );
+yy_size_t yyget_leng (void );
char *yyget_text (void );
@@ -677,8 +692,6 @@ extern int yywrap (void );
#endif
#endif
- static void yyunput (int c,char *buf_ptr );
-
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@@ -805,10 +818,6 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 99 "../src/CFCLexHeader.l"
-
-#line 811 "../src/CFCLexHeader.c"
-
if ( !(yy_init) )
{
(yy_init) = 1;
@@ -835,6 +844,11 @@ YY_DECL
yy_load_buffer_state( );
}
+ {
+#line 101 "../src/CFCLexHeader.l"
+
+#line 851 "<stdout>"
+
while ( 1 ) /* loops until end-of-file is reached */
{
yy_cp = (yy_c_buf_p);
@@ -851,7 +865,7 @@ YY_DECL
yy_match:
do
{
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
@@ -877,7 +891,7 @@ yy_find_action:
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
- int yyl;
+ yy_size_t yyl;
for ( yyl = 0; yyl < yyleng; ++yyl )
if ( yytext[yyl] == '\n' )
@@ -898,140 +912,140 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 100 "../src/CFCLexHeader.l"
+#line 102 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_SCOPE_OP); }
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 101 "../src/CFCLexHeader.l"
+#line 103 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_ASTERISK); }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 102 "../src/CFCLexHeader.l"
+#line 104 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_LEFT_CURLY_BRACE); }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 103 "../src/CFCLexHeader.l"
+#line 105 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_RIGHT_CURLY_BRACE); }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 104 "../src/CFCLexHeader.l"
+#line 106 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_LEFT_SQUARE_BRACKET); }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 105 "../src/CFCLexHeader.l"
+#line 107 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_RIGHT_SQUARE_BRACKET); }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 106 "../src/CFCLexHeader.l"
+#line 108 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_LEFT_PAREN); }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 107 "../src/CFCLexHeader.l"
+#line 109 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_RIGHT_PAREN); }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 108 "../src/CFCLexHeader.l"
+#line 110 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_ELLIPSIS); }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 109 "../src/CFCLexHeader.l"
+#line 111 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_COMMA); }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 110 "../src/CFCLexHeader.l"
+#line 112 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_SEMICOLON); }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 111 "../src/CFCLexHeader.l"
+#line 113 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_EQUALS); }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 113 "../src/CFCLexHeader.l"
+#line 115 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_HEX_LITERAL); }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 114 "../src/CFCLexHeader.l"
+#line 116 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_FLOAT_LITERAL); }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 115 "../src/CFCLexHeader.l"
+#line 117 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_INTEGER_LITERAL); }
YY_BREAK
case 16:
/* rule 16 can match eol */
YY_RULE_SETUP
-#line 116 "../src/CFCLexHeader.l"
+#line 118 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_STRING_LITERAL); }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 118 "../src/CFCLexHeader.l"
+#line 120 "../src/CFCLexHeader.l"
{ PARSE(S_identifier_or_keyword(yytext)); }
YY_BREAK
case 18:
/* rule 18 can match eol */
YY_RULE_SETUP
-#line 120 "../src/CFCLexHeader.l"
+#line 122 "../src/CFCLexHeader.l"
{ BEGIN(CBLOCK); PARSE(CFC_TOKENTYPE_CBLOCK_START); }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 121 "../src/CFCLexHeader.l"
+#line 123 "../src/CFCLexHeader.l"
{ BEGIN(INITIAL); PARSE(CFC_TOKENTYPE_CBLOCK_CLOSE); }
YY_BREAK
case 20:
/* rule 20 can match eol */
YY_RULE_SETUP
-#line 122 "../src/CFCLexHeader.l"
+#line 124 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_BLOB); }
YY_BREAK
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
-#line 123 "../src/CFCLexHeader.l"
+#line 125 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_BLOB); }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 124 "../src/CFCLexHeader.l"
+#line 126 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_BLOB); }
YY_BREAK
/* Parse docucomments, but skip ordinary comments */
case 23:
/* rule 23 can match eol */
YY_RULE_SETUP
-#line 127 "../src/CFCLexHeader.l"
+#line 129 "../src/CFCLexHeader.l"
{ PARSE(CFC_TOKENTYPE_DOCUCOMMENT); }
YY_BREAK
case 24:
/* rule 24 can match eol */
YY_RULE_SETUP
-#line 128 "../src/CFCLexHeader.l"
+#line 130 "../src/CFCLexHeader.l"
YY_BREAK
case 25:
/* rule 25 can match eol */
YY_RULE_SETUP
-#line 130 "../src/CFCLexHeader.l"
+#line 132 "../src/CFCLexHeader.l"
/* Skip whitespace. */
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 131 "../src/CFCLexHeader.l"
+#line 133 "../src/CFCLexHeader.l"
{
printf("Bad input character '%s' at line %d\n", yytext, yylineno);
yyterminate();
@@ -1039,15 +1053,15 @@ YY_RULE_SETUP
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(CBLOCK):
-#line 135 "../src/CFCLexHeader.l"
+#line 137 "../src/CFCLexHeader.l"
{ yyterminate(); }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 136 "../src/CFCLexHeader.l"
+#line 138 "../src/CFCLexHeader.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 1051 "../src/CFCLexHeader.c"
+#line 1065 "<stdout>"
case YY_END_OF_BUFFER:
{
@@ -1177,6 +1191,7 @@ YY_FATAL_ERROR( "flex scanner jammed" );
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
+ } /* end of user's declarations */
} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
@@ -1232,21 +1247,21 @@ static int yy_get_next_buffer (void)
else
{
- int num_to_read =
+ yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
- int new_size = b->yy_buf_size * 2;
+ yy_size_t new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@@ -1277,7 +1292,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
+ (yy_n_chars), num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
@@ -1372,48 +1387,7 @@ static int yy_get_next_buffer (void)
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 75);
- return yy_is_jam ? 0 : yy_current_state;
-}
-
- static void yyunput (int c, register char * yy_bp )
-{
- register char *yy_cp;
-
- yy_cp = (yy_c_buf_p);
-
- /* undo effects of setting up yytext */
- *yy_cp = (yy_hold_char);
-
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register int number_to_move = (yy_n_chars) + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
- while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- *--yy_cp = (char) c;
-
- if ( c == '\n' ){
- --yylineno;
- }
-
- (yytext_ptr) = yy_bp;
- (yy_hold_char) = *yy_cp;
- (yy_c_buf_p) = yy_cp;
+ return yy_is_jam ? 0 : yy_current_state;
}
#ifndef YY_NO_INPUT
@@ -1440,7 +1414,7 @@ static int yy_get_next_buffer (void)
else
{ /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
+ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
@@ -1717,7 +1691,7 @@ void yypop_buffer_state (void)
*/
static void yyensure_buffer_stack (void)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) {
@@ -1814,12 +1788,12 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
*
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
+YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- int i;
+ yy_size_t i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
@@ -1901,7 +1875,7 @@ FILE *yyget_out (void)
/** Get the length of the current token.
*
*/
-int yyget_leng (void)
+yy_size_t yyget_leng (void)
{
return yyleng;
}
@@ -2052,7 +2026,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 136 "../src/CFCLexHeader.l"
+#line 137 "../src/CFCLexHeader.l"
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/dc56ae32/compiler/src/CFCLexHeader.l
----------------------------------------------------------------------
diff --git a/compiler/src/CFCLexHeader.l b/compiler/src/CFCLexHeader.l
index d14c3ac..f325563 100644
--- a/compiler/src/CFCLexHeader.l
+++ b/compiler/src/CFCLexHeader.l
@@ -91,6 +91,8 @@
%option noyywrap
%option nodefault
+%option noinput
+%option nounput
%option yylineno
%option never-interactive
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/dc56ae32/compiler/src/CFCParamList.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCParamList.c b/compiler/src/CFCParamList.c
index 30998d5..190dd97 100644
--- a/compiler/src/CFCParamList.c
+++ b/compiler/src/CFCParamList.c
@@ -178,7 +178,7 @@ CFCParamList_name_list(CFCParamList *self) {
const char*
CFCParamList_param_name(CFCParamList *self, int tick) {
- if (tick >= self->num_vars) {
+ if ((size_t)tick >= self->num_vars) {
CFCUtil_die("No var at position %d for ParamList (%s)", tick,
CFCParamList_to_c(self));
}
@@ -187,7 +187,7 @@ CFCParamList_param_name(CFCParamList *self, int tick) {
CFCType*
CFCParamList_param_type(CFCParamList *self, int tick) {
- if (tick >= self->num_vars) {
+ if ((size_t)tick >= self->num_vars) {
CFCUtil_die("No var at position %d for ParamList (%s)", tick,
CFCParamList_to_c(self));
}
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/dc56ae32/compiler/src/CFCParseHeader.y
----------------------------------------------------------------------
diff --git a/compiler/src/CFCParseHeader.y b/compiler/src/CFCParseHeader.y
index 61d7ae1..2b760f0 100644
--- a/compiler/src/CFCParseHeader.y
+++ b/compiler/src/CFCParseHeader.y
@@ -60,8 +60,7 @@ S_start_class(CFCParser *state, CFCDocuComment *docucomment, char *exposure,
}
static CFCVariable*
-S_new_var(CFCParser *state, char *exposure, char *modifiers, CFCType *type,
- char *name) {
+S_new_var(char *exposure, char *modifiers, CFCType *type, char *name) {
int inert = false;
if (modifiers) {
if (strcmp(modifiers, "inert") != 0) {
@@ -235,7 +234,10 @@ S_new_type(CFCParser *state, int flags, char *type_name,
%type type_qualifier {int}
%type type_qualifier_list {int}
-%destructor result { CFCBase_decref((CFCBase*)$$); }
+%destructor result {
+ (void)state; /* Suppress unused variable warning. */
+ CFCBase_decref((CFCBase*)$$);
+}
%destructor file { CFCBase_decref((CFCBase*)$$); }
%destructor major_block { CFCBase_decref((CFCBase*)$$); }
%destructor parcel_definition { CFCBase_decref((CFCBase*)$$); }
@@ -401,20 +403,20 @@ class_defs(A) ::= class_defs(B) subroutine_declaration_statement(C).
var_declaration_statement(A) ::=
type(D) declarator(E) SEMICOLON.
{
- A = S_new_var(state, CFCParser_dupe(state, "private"), NULL, D, E);
+ A = S_new_var(CFCParser_dupe(state, "private"), NULL, D, E);
}
var_declaration_statement(A) ::=
declaration_modifier_list(C)
type(D) declarator(E) SEMICOLON.
{
- A = S_new_var(state, CFCParser_dupe(state, "parcel"), C, D, E);
+ A = S_new_var(CFCParser_dupe(state, "parcel"), C, D, E);
}
var_declaration_statement(A) ::=
exposure_specifier(B)
declaration_modifier_list(C)
type(D) declarator(E) SEMICOLON.
{
- A = S_new_var(state, B, C, D, E);
+ A = S_new_var(B, C, D, E);
}
subroutine_declaration_statement(A) ::=
@@ -573,7 +575,7 @@ declarator(A) ::= IDENTIFIER(B).
param_variable(A) ::= type(B) declarator(C).
{
- A = S_new_var(state, NULL, NULL, B, C);
+ A = S_new_var(NULL, NULL, B, C);
}
param_list(A) ::= LEFT_PAREN RIGHT_PAREN.
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/dc56ae32/compiler/src/CFCPerlMethod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerlMethod.c b/compiler/src/CFCPerlMethod.c
index afe34c0..01db539 100644
--- a/compiler/src/CFCPerlMethod.c
+++ b/compiler/src/CFCPerlMethod.c
@@ -232,9 +232,7 @@ S_xsub_def_labeled_params(CFCPerlMethod *self, CFCClass *klass) {
CFCParamList *param_list = self->sub.param_list;
CFCVariable **arg_vars = CFCParamList_get_variables(param_list);
CFCVariable *self_var = arg_vars[0];
- CFCType *self_type = CFCVariable_get_type(self_var);
CFCType *return_type = CFCMethod_get_return_type(method);
- const char *self_type_c = CFCType_to_c(self_type);
const char *self_name = CFCVariable_get_name(self_var);
char *arg_decls = CFCPerlSub_arg_declarations((CFCPerlSub*)self, 0);
char *meth_type_c = CFCMethod_full_typedef(method, klass);
@@ -290,10 +288,7 @@ S_xsub_def_positional_args(CFCPerlMethod *self, CFCClass *klass) {
CFCMethod *method = self->method;
CFCParamList *param_list = CFCMethod_get_param_list(method);
CFCVariable **arg_vars = CFCParamList_get_variables(param_list);
- CFCVariable *self_var = arg_vars[0];
- CFCType *self_type = CFCVariable_get_type(self_var);
CFCType *return_type = CFCMethod_get_return_type(method);
- const char *self_type_c = CFCType_to_c(self_type);
const char **arg_inits = CFCParamList_get_initial_values(param_list);
unsigned num_vars = (unsigned)CFCParamList_num_vars(param_list);
char *arg_decls = CFCPerlSub_arg_declarations((CFCPerlSub*)self, 0);