Parent Directory
|
Revision Log
|
Patch
revision 100 by johnpye, Thu Dec 8 16:20:25 2005 UTC | revision 101 by jds, Sat Dec 10 04:22:07 2005 UTC | |
---|---|---|
# | Line 118 struct bt_data { | Line 118 struct bt_data { |
118 | } g_bt_data = {NULL,0,0,NULL,0,"ERRARCHIVE",NULL,NULL,NULL,NULL,NULL,1,0,0}; | } g_bt_data = {NULL,0,0,NULL,0,"ERRARCHIVE",NULL,NULL,NULL,NULL,NULL,1,0,0}; |
119 | ||
120 | /** | /** |
121 | I can't work out how to fix the warning here. In the C++ interface, I need | * In the C++ interface, the arguments of BinTokenSetOptions need to be |
122 | the arguments of BinTokenSetOptions to be const char*. But here, new can | * const char*. But here, new can lose its constness in *ptr = new. - JP |
lose its constness in *ptr = new. | ||
123 | */ | */ |
124 | static | static |
125 | int bt_string_replace(CONST char *new, char **ptr) | int bt_string_replace(CONST char *new, char **ptr) |
126 | { | { |
127 | if (*ptr == new) { | if (*ptr == new) { |
128 | return 0; | return 0; |
129 | } | } |
130 | if (new == NULL) { | if (new == NULL) { |
131 | if (*ptr != NULL) { | if (*ptr != NULL) { |
# | Line 137 int bt_string_replace(CONST char *new, c | Line 136 int bt_string_replace(CONST char *new, c |
136 | if (*ptr != NULL) { | if (*ptr != NULL) { |
137 | ascfree(*ptr); | ascfree(*ptr); |
138 | } | } |
139 | *ptr = new; | *ptr = (char *)new; |
140 | } | } |
141 | return 0; | return 0; |
142 | } | } |
143 | ||
144 | /* | /* |
145 | * Set the configurations for building code. | * Set the configurations for building code. |
146 | * The string arguments given are kept. | * The string arguments given are kept. |
|
john.pye@anu.edu.au | ViewVC Help |
Powered by ViewVC 1.1.22 |