pike.git/
src/
cpp.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2018-03-21
2018-03-21 15:38:18 by Henrik Grubbström (Grubba) <grubba@grubba.org>
bead0b71f59332a0c8840897c58b1fbfe5e911a3 (
37
lines) (+
19
/-
18
)
[
Show
|
Annotate
]
Branch:
master
Cpp: Let the stack hold the reference to the input string.
Some code cleanup.
376:
PIKEVAR object compat_handler; PIKEVAR int compat_major; PIKEVAR int compat_minor;
-
/* NB: data is marked private to ensure that pike level code can't
-
* remove its references while we hold pointers into it.
-
*/
-
PIKEVAR string data flags ID_PRIVATE|ID_PROTECTED;
+
PIKEVAR string prefix; PIKEVAR int picky_cpp; PIKEVAR int keep_comments;
5207:
free_mapping (predefs); }
-
this->data = data;
-
add_ref(data);
-
+
if (this->charset) {
-
push_string(data);
-
this->data = data = NULL;
+
ref_
push_string(data);
ref_push_string(this->charset); if (!safe_apply_handler ("decode_charset", this->handler, this->compat_handler, 2, BIT_STRING)) {
5220:
THIS->charset); Pike_error("Unknown charset.\n"); }
-
this->
data =
data =
Pike_sp[-1].u.string;
-
Pike_sp--;
-
dmalloc
_
touch_svalue(Pike_
sp
);
+
data = Pike_sp[-1].u.string;
+
/* NB: We let the stack hold the references to data.
+
* We don't need to keep track of the number of elements
+
* on the stack as we have the save
_sp
marker.
+
*/
} if (this->auto_convert && (!data->size_shift) && (data->len > 1)) { /* Try to determine if we need to recode the string */
-
struct pike_string *new_
data = recode_string(this, data);
-
free
_string(data);
-
this->data
=
data
=
new
_
data;
+
data = recode_string(this, data);
+
push
_string(data);
+
/*
NB:
We let the stack hold the references to
data
.
+
* We don't need to keep track of the number of elements
+
* on the stack as we have the save
_
sp marker.
+
*/
} if (data->size_shift) { /* Get rid of any byte order marks (0xfeff) */
-
struct pike_string *new_
data = filter_bom(data);
-
free
_string(data);
-
this->data
=
data
=
new
_
data;
+
data = filter_bom(data);
+
push
_string(data);
+
/*
NB:
We let the stack hold the references to
data
.
+
* We don't need to keep track of the number of elements
+
* on the stack as we have the save
_
sp marker.
+
*/
} string_builder_binary_strcat(&this->buf, "#line 1 ", 8);