Eliminate irrelevant formatting differences from master
This commit is contained in:
parent
0185b6114f
commit
786efd0ae0
2 changed files with 22 additions and 26 deletions
|
|
@ -188,8 +188,8 @@ SWIG_ConvertResourcePtr(zval *z, swig_type_info *ty, int flags) {
|
||||||
if (!type_name) {
|
if (!type_name) {
|
||||||
if (Z_TYPE_P(z) == IS_OBJECT) {
|
if (Z_TYPE_P(z) == IS_OBJECT) {
|
||||||
HashTable * ht = Z_OBJ_HT_P(z)->get_properties(z);
|
HashTable * ht = Z_OBJ_HT_P(z)->get_properties(z);
|
||||||
zval * _cPtr = zend_hash_str_find(ht, "_cPtr", sizeof("_cPtr") - 1);
|
zval * _cPtr = zend_hash_str_find(ht, "_cPtr", sizeof("_cPtr") - 1);
|
||||||
type_name=zend_rsrc_list_get_rsrc_type(Z_RES_P(_cPtr));
|
type_name=zend_rsrc_list_get_rsrc_type(Z_RES_P(_cPtr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -299,4 +299,3 @@ static swig_module_info *SWIG_Php_GetModule() {
|
||||||
static void SWIG_Php_SetModule(swig_module_info *pointer) {
|
static void SWIG_Php_SetModule(swig_module_info *pointer) {
|
||||||
REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, CONST_PERSISTENT | CONST_CS);
|
REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, CONST_PERSISTENT | CONST_CS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -205,14 +205,12 @@ static void SwigPHP_emit_resource_registrations() {
|
||||||
Iterator ki;
|
Iterator ki;
|
||||||
bool emitted_default_dtor = false;
|
bool emitted_default_dtor = false;
|
||||||
|
|
||||||
if (!zend_types) {
|
if (!zend_types)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
ki = First(zend_types);
|
ki = First(zend_types);
|
||||||
if (ki.key) {
|
if (ki.key)
|
||||||
Printf(s_oinit, "\n/* Register resource destructors for pointer types */\n");
|
Printf(s_oinit, "\n/* Register resource destructors for pointer types */\n");
|
||||||
}
|
|
||||||
while (ki.key) {
|
while (ki.key) {
|
||||||
DOH *key = ki.key;
|
DOH *key = ki.key;
|
||||||
Node *class_node = ki.item;
|
Node *class_node = ki.item;
|
||||||
|
|
@ -223,9 +221,8 @@ static void SwigPHP_emit_resource_registrations() {
|
||||||
if (class_node != NOTCLASS) {
|
if (class_node != NOTCLASS) {
|
||||||
String *destructor = Getattr(class_node, "destructor");
|
String *destructor = Getattr(class_node, "destructor");
|
||||||
human_name = Getattr(class_node, "sym:name");
|
human_name = Getattr(class_node, "sym:name");
|
||||||
if (!human_name) {
|
if (!human_name)
|
||||||
human_name = Getattr(class_node, "name");
|
human_name = Getattr(class_node, "name");
|
||||||
}
|
|
||||||
// Do we have a known destructor for this type?
|
// Do we have a known destructor for this type?
|
||||||
if (destructor) {
|
if (destructor) {
|
||||||
rsrc_dtor_name = NewStringf("_wrap_destroy%s", key);
|
rsrc_dtor_name = NewStringf("_wrap_destroy%s", key);
|
||||||
|
|
@ -1340,7 +1337,7 @@ public:
|
||||||
overname = Getattr(n, "sym:overname");
|
overname = Getattr(n, "sym:overname");
|
||||||
} else {
|
} else {
|
||||||
if (!addSymbol(iname, n))
|
if (!addSymbol(iname, n))
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overname) {
|
if (overname) {
|
||||||
|
|
@ -1533,16 +1530,16 @@ public:
|
||||||
SwigType *pt = Getattr(p, "type");
|
SwigType *pt = Getattr(p, "type");
|
||||||
|
|
||||||
if (wrapperType == memberfn || wrapperType == membervar) {
|
if (wrapperType == memberfn || wrapperType == membervar) {
|
||||||
source = NewStringf("args[%d]", i-1);
|
source = NewStringf("args[%d]", i-1);
|
||||||
} else {
|
} else {
|
||||||
source = NewStringf("args[%d]", i);
|
source = NewStringf("args[%d]", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
String *ln = Getattr(p, "lname");
|
String *ln = Getattr(p, "lname");
|
||||||
|
|
||||||
/* Check if optional */
|
/* Check if optional */
|
||||||
if (i >= num_required) {
|
if (i >= num_required) {
|
||||||
Printf(f->code, "\tif(arg_count > %d) {\n", i);
|
Printf(f->code, "\tif(arg_count > %d) {\n", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
String *paramType_class = NULL;
|
String *paramType_class = NULL;
|
||||||
|
|
@ -1779,9 +1776,8 @@ public:
|
||||||
if (overloaded && Getattr(n, "sym:nextSibling") != 0)
|
if (overloaded && Getattr(n, "sym:nextSibling") != 0)
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
|
|
||||||
if (!s_oowrappers) {
|
if (!s_oowrappers)
|
||||||
s_oowrappers = NewStringEmpty();
|
s_oowrappers = NewStringEmpty();
|
||||||
}
|
|
||||||
|
|
||||||
if (newobject || wrapperType == memberfn || wrapperType == staticmemberfn || wrapperType == standard || wrapperType == staticmembervar) {
|
if (newobject || wrapperType == memberfn || wrapperType == staticmemberfn || wrapperType == standard || wrapperType == staticmembervar) {
|
||||||
bool handle_as_overload = false;
|
bool handle_as_overload = false;
|
||||||
|
|
@ -2739,6 +2735,7 @@ done:
|
||||||
String *symname = Getattr(n, "sym:name");
|
String *symname = Getattr(n, "sym:name");
|
||||||
Setattr(n, "php:proxy", symname);
|
Setattr(n, "php:proxy", symname);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Language::classDeclaration(n);
|
return Language::classDeclaration(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3141,6 +3138,7 @@ done:
|
||||||
}
|
}
|
||||||
Language::constructorHandler(n);
|
Language::constructorHandler(n);
|
||||||
wrapperType = standard;
|
wrapperType = standard;
|
||||||
|
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3164,7 +3162,6 @@ done:
|
||||||
Setattr(classnode, "destructor", destructorname);
|
Setattr(classnode, "destructor", destructorname);
|
||||||
|
|
||||||
Wrapper *f = NewWrapper();
|
Wrapper *f = NewWrapper();
|
||||||
|
|
||||||
Printf(f->def, "/* This function is designed to be called by the zend list destructors */\n");
|
Printf(f->def, "/* This function is designed to be called by the zend list destructors */\n");
|
||||||
Printf(f->def, "/* to typecast and do the actual destruction */\n");
|
Printf(f->def, "/* to typecast and do the actual destruction */\n");
|
||||||
Printf(f->def, "static void %s(zend_resource *res, const char *type_name) {\n", destructorname);
|
Printf(f->def, "static void %s(zend_resource *res, const char *type_name) {\n", destructorname);
|
||||||
|
|
@ -3429,15 +3426,15 @@ done:
|
||||||
if ((tm = Getattr(p, "tmap:directorin")) != 0) {
|
if ((tm = Getattr(p, "tmap:directorin")) != 0) {
|
||||||
String *parse = Getattr(p, "tmap:directorin:parse");
|
String *parse = Getattr(p, "tmap:directorin:parse");
|
||||||
if (!parse) {
|
if (!parse) {
|
||||||
if (is_class(Getattr(p, "type"))) {
|
if (is_class(Getattr(p, "type"))) {
|
||||||
String *return_class_name = get_class_name(Getattr(p, "type"));
|
String *return_class_name = get_class_name(Getattr(p, "type"));
|
||||||
String *object_name = NewStringEmpty();
|
String *object_name = NewStringEmpty();
|
||||||
Printf(object_name, "%s_object_new(SWIGTYPE_%s_ce)", return_class_name, return_class_name);
|
Printf(object_name, "%s_object_new(SWIGTYPE_%s_ce)", return_class_name, return_class_name);
|
||||||
Replaceall(tm, "$zend_obj", object_name);
|
Replaceall(tm, "$zend_obj", object_name);
|
||||||
Replaceall(tm, "$needNewFlow", "1");
|
Replaceall(tm, "$needNewFlow", "1");
|
||||||
}
|
}
|
||||||
Replaceall(tm, "$zend_obj", "NULL");
|
Replaceall(tm, "$zend_obj", "NULL");
|
||||||
Replaceall(tm, "$needNewFlow", "0");
|
Replaceall(tm, "$needNewFlow", "0");
|
||||||
String *input = NewStringf("&args[%d]", idx++);
|
String *input = NewStringf("&args[%d]", idx++);
|
||||||
Setattr(p, "emit:directorinput", input);
|
Setattr(p, "emit:directorinput", input);
|
||||||
Replaceall(tm, "$input", input);
|
Replaceall(tm, "$input", input);
|
||||||
|
|
@ -3526,7 +3523,7 @@ done:
|
||||||
char temp[24];
|
char temp[24];
|
||||||
sprintf(temp, "%d", idx);
|
sprintf(temp, "%d", idx);
|
||||||
Replaceall(tm, "$argnum", temp);
|
Replaceall(tm, "$argnum", temp);
|
||||||
Replaceall(tm, "$needNewFlow", Getattr(n, "feature:new") ? "1" : "0");
|
Replaceall(tm, "$needNewFlow", Getattr(n, "feature:new") ? "1" : "0");
|
||||||
|
|
||||||
/* TODO check this */
|
/* TODO check this */
|
||||||
if (Getattr(n, "wrap:disown")) {
|
if (Getattr(n, "wrap:disown")) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue