You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/05/03 18:27:03 UTC
[lucy-commits] svn commit: r1099115 -
/incubator/lucy/trunk/perl/xs/Lucy/Analysis/RegexTokenizer.c
Author: marvin
Date: Tue May 3 16:27:03 2011
New Revision: 1099115
URL: http://svn.apache.org/viewvc?rev=1099115&view=rev
Log:
C99-ify declarations.
Change declarations to take advantage of C99 and avoid a compiler warning
about an unused var.
Modified:
incubator/lucy/trunk/perl/xs/Lucy/Analysis/RegexTokenizer.c
Modified: incubator/lucy/trunk/perl/xs/Lucy/Analysis/RegexTokenizer.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/xs/Lucy/Analysis/RegexTokenizer.c?rev=1099115&r1=1099114&r2=1099115&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/xs/Lucy/Analysis/RegexTokenizer.c (original)
+++ incubator/lucy/trunk/perl/xs/Lucy/Analysis/RegexTokenizer.c Tue May 3 16:27:03 2011
@@ -64,18 +64,17 @@ lucy_RegexTokenizer_init(lucy_RegexToken
static void
S_set_token_re_but_not_pattern(lucy_RegexTokenizer *self, void *token_re) {
- MAGIC *magic = NULL;
- REGEXP *rx;
#if (PERL_VERSION > 10)
- rx = SvRX((SV*)token_re);
+ REGEXP *rx = SvRX((SV*)token_re);
#else
+ MAGIC *magic = NULL;
if (SvMAGICAL((SV*)token_re)) {
magic = mg_find((SV*)token_re, PERL_MAGIC_qr);
}
if (!magic) {
THROW(LUCY_ERR, "token_re is not a qr// entity");
}
- rx = (REGEXP*)magic->mg_obj;
+ REGEXP *rx = (REGEXP*)magic->mg_obj;
#endif
if (rx == NULL) {
THROW(LUCY_ERR, "Failed to extract REGEXP from token_re '%s'",