diff options
| author | Haoyu Bai <divinekid@gmail.com> | 2009-01-24 13:15:51 +0000 |
|---|---|---|
| committer | Haoyu Bai <divinekid@gmail.com> | 2009-01-24 13:15:51 +0000 |
| commit | 6d2aef67d9724358cc842413f6dbcb953d94ab74 (patch) | |
| tree | 08d159fd5ff1dfdb86e4c5faecd2ee2295114150 /Source/Preprocessor | |
| parent | 061cad9b546a9e4ea90e112de5f0605b44825d05 (diff) | |
| download | swig-6d2aef67d9724358cc842413f6dbcb953d94ab74.tar.gz | |
Replaced all [const] String_or_char * to const_String_or_char_ptr, by the following command:
sed -i "s/\(const \)\?String_or_char \*/const_String_or_char_ptr /g" CParse/* Include/* Modules/* Preprocessor/* Swig/*
This is a preparation for moving to new DOH, since for strong typed objects we need the const_String_or_char_ptr class to implicit convert to and from String * or const char *.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11080 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Source/Preprocessor')
| -rw-r--r-- | Source/Preprocessor/cpp.c | 13 | ||||
| -rw-r--r-- | Source/Preprocessor/preprocessor.h | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/Source/Preprocessor/cpp.c b/Source/Preprocessor/cpp.c index 2b9e25fef..635186bb5 100644 --- a/Source/Preprocessor/cpp.c +++ b/Source/Preprocessor/cpp.c @@ -74,7 +74,7 @@ static void copy_location(const DOH *s1, DOH *s2) { Setline(s2, Getline((DOH *) s1)); } -static String *cpp_include(String_or_char *fn, int sysfile) { +static String *cpp_include(const_String_or_char_ptr fn, int sysfile) { String *s = sysfile ? Swig_include_sys(fn) : Swig_include(fn); if (s && single_include) { String *file = Getfile(s); @@ -261,8 +261,9 @@ void Preprocessor_error_as_warning(int a) { * ----------------------------------------------------------------------------- */ -String_or_char *Macro_vararg_name(String_or_char *str, String_or_char *line) { - String_or_char *argname, *varargname; +const_String_or_char_ptr Macro_vararg_name(const_String_or_char_ptr str, const_String_or_char_ptr line) { + String *argname; + String *varargname; char *s, *dots; argname = Copy(str); @@ -288,13 +289,13 @@ String_or_char *Macro_vararg_name(String_or_char *str, String_or_char *line) { return varargname; } -Hash *Preprocessor_define(const String_or_char *_str, int swigmacro) { +Hash *Preprocessor_define(const_String_or_char_ptr _str, int swigmacro) { String *macroname = 0, *argstr = 0, *macrovalue = 0, *file = 0, *s = 0; Hash *macro = 0, *symbols = 0, *m1; List *arglist = 0; int c, line; int varargs = 0; - String_or_char *str = (String_or_char *) _str; + const_String_or_char_ptr str = (const_String_or_char_ptr ) _str; assert(cpp); assert(str); @@ -532,7 +533,7 @@ macro_error: * * Undefines a macro. * ----------------------------------------------------------------------------- */ -void Preprocessor_undef(const String_or_char *str) { +void Preprocessor_undef(const_String_or_char_ptr str) { Hash *symbols; assert(cpp); symbols = Getattr(cpp, kpp_symbols); diff --git a/Source/Preprocessor/preprocessor.h b/Source/Preprocessor/preprocessor.h index 4f7ff8804..3579eede2 100644 --- a/Source/Preprocessor/preprocessor.h +++ b/Source/Preprocessor/preprocessor.h @@ -19,8 +19,8 @@ extern "C" { #endif extern int Preprocessor_expr(String *s, int *error); extern char *Preprocessor_expr_error(void); - extern Hash *Preprocessor_define(const String_or_char *str, int swigmacro); - extern void Preprocessor_undef(const String_or_char *name); + extern Hash *Preprocessor_define(const_String_or_char_ptr str, int swigmacro); + extern void Preprocessor_undef(const_String_or_char_ptr name); extern void Preprocessor_init(void); extern void Preprocessor_delete(void); extern String *Preprocessor_parse(String *s); |
