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 19:41:11 UTC
[lucy-commits] svn commit: r1072100 - 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 18:41:11 2011
New Revision: 1072100
URL: http://svn.apache.org/viewvc?rev=1072100&view=rev
Log:
Remove SV* wrappers from 'return_type' and 'param_list' members 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=1072100&r1=1072099&r2=1072100&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/lib/Clownfish.xs (original)
+++ incubator/lucy/trunk/clownfish/lib/Clownfish.xs Fri Feb 18 18:41:11 2011
@@ -219,8 +219,8 @@ _new(klass, parcel, exposure, class_name
SV *class_name_sv;
SV *class_cnick_sv;
SV *micro_sym_sv;
- SV *return_type;
- SV *param_list;
+ CFCType *return_type;
+ CFCParamList *param_list;
CFCDocuComment *docucomment;
int is_inline;
CODE:
@@ -253,11 +253,19 @@ ALIAS:
PPCODE:
{
START_SET_OR_GET_SWITCH
- case 2:
- retval = newSVsv((SV*)CFCFunction_get_return_type(self));
+ case 2: {
+ CFCType *type = CFCFunction_get_return_type(self);
+ retval = type
+ ? newRV((SV*)CFCBase_get_perl_obj((CFCBase*)type))
+ : newSV(0);
+ }
break;
- case 4:
- retval = newSVsv((SV*)CFCFunction_get_param_list(self));
+ case 4: {
+ CFCParamList *param_list = CFCFunction_get_param_list(self);
+ retval = param_list
+ ? newRV((SV*)CFCBase_get_perl_obj((CFCBase*)param_list))
+ : newSV(0);
+ }
break;
case 6: {
CFCDocuComment *docucomment
@@ -284,8 +292,8 @@ _new(klass, parcel, exposure, class_name
SV *class_name_sv;
SV *class_cnick_sv;
SV *micro_sym_sv;
- SV *return_type;
- SV *param_list;
+ CFCType *return_type;
+ CFCParamList *param_list;
CFCDocuComment *docucomment;
int is_inline;
const char *macro_sym;
Modified: incubator/lucy/trunk/clownfish/src/CFCFunction.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCFunction.c?rev=1072100&r1=1072099&r2=1072100&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCFunction.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCFunction.c Fri Feb 18 18:41:11 2011
@@ -22,13 +22,16 @@
#define CFC_NEED_FUNCTION_STRUCT_DEF
#include "CFCFunction.h"
#include "CFCParcel.h"
+#include "CFCType.h"
+#include "CFCParamList.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,
- CFCDocuComment *docucomment, int is_inline)
+ const char *micro_sym, CFCType *return_type,
+ CFCParamList *param_list, CFCDocuComment *docucomment,
+ int is_inline)
{
CFCFunction *self = (CFCFunction*)CFCBase_allocate(sizeof(CFCFunction),
"Clownfish::Function");
@@ -39,13 +42,14 @@ CFCFunction_new(CFCParcel *parcel, const
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,
- CFCDocuComment *docucomment, int is_inline)
+ const char *micro_sym, CFCType *return_type,
+ CFCParamList *param_list, 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->return_type = (CFCType*)CFCBase_incref((CFCBase*)return_type);
+ self->param_list = (CFCParamList*)CFCBase_incref((CFCBase*)param_list);
self->docucomment = (CFCDocuComment*)CFCBase_incref((CFCBase*)docucomment);
self->is_inline = is_inline;
return self;
@@ -54,19 +58,19 @@ CFCFunction_init(CFCFunction *self, CFCP
void
CFCFunction_destroy(CFCFunction *self)
{
- SvREFCNT_dec((SV*)self->return_type);
- SvREFCNT_dec((SV*)self->param_list);
+ CFCBase_decref((CFCBase*)self->return_type);
+ CFCBase_decref((CFCBase*)self->param_list);
CFCBase_decref((CFCBase*)self->docucomment);
CFCSymbol_destroy((CFCSymbol*)self);
}
-void*
+CFCType*
CFCFunction_get_return_type(CFCFunction *self)
{
return self->return_type;
}
-void*
+CFCParamList*
CFCFunction_get_param_list(CFCFunction *self)
{
return self->param_list;
Modified: incubator/lucy/trunk/clownfish/src/CFCFunction.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCFunction.h?rev=1072100&r1=1072099&r2=1072100&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCFunction.h (original)
+++ incubator/lucy/trunk/clownfish/src/CFCFunction.h Fri Feb 18 18:41:11 2011
@@ -19,15 +19,17 @@
typedef struct CFCFunction CFCFunction;
struct CFCParcel;
+struct CFCType;
struct CFCDocuComment;
+struct CFCParamList;
#ifdef CFC_NEED_FUNCTION_STRUCT_DEF
#define CFC_NEED_SYMBOL_STRUCT_DEF
#include "CFCSymbol.h"
struct CFCFunction {
CFCSymbol symbol;
- void *return_type;
- void *param_list;
+ struct CFCType *return_type;
+ struct CFCParamList *param_list;
struct CFCDocuComment *docucomment;
int is_inline;
};
@@ -37,23 +39,24 @@ struct CFCDocuComment;
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,
+ const char *micro_sym, struct CFCType *return_type,
+ struct CFCParamList *param_list,
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,
+ struct CFCType *return_type, struct CFCParamList *param_list,
struct CFCDocuComment *docucomment, int is_inline);
void
CFCFunction_destroy(CFCFunction *self);
-void*
+struct CFCType*
CFCFunction_get_return_type(CFCFunction *self);
-void*
+struct CFCParamList*
CFCFunction_get_param_list(CFCFunction *self);
struct CFCDocuComment*
Modified: incubator/lucy/trunk/clownfish/src/CFCMethod.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCMethod.c?rev=1072100&r1=1072099&r2=1072100&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCMethod.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCMethod.c Fri Feb 18 18:41:11 2011
@@ -22,7 +22,9 @@
#define CFC_NEED_FUNCTION_STRUCT_DEF
#include "CFCFunction.h"
#include "CFCMethod.h"
+#include "CFCType.h"
#include "CFCUtil.h"
+#include "CFCParamList.h"
#include "CFCParcel.h"
#include "CFCDocuComment.h"
@@ -38,7 +40,7 @@ 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,
+ CFCType *return_type, CFCParamList *param_list,
CFCDocuComment *docucomment, int is_inline,
const char *macro_sym, int is_final, int is_abstract)
{
@@ -52,9 +54,10 @@ CFCMethod_new(CFCParcel *parcel, const c
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,
- CFCDocuComment *docucomment, int is_inline,
- const char *macro_sym, int is_final, int is_abstract)
+ const char *micro_sym, CFCType *return_type,
+ CFCParamList *param_list, 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=1072100&r1=1072099&r2=1072100&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCMethod.h (original)
+++ incubator/lucy/trunk/clownfish/src/CFCMethod.h Fri Feb 18 18:41:11 2011
@@ -19,12 +19,15 @@
typedef struct CFCMethod CFCMethod;
struct CFCParcel;
+struct CFCType;
+struct CFCParamList;
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,
+ const char *micro_sym, struct CFCType *return_type,
+ struct CFCParamList *param_list,
struct CFCDocuComment *docucomment, int is_inline,
const char *macro_sym, int is_final, int is_abstract);
@@ -32,7 +35,7 @@ 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,
+ struct CFCType *return_type, struct CFCParamList *param_list,
struct CFCDocuComment *docucomment, int is_inline,
const char *macro_sym, int is_final, int is_abstract);