pike.git/
src/
stralloc.c
Branch:
Tag:
Non-build tags
All tags
No tags
2009-01-06
2009-01-06 10:04:24 by Stephen R. van den Berg <srb@cuci.nl>
058cc44b38d33dedbc4d326a7b2152c207424844 (
19
lines) (+
8
/-
11
)
[
Show
|
Annotate
]
Branch:
7.9
Simplify string_builder_init.
Rev: src/stralloc.c:1.234
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: stralloc.c,v 1.
233
2008
/
11
/
05
15
:
03
:
39
grubba
Exp $
+
|| $Id: stralloc.c,v 1.
234
2009
/
01
/
06
10
:
04
:
24
srb
Exp $
*/ #include "global.h"
2233:
return next; }
-
PMOD_EXPORT void init_string_builder(struct string_builder *s, int mag)
+
PMOD_EXPORT void init_string_builder
_alloc
(struct string_builder *s,
ptrdiff_t length,
int mag)
{
-
s->
malloced=256;
-
s
->s
=begin_wide_shared_string(
256
,mag);
+
s->s=begin_wide_shared_string(
length
,mag);
+
s->malloced=length;
+
s->known_shift=0;
s->s->len=0; low_set_index (s->s, 0, 0);
-
s->known_shift=0;
+
}
-
PMOD_EXPORT void init_string_builder
_alloc
(struct string_builder *s,
ptrdiff_t length,
int mag)
+
PMOD_EXPORT void init_string_builder(struct string_builder *s, int mag)
{
-
s->malloced=length;
-
s->s=begin
_
wide_shared_
string
(length,mag);
-
s->s->len=0;
-
low
_
set
_
index
(s
->s
,
0
,
0
);
-
s->known_shift=0;
+
init
_string_
builder
_
alloc
(s,
256
,
mag
);
} PMOD_EXPORT void init_string_builder_copy(struct string_builder *to,