Code style changes post review
This commit is contained in:
parent
06de704938
commit
b5af07fd95
1 changed files with 21 additions and 19 deletions
|
|
@ -1228,38 +1228,38 @@ int R::enumDeclaration(Node *n) {
|
||||||
// This will have content if the %nspace feature is set on
|
// This will have content if the %nspace feature is set on
|
||||||
// the input file
|
// the input file
|
||||||
String *nspace = Getattr(n, "sym:nspace"); // NSpace/getNSpace() only works during Language::enumDeclaration call
|
String *nspace = Getattr(n, "sym:nspace"); // NSpace/getNSpace() only works during Language::enumDeclaration call
|
||||||
String * ename;
|
String *ename;
|
||||||
|
|
||||||
String *name = Getattr(n, "name");
|
String *name = Getattr(n, "name");
|
||||||
ename = getRClassName(name);
|
ename = getRClassName(name);
|
||||||
if (debugMode) {
|
if (debugMode) {
|
||||||
Node *N = getCurrentClass();
|
Node *current_class = getCurrentClass();
|
||||||
String *cl = NewString("");
|
String *cl = NewString("");
|
||||||
if (N) {
|
if (current_class) {
|
||||||
cl=getEnumClassPrefix();
|
cl = getEnumClassPrefix();
|
||||||
}
|
}
|
||||||
Printf(stdout, "enumDeclaration: %s, %s, %s, %s, %s\n", name, symname, nspace, ename, cl);
|
Printf(stdout, "enumDeclaration: %s, %s, %s, %s, %s\n", name, symname, nspace, ename, cl);
|
||||||
}
|
}
|
||||||
Delete(name);
|
Delete(name);
|
||||||
// set up a call to create the R enum structure. The list of
|
// set up a call to create the R enum structure. The list of
|
||||||
// individual elements will be built in enum_code
|
// individual elements will be built in enum_code
|
||||||
enum_values=0;
|
enum_values = 0;
|
||||||
// Emit each enum item
|
// Emit each enum item
|
||||||
Language::enumDeclaration(n);
|
Language::enumDeclaration(n);
|
||||||
|
|
||||||
Printf(enum_def_calls, "defineEnumeration(\"%s\",\n .values=c(%s))\n\n",
|
Printf(enum_def_calls, "defineEnumeration(\"%s\",\n .values=c(%s))\n\n", ename, enum_values);
|
||||||
ename, enum_values);
|
|
||||||
Delete(enum_values);
|
Delete(enum_values);
|
||||||
Delete(ename);
|
Delete(ename);
|
||||||
//Delete(symname);
|
//Delete(symname);
|
||||||
}
|
}
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
int R::enumvalueDeclaration(Node *n) {
|
int R::enumvalueDeclaration(Node *n) {
|
||||||
if (getCurrentClass() && (cplus_mode != PUBLIC)) {
|
if (getCurrentClass() && (cplus_mode != PUBLIC)) {
|
||||||
Printf(stdout , "evd: Not public\n");
|
Printf(stdout, "evd: Not public\n");
|
||||||
return SWIG_NOWRAP;
|
return SWIG_NOWRAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1267,7 +1267,7 @@ int R::enumvalueDeclaration(Node *n) {
|
||||||
String *symname = Getattr(n, "sym:name");
|
String *symname = Getattr(n, "sym:name");
|
||||||
String *value = Getattr(n, "value");
|
String *value = Getattr(n, "value");
|
||||||
String *name = Getattr(n, "name");
|
String *name = Getattr(n, "name");
|
||||||
Node *parent = parentNode(n);
|
Node *parent = parentNode(n);
|
||||||
String *parent_name = Getattr(parent, "name");
|
String *parent_name = Getattr(parent, "name");
|
||||||
String *newsymname = 0;
|
String *newsymname = 0;
|
||||||
String *tmpValue;
|
String *tmpValue;
|
||||||
|
|
@ -1312,7 +1312,7 @@ int R::enumvalueDeclaration(Node *n) {
|
||||||
if (enum_values) {
|
if (enum_values) {
|
||||||
Printf(enum_values, ",\n\"%s\" = %s", name, value);
|
Printf(enum_values, ",\n\"%s\" = %s", name, value);
|
||||||
} else {
|
} else {
|
||||||
enum_values=NewString("");
|
enum_values = NewString("");
|
||||||
Printf(enum_values, "\"%s\" = %s", name, value);
|
Printf(enum_values, "\"%s\" = %s", name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1324,6 +1324,9 @@ int R::enumvalueDeclaration(Node *n) {
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
|
Create accessor functions for variables.
|
||||||
|
Does not create equivalent wrappers for enumerations,
|
||||||
|
which are handled differently
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
int R::variableWrapper(Node *n) {
|
int R::variableWrapper(Node *n) {
|
||||||
String *name = Getattr(n, "sym:name");
|
String *name = Getattr(n, "sym:name");
|
||||||
|
|
@ -1366,6 +1369,10 @@ int R::variableWrapper(Node *n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
|
Creates accessor functions for class members.
|
||||||
|
|
||||||
|
ToDo - this version depends on naming conventions and needs
|
||||||
|
to be replaced.
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
|
|
||||||
void R::addAccessor(String *memberName, Wrapper *wrapper, String *name,
|
void R::addAccessor(String *memberName, Wrapper *wrapper, String *name,
|
||||||
|
|
@ -1829,20 +1836,17 @@ int R::functionWrapper(Node *n) {
|
||||||
SwigType *resolved =
|
SwigType *resolved =
|
||||||
SwigType_typedef_resolve_all(type);
|
SwigType_typedef_resolve_all(type);
|
||||||
if (debugMode)
|
if (debugMode)
|
||||||
Printf(stdout, "<functionWrapper> resolved %s\n",
|
Printf(stdout, "<functionWrapper> resolved %s\n", Copy(unresolved_return_type));
|
||||||
Copy(unresolved_return_type));
|
|
||||||
if (expandTypedef(resolved)) {
|
if (expandTypedef(resolved)) {
|
||||||
type = Copy(resolved);
|
type = Copy(resolved);
|
||||||
Setattr(n, "type", type);
|
Setattr(n, "type", type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (debugMode)
|
if (debugMode)
|
||||||
Printf(stdout, "<functionWrapper> unresolved_return_type %s\n",
|
Printf(stdout, "<functionWrapper> unresolved_return_type %s\n", unresolved_return_type);
|
||||||
unresolved_return_type);
|
|
||||||
if(processing_member_access_function) {
|
if(processing_member_access_function) {
|
||||||
if (debugMode)
|
if (debugMode)
|
||||||
Printf(stdout, "<functionWrapper memberAccess> '%s' '%s' '%s' '%s'\n",
|
Printf(stdout, "<functionWrapper memberAccess> '%s' '%s' '%s' '%s'\n", fname, iname, member_name, class_name);
|
||||||
fname, iname, member_name, class_name);
|
|
||||||
|
|
||||||
if(opaqueClassDeclaration)
|
if(opaqueClassDeclaration)
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
|
|
@ -2504,9 +2508,7 @@ int R::classDeclaration(Node *n) {
|
||||||
class_member_set_functions = NULL;
|
class_member_set_functions = NULL;
|
||||||
}
|
}
|
||||||
if (Getattr(n, "has_destructor")) {
|
if (Getattr(n, "has_destructor")) {
|
||||||
Printf(sfile, "setMethod('delete', '_p%s', function(obj) {delete%s(obj)})\n",
|
Printf(sfile, "setMethod('delete', '_p%s', function(obj) {delete%s(obj)})\n", getRClassName(name), getRClassName(name));
|
||||||
getRClassName(name),
|
|
||||||
getRClassName(name));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!opaque && !Strcmp(kind, "struct") && copyStruct) {
|
if(!opaque && !Strcmp(kind, "struct") && copyStruct) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue