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/02/18 18:59:28 UTC
[lucy-commits] svn commit: r1072091 - in /incubator/lucy/trunk/clownfish: lib/Clownfish.xs
src/CFCFunction.c src/CFCFunction.h src/CFCMethod.c src/CFCMethod.h
Author: marvin
Date: Fri Feb 18 17:59:27 2011
New Revision: 1072091
URL: http://svn.apache.org/viewvc?rev=1072091&view=rev
Log:
Remove SV* wrapper from docucomment member in CFCFunction and CFCMethod.
Modified:
incubator/lucy/trunk/clownfish/lib/Clownfish.xs
incubator/lucy/trunk/clownfish/src/CFCFunction.c
incubator/lucy/trunk/clownfish/src/CFCFunction.h
incubator/lucy/trunk/clownfish/src/CFCMethod.c
incubator/lucy/trunk/clownfish/src/CFCMethod.h
Modified: incubator/lucy/trunk/clownfish/lib/Clownfish.xs
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/lib/Clownfish.xs?rev=1072091&r1=1072090&r2=1072091&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/lib/Clownfish.xs (original)
+++ incubator/lucy/trunk/clownfish/lib/Clownfish.xs Fri Feb 18 17:59:27 2011
@@ -221,7 +221,7 @@ _new(klass, parcel, exposure, class_name
SV *micro_sym_sv;
SV *return_type;
SV *param_list;
- SV *docucomment;
+ CFCDocuComment *docucomment;
int is_inline;
CODE:
const char *class_name = SvOK(class_name_sv)
@@ -259,8 +259,13 @@ PPCODE:
case 4:
retval = newSVsv((SV*)CFCFunction_get_param_list(self));
break;
- case 6:
- retval = newSVsv((SV*)CFCFunction_get_docucomment(self));
+ case 6: {
+ CFCDocuComment *docucomment
+ = CFCFunction_get_docucomment(self);
+ retval = docucomment
+ ? newRV((SV*)CFCBase_get_perl_obj((CFCBase*)self))
+ : newSV(0);
+ }
break;
case 8:
retval = newSViv(CFCFunction_inline(self));
@@ -281,7 +286,7 @@ _new(klass, parcel, exposure, class_name
SV *micro_sym_sv;
SV *return_type;
SV *param_list;
- SV *docucomment;
+ CFCDocuComment *docucomment;
int is_inline;
const char *macro_sym;
int is_final;
Modified: incubator/lucy/trunk/clownfish/src/CFCFunction.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCFunction.c?rev=1072091&r1=1072090&r2=1072091&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCFunction.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCFunction.c Fri Feb 18 17:59:27 2011
@@ -22,12 +22,13 @@
#define CFC_NEED_FUNCTION_STRUCT_DEF
#include "CFCFunction.h"
#include "CFCParcel.h"
+#include "CFCDocuComment.h"
CFCFunction*
CFCFunction_new(CFCParcel *parcel, const char *exposure,
const char *class_name, const char *class_cnick,
const char *micro_sym, void *return_type, void *param_list,
- void *docucomment, int is_inline)
+ CFCDocuComment *docucomment, int is_inline)
{
CFCFunction *self = (CFCFunction*)CFCBase_allocate(sizeof(CFCFunction),
"Clownfish::Function");
@@ -39,13 +40,13 @@ CFCFunction*
CFCFunction_init(CFCFunction *self, CFCParcel *parcel, const char *exposure,
const char *class_name, const char *class_cnick,
const char *micro_sym, void *return_type, void *param_list,
- void *docucomment, int is_inline)
+ CFCDocuComment *docucomment, int is_inline)
{
CFCSymbol_init((CFCSymbol*)self, parcel, exposure, class_name,
class_cnick, micro_sym);
self->return_type = newSVsv((SV*)return_type);
self->param_list = newSVsv((SV*)param_list);
- self->docucomment = docucomment ? newSVsv((SV*)docucomment) : NULL;
+ self->docucomment = (CFCDocuComment*)CFCBase_incref((CFCBase*)docucomment);
self->is_inline = is_inline;
return self;
}
@@ -55,7 +56,7 @@ CFCFunction_destroy(CFCFunction *self)
{
SvREFCNT_dec((SV*)self->return_type);
SvREFCNT_dec((SV*)self->param_list);
- SvREFCNT_dec((SV*)self->docucomment);
+ CFCBase_decref((CFCBase*)self->docucomment);
CFCSymbol_destroy((CFCSymbol*)self);
}
@@ -71,7 +72,7 @@ CFCFunction_get_param_list(CFCFunction *
return self->param_list;
}
-void*
+CFCDocuComment*
CFCFunction_get_docucomment(CFCFunction *self)
{
return self->docucomment;
Modified: incubator/lucy/trunk/clownfish/src/CFCFunction.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCFunction.h?rev=1072091&r1=1072090&r2=1072091&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCFunction.h (original)
+++ incubator/lucy/trunk/clownfish/src/CFCFunction.h Fri Feb 18 17:59:27 2011
@@ -19,6 +19,7 @@
typedef struct CFCFunction CFCFunction;
struct CFCParcel;
+struct CFCDocuComment;
#ifdef CFC_NEED_FUNCTION_STRUCT_DEF
#define CFC_NEED_SYMBOL_STRUCT_DEF
@@ -27,7 +28,7 @@ struct CFCParcel;
CFCSymbol symbol;
void *return_type;
void *param_list;
- void *docucomment;
+ struct CFCDocuComment *docucomment;
int is_inline;
};
#endif
@@ -37,14 +38,14 @@ CFCFunction*
CFCFunction_new(struct CFCParcel *parcel, const char *exposure,
const char *class_name, const char *class_cnick,
const char *micro_sym, void *return_type, void *param_list,
- void *docucomment, int is_inline);
+ struct CFCDocuComment *docucomment, int is_inline);
CFCFunction*
CFCFunction_init(CFCFunction *self, struct CFCParcel *parcel,
const char *exposure, const char *class_name,
const char *class_cnick, const char *micro_sym,
- void *return_type, void *param_list, void *docucomment,
- int is_inline);
+ void *return_type, void *param_list,
+ struct CFCDocuComment *docucomment, int is_inline);
void
CFCFunction_destroy(CFCFunction *self);
@@ -55,7 +56,7 @@ CFCFunction_get_return_type(CFCFunction
void*
CFCFunction_get_param_list(CFCFunction *self);
-void*
+struct CFCDocuComment*
CFCFunction_get_docucomment(CFCFunction *self);
int
Modified: incubator/lucy/trunk/clownfish/src/CFCMethod.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCMethod.c?rev=1072091&r1=1072090&r2=1072091&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCMethod.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCMethod.c Fri Feb 18 17:59:27 2011
@@ -24,6 +24,7 @@
#include "CFCMethod.h"
#include "CFCUtil.h"
#include "CFCParcel.h"
+#include "CFCDocuComment.h"
struct CFCMethod {
CFCFunction function;
@@ -37,9 +38,9 @@ struct CFCMethod {
CFCMethod*
CFCMethod_new(CFCParcel *parcel, const char *exposure, const char *class_name,
const char *class_cnick, const char *micro_sym,
- void *return_type, void *param_list, void *docucomment,
- int is_inline, const char *macro_sym, int is_final,
- int is_abstract)
+ void *return_type, void *param_list,
+ CFCDocuComment *docucomment, int is_inline,
+ const char *macro_sym, int is_final, int is_abstract)
{
CFCMethod *self = (CFCMethod*)CFCBase_allocate(sizeof(CFCMethod),
"Clownfish::Method");
@@ -52,8 +53,8 @@ CFCMethod*
CFCMethod_init(CFCMethod *self, CFCParcel *parcel, const char *exposure,
const char *class_name, const char *class_cnick,
const char *micro_sym, void *return_type, void *param_list,
- void *docucomment, int is_inline, const char *macro_sym,
- int is_final, int is_abstract)
+ CFCDocuComment *docucomment, int is_inline,
+ const char *macro_sym, int is_final, int is_abstract)
{
CFCFunction_init((CFCFunction*)self, parcel, exposure, class_name,
class_cnick, micro_sym, return_type, param_list, docucomment,
Modified: incubator/lucy/trunk/clownfish/src/CFCMethod.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCMethod.h?rev=1072091&r1=1072090&r2=1072091&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCMethod.h (original)
+++ incubator/lucy/trunk/clownfish/src/CFCMethod.h Fri Feb 18 17:59:27 2011
@@ -19,21 +19,22 @@
typedef struct CFCMethod CFCMethod;
struct CFCParcel;
+struct CFCDocuComment;
CFCMethod*
CFCMethod_new(struct CFCParcel *parcel, const char *exposure,
const char *class_name, const char *class_cnick,
const char *micro_sym, void *return_type, void *param_list,
- void *docucomment, int is_inline, const char *macro_sym,
- int is_final, int is_abstract);
+ struct CFCDocuComment *docucomment, int is_inline,
+ const char *macro_sym, int is_final, int is_abstract);
CFCMethod*
CFCMethod_init(CFCMethod *self, struct CFCParcel *parcel,
const char *exposure, const char *class_name,
const char *class_cnick, const char *micro_sym,
- void *return_type, void *param_list, void *docucomment,
- int is_inline, const char *macro_sym, int is_final,
- int is_abstract);
+ void *return_type, void *param_list,
+ struct CFCDocuComment *docucomment, int is_inline,
+ const char *macro_sym, int is_final, int is_abstract);
void
CFCMethod_destroy(CFCMethod *self);