Use NewStringEmpty() rather than NewString("").
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9300 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
33ae59c7b0
commit
0915d45c2c
1 changed files with 39 additions and 39 deletions
|
|
@ -371,13 +371,13 @@ public:
|
||||||
static String *makefilein=0;
|
static String *makefilein=0;
|
||||||
static String *credits=0;
|
static String *credits=0;
|
||||||
|
|
||||||
configm4=NewString("");
|
configm4 = NewStringEmpty();
|
||||||
Printv(configm4, SWIG_output_directory(), "config.m4", NIL);
|
Printv(configm4, SWIG_output_directory(), "config.m4", NIL);
|
||||||
|
|
||||||
makefilein=NewString("");
|
makefilein = NewStringEmpty();
|
||||||
Printv(makefilein, SWIG_output_directory(), "Makefile.in", NIL);
|
Printv(makefilein, SWIG_output_directory(), "Makefile.in", NIL);
|
||||||
|
|
||||||
credits=NewString("");
|
credits = NewStringEmpty();
|
||||||
Printv(credits, SWIG_output_directory(), "CREDITS", NIL);
|
Printv(credits, SWIG_output_directory(), "CREDITS", NIL);
|
||||||
|
|
||||||
// are we a --with- or --enable-
|
// are we a --with- or --enable-
|
||||||
|
|
@ -594,13 +594,13 @@ public:
|
||||||
r_shutdown = NewString("/* rshutdown section */\n");
|
r_shutdown = NewString("/* rshutdown section */\n");
|
||||||
s_header = NewString("/* header section */\n");
|
s_header = NewString("/* header section */\n");
|
||||||
s_wrappers = NewString("/* wrapper section */\n");
|
s_wrappers = NewString("/* wrapper section */\n");
|
||||||
s_type = NewString("");
|
s_type = NewStringEmpty();
|
||||||
/* subsections of the init section */
|
/* subsections of the init section */
|
||||||
s_vinit = NewString("/* vinit subsection */\n");
|
s_vinit = NewString("/* vinit subsection */\n");
|
||||||
s_vdecl = NewString("/* vdecl subsection */\n");
|
s_vdecl = NewString("/* vdecl subsection */\n");
|
||||||
s_cinit = NewString("/* cinit subsection */\n");
|
s_cinit = NewString("/* cinit subsection */\n");
|
||||||
s_oinit = NewString("/* oinit subsection */\n");
|
s_oinit = NewString("/* oinit subsection */\n");
|
||||||
pragma_phpinfo = NewString("");
|
pragma_phpinfo = NewStringEmpty();
|
||||||
s_phpclasses = NewString("/* PHP Proxy Classes */\n");
|
s_phpclasses = NewString("/* PHP Proxy Classes */\n");
|
||||||
|
|
||||||
/* Register file targets with the SWIG file handler */
|
/* Register file targets with the SWIG file handler */
|
||||||
|
|
@ -618,7 +618,7 @@ public:
|
||||||
if (!prefix) prefix = Copy(module);
|
if (!prefix) prefix = Copy(module);
|
||||||
|
|
||||||
/* PHP module file */
|
/* PHP module file */
|
||||||
filen = NewString("");
|
filen = NewStringEmpty();
|
||||||
Printv(filen, SWIG_output_directory(), module, ".php", NIL);
|
Printv(filen, SWIG_output_directory(), module, ".php", NIL);
|
||||||
phpfilename = NewString(filen);
|
phpfilename = NewString(filen);
|
||||||
|
|
||||||
|
|
@ -646,8 +646,8 @@ public:
|
||||||
Printf(f_phpcode,"}\n\n");
|
Printf(f_phpcode,"}\n\n");
|
||||||
|
|
||||||
/* sub-sections of the php file */
|
/* sub-sections of the php file */
|
||||||
pragma_code = NewString("");
|
pragma_code = NewStringEmpty();
|
||||||
pragma_incl = NewString("");
|
pragma_incl = NewStringEmpty();
|
||||||
|
|
||||||
/* Initialize the rest of the module */
|
/* Initialize the rest of the module */
|
||||||
|
|
||||||
|
|
@ -699,7 +699,7 @@ public:
|
||||||
Printf(s_header,"#endif\n\n");
|
Printf(s_header,"#endif\n\n");
|
||||||
|
|
||||||
/* Create the .h file too */
|
/* Create the .h file too */
|
||||||
filen = NewString("");
|
filen = NewStringEmpty();
|
||||||
Printv(filen, SWIG_output_directory(), "php_", module, ".h", NIL);
|
Printv(filen, SWIG_output_directory(), "php_", module, ".h", NIL);
|
||||||
f_h = NewFile(filen, "w");
|
f_h = NewFile(filen, "w");
|
||||||
if (!f_h) {
|
if (!f_h) {
|
||||||
|
|
@ -834,7 +834,7 @@ public:
|
||||||
Printf(s_header, "};\n");
|
Printf(s_header, "};\n");
|
||||||
Printf(s_header, "zend_module_entry* SWIG_module_entry = &%s_module_entry;\n\n",module);
|
Printf(s_header, "zend_module_entry* SWIG_module_entry = &%s_module_entry;\n\n",module);
|
||||||
|
|
||||||
String *type_table = NewString("");
|
String *type_table = NewStringEmpty();
|
||||||
SwigType_emit_type_table(f_runtime,type_table);
|
SwigType_emit_type_table(f_runtime,type_table);
|
||||||
Printf(s_header,"%s",type_table);
|
Printf(s_header,"%s",type_table);
|
||||||
Delete(type_table);
|
Delete(type_table);
|
||||||
|
|
@ -897,7 +897,7 @@ public:
|
||||||
/* Last node in overloaded chain */
|
/* Last node in overloaded chain */
|
||||||
|
|
||||||
int maxargs;
|
int maxargs;
|
||||||
String *tmp = NewString("");
|
String *tmp = NewStringEmpty();
|
||||||
String *dispatch = Swig_overload_dispatch(n,"return %s(INTERNAL_FUNCTION_PARAM_PASSTHRU);",&maxargs);
|
String *dispatch = Swig_overload_dispatch(n,"return %s(INTERNAL_FUNCTION_PARAM_PASSTHRU);",&maxargs);
|
||||||
|
|
||||||
int has_this_ptr = (wrapperType==memberfn && shadow && php_version == 4);
|
int has_this_ptr = (wrapperType==memberfn && shadow && php_version == 4);
|
||||||
|
|
@ -1025,8 +1025,8 @@ public:
|
||||||
f = NewWrapper();
|
f = NewWrapper();
|
||||||
numopt = 0;
|
numopt = 0;
|
||||||
|
|
||||||
String *outarg = NewString("");
|
String *outarg = NewStringEmpty();
|
||||||
String *cleanup = NewString("");
|
String *cleanup = NewStringEmpty();
|
||||||
|
|
||||||
if (mvr) { // do prop[gs]et header
|
if (mvr) { // do prop[gs]et header
|
||||||
if (mvrset) {
|
if (mvrset) {
|
||||||
|
|
@ -1245,7 +1245,7 @@ public:
|
||||||
// Is being shadow-wrap-thingied
|
// Is being shadow-wrap-thingied
|
||||||
Printf(f->code, "{\n/* ALTERNATIVE Constructor, make an object wrapper */\n");
|
Printf(f->code, "{\n/* ALTERNATIVE Constructor, make an object wrapper */\n");
|
||||||
// Make object
|
// Make object
|
||||||
String *shadowrettype = NewString("");
|
String *shadowrettype = NewStringEmpty();
|
||||||
SwigToPhpType(d, iname, shadowrettype, (shadow && php_version == 4));
|
SwigToPhpType(d, iname, shadowrettype, (shadow && php_version == 4));
|
||||||
|
|
||||||
Printf(f->code,"zval *obj, *_cPtr;\n");
|
Printf(f->code,"zval *obj, *_cPtr;\n");
|
||||||
|
|
@ -1336,7 +1336,7 @@ public:
|
||||||
// for them all).
|
// for them all).
|
||||||
if (overloaded && Getattr(n,"sym:nextSibling") != 0) return SWIG_OK;
|
if (overloaded && Getattr(n,"sym:nextSibling") != 0) return SWIG_OK;
|
||||||
|
|
||||||
if (!s_oowrappers) s_oowrappers = NewString("");
|
if (!s_oowrappers) s_oowrappers = NewStringEmpty();
|
||||||
if (newobject || wrapperType == memberfn || wrapperType == staticmemberfn || wrapperType == standard) {
|
if (newobject || wrapperType == memberfn || wrapperType == staticmemberfn || wrapperType == standard) {
|
||||||
bool handle_as_overload = false;
|
bool handle_as_overload = false;
|
||||||
String ** arg_names;
|
String ** arg_names;
|
||||||
|
|
@ -1354,7 +1354,7 @@ public:
|
||||||
methodname = Char(Getattr(n, "staticmemberfunctionHandler:sym:name"));
|
methodname = Char(Getattr(n, "staticmemberfunctionHandler:sym:name"));
|
||||||
} else { // wrapperType == standard
|
} else { // wrapperType == standard
|
||||||
methodname = Char(iname);
|
methodname = Char(iname);
|
||||||
if (!s_fakeoowrappers) s_fakeoowrappers = NewString("");
|
if (!s_fakeoowrappers) s_fakeoowrappers = NewStringEmpty();
|
||||||
output = s_fakeoowrappers;
|
output = s_fakeoowrappers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1667,7 +1667,7 @@ public:
|
||||||
Replaceall(pname, " ", "_");
|
Replaceall(pname, " ", "_");
|
||||||
} else {
|
} else {
|
||||||
/* We get here if the SWIG .i file has "int foo(int);" */
|
/* We get here if the SWIG .i file has "int foo(int);" */
|
||||||
pname = NewString("");
|
pname = NewStringEmpty();
|
||||||
Printf(pname, "arg%d", argno + 1);
|
Printf(pname, "arg%d", argno + 1);
|
||||||
}
|
}
|
||||||
// Check if we've already used this parameter name.
|
// Check if we've already used this parameter name.
|
||||||
|
|
@ -1684,9 +1684,9 @@ public:
|
||||||
Delete(seen);
|
Delete(seen);
|
||||||
seen = NULL;
|
seen = NULL;
|
||||||
|
|
||||||
String * invoke = NewString("");
|
String * invoke = NewStringEmpty();
|
||||||
String * prepare = NewString("");
|
String * prepare = NewStringEmpty();
|
||||||
String * args = NewString("");
|
String * args = NewStringEmpty();
|
||||||
|
|
||||||
if (!handle_as_overload && !(really_overloaded && max_num_of_arguments > min_num_of_arguments)) {
|
if (!handle_as_overload && !(really_overloaded && max_num_of_arguments > min_num_of_arguments)) {
|
||||||
Printf(invoke, "%s(", iname);
|
Printf(invoke, "%s(", iname);
|
||||||
|
|
@ -1716,7 +1716,7 @@ public:
|
||||||
if (i) Printf(args, ",");
|
if (i) Printf(args, ",");
|
||||||
Printf(args, "$%s", arg_names[i]);
|
Printf(args, "$%s", arg_names[i]);
|
||||||
}
|
}
|
||||||
String *invoke_args = NewString("");
|
String *invoke_args = NewStringEmpty();
|
||||||
if (wrapperType == memberfn) {
|
if (wrapperType == memberfn) {
|
||||||
Printf(invoke_args, "$this->%s", SWIG_PTR);
|
Printf(invoke_args, "$this->%s", SWIG_PTR);
|
||||||
if (min_num_of_arguments > 0) Printf(invoke_args, ",");
|
if (min_num_of_arguments > 0) Printf(invoke_args, ",");
|
||||||
|
|
@ -1910,10 +1910,10 @@ public:
|
||||||
|
|
||||||
if (shadow && php_version == 5) {
|
if (shadow && php_version == 5) {
|
||||||
if (wrapping_member_constant) {
|
if (wrapping_member_constant) {
|
||||||
if (!s_oowrappers) s_oowrappers = NewString("");
|
if (!s_oowrappers) s_oowrappers = NewStringEmpty();
|
||||||
Printf(s_oowrappers, "\n\tconst %s = %s;\n", wrapping_member_constant, iname);
|
Printf(s_oowrappers, "\n\tconst %s = %s;\n", wrapping_member_constant, iname);
|
||||||
} else {
|
} else {
|
||||||
if (!s_fakeoowrappers) s_fakeoowrappers = NewString("");
|
if (!s_fakeoowrappers) s_fakeoowrappers = NewStringEmpty();
|
||||||
Printf(s_fakeoowrappers, "\n\tconst %s = %s;\n", name, iname);
|
Printf(s_fakeoowrappers, "\n\tconst %s = %s;\n", name, iname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1987,7 +1987,7 @@ public:
|
||||||
|
|
||||||
if (!addSymbol(rename,n)) return SWIG_ERROR;
|
if (!addSymbol(rename,n)) return SWIG_ERROR;
|
||||||
shadow_classname = Swig_copy_string(rename);
|
shadow_classname = Swig_copy_string(rename);
|
||||||
cs_entry = NewString("");
|
cs_entry = NewStringEmpty();
|
||||||
Printf(cs_entry,"/* Function entries for %s */\n",shadow_classname);
|
Printf(cs_entry,"/* Function entries for %s */\n",shadow_classname);
|
||||||
Printf(cs_entry,"static zend_function_entry %s_functions[] = {\n", shadow_classname);
|
Printf(cs_entry,"static zend_function_entry %s_functions[] = {\n", shadow_classname);
|
||||||
|
|
||||||
|
|
@ -2067,8 +2067,8 @@ public:
|
||||||
if (shadow && php_version == 4) {
|
if (shadow && php_version == 4) {
|
||||||
DOH *key;
|
DOH *key;
|
||||||
int gcount, scount;
|
int gcount, scount;
|
||||||
String *s_propget=NewString("");
|
String *s_propget = NewStringEmpty();
|
||||||
String *s_propset=NewString("");
|
String *s_propset = NewStringEmpty();
|
||||||
List *baselist = Getattr(n, "bases");
|
List *baselist = Getattr(n, "bases");
|
||||||
Iterator ki, base;
|
Iterator ki, base;
|
||||||
|
|
||||||
|
|
@ -2670,7 +2670,7 @@ public:
|
||||||
SwigType *d = Getattr(n,"type");
|
SwigType *d = Getattr(n,"type");
|
||||||
ParmList *l = Getattr(n,"parms");
|
ParmList *l = Getattr(n,"parms");
|
||||||
|
|
||||||
String *destructorname=NewString("");
|
String *destructorname = NewStringEmpty();
|
||||||
Printf(destructorname,"_%s",Swig_name_wrapper(iname));
|
Printf(destructorname,"_%s",Swig_name_wrapper(iname));
|
||||||
Setattr(classnode,"destructor",destructorname);
|
Setattr(classnode,"destructor",destructorname);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue