gu_string_buf -> gu_new_string_buf in libgu

This commit is contained in:
krasimir
2017-04-13 13:43:48 +00:00
parent e650b9c5fc
commit 2588a6f016
10 changed files with 26 additions and 26 deletions

View File

@@ -50,7 +50,7 @@ gu_string_buf_end(GuOutStream* stream, size_t sz, GuExn* err)
}
GuStringBuf*
gu_string_buf(GuPool* pool)
gu_new_string_buf(GuPool* pool)
{
GuStringBuf* sbuf = gu_new(GuStringBuf, pool);
sbuf->stream.output = gu_string_buf_output;
@@ -152,7 +152,7 @@ GuString
gu_format_string_v(const char* fmt, va_list args, GuPool* pool)
{
GuPool* tmp_pool = gu_local_pool();
GuStringBuf* sb = gu_string_buf(tmp_pool);
GuStringBuf* sb = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sb);
gu_vprintf(fmt, args, out, NULL);
gu_out_flush(out, NULL);

View File

@@ -25,7 +25,7 @@ gu_string_in(GuString string, GuPool* pool);
typedef struct GuStringBuf GuStringBuf;
GuStringBuf*
gu_string_buf(GuPool* pool);
gu_new_string_buf(GuPool* pool);
GuOut*
gu_string_buf_out(GuStringBuf* sb);

View File

@@ -210,7 +210,7 @@ pgf_align_words(PgfConcr* concr, PgfExpr expr,
.parent_current = gu_new_buf(int, tmp_pool),
.phrases = phrases,
.last_phrase = NULL,
.sbuf = gu_string_buf(tmp_pool),
.sbuf = gu_new_string_buf(tmp_pool),
.n_matches = 0,
.err = err,
.bind = true,

View File

@@ -350,7 +350,7 @@ pgf_expr_parser_token(PgfExprParser* parser)
case '\'':
pgf_expr_parser_getc(parser);
GuStringBuf* chars = gu_string_buf(parser->tmp_pool);
GuStringBuf* chars = gu_new_string_buf(parser->tmp_pool);
while (parser->ch != '\'' && parser->ch != EOF) {
if (parser->ch == '\\') {
pgf_expr_parser_getc(parser);
@@ -366,7 +366,7 @@ pgf_expr_parser_token(PgfExprParser* parser)
}
break;
default: {
GuStringBuf* chars = gu_string_buf(parser->tmp_pool);
GuStringBuf* chars = gu_new_string_buf(parser->tmp_pool);
if (pgf_is_ident_first(parser->ch)) {
do {

View File

@@ -460,7 +460,7 @@ pgf_cnc_resolve(PgfCnc* cnc,
GuPool* tmp_pool = gu_local_pool();
GuExn* err = gu_new_exn(tmp_pool);
GuStringBuf* sbuf = gu_string_buf(tmp_pool);
GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
gu_putc('[', out, err);
@@ -1209,7 +1209,7 @@ pgf_get_tokens(PgfSymbols* syms, uint16_t sym_idx, GuPool* pool)
{
GuPool* tmp_pool = gu_new_pool();
GuExn* err = gu_new_exn(tmp_pool);
GuStringBuf* sbuf = gu_string_buf(tmp_pool);
GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
PgfSimpleLin flin = {

View File

@@ -234,7 +234,7 @@ pgf_match_name_lit(PgfLiteralCallback* self, PgfConcr* concr,
return NULL;
GuPool* tmp_pool = gu_local_pool();
GuStringBuf *sbuf = gu_string_buf(tmp_pool);
GuStringBuf *sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_new_exn(tmp_pool);
@@ -361,7 +361,7 @@ pgf_match_unknown_lit(PgfLiteralCallback* self, PgfConcr* concr,
GuUCS ucs = gu_utf8_decode(&p);
if (!gu_ucs_is_upper(ucs)) {
GuPool* tmp_pool = gu_local_pool();
GuStringBuf *sbuf = gu_string_buf(tmp_pool);
GuStringBuf *sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_new_exn(tmp_pool);

View File

@@ -150,7 +150,7 @@ pgf_parseval(PgfConcr* concr, PgfExpr expr, PgfType* type,
}
GuStringBuf* sbuf =
gu_string_buf(pool);
gu_new_string_buf(pool);
PgfMetricsLznState state;
state.bind = true;

View File

@@ -101,7 +101,7 @@ pgf_tc_mk_print_context(PgfTypeChecker* checker, PgfContext* ctxt)
static void
pgf_tc_err_cannot_infer(PgfTypeChecker* checker, PgfContext* ctxt, PgfExpr e)
{
GuStringBuf* sbuf = gu_string_buf(checker->tmp_pool);
GuStringBuf* sbuf = gu_new_string_buf(checker->tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_exn(checker->tmp_pool);
@@ -117,7 +117,7 @@ static void
pgf_tc_err_exp_fun_type_1(PgfTypeChecker* checker, PgfContext* ctxt,
PgfExpr e, PgfType* ty)
{
GuStringBuf* sbuf = gu_string_buf(checker->tmp_pool);
GuStringBuf* sbuf = gu_new_string_buf(checker->tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_exn(checker->tmp_pool);
@@ -137,7 +137,7 @@ static void
pgf_tc_err_exp_fun_type_2(PgfTypeChecker* checker, PgfContext* ctxt,
PgfExpr e, PgfType* ty)
{
GuStringBuf* sbuf = gu_string_buf(checker->tmp_pool);
GuStringBuf* sbuf = gu_new_string_buf(checker->tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_exn(checker->tmp_pool);
@@ -170,7 +170,7 @@ pgf_tc_err_type_mismatch(PgfTypeChecker* checker,
PgfContext* ctxt,
PgfExpr e, PgfCFType ty1, PgfCFType ty2)
{
GuStringBuf* sbuf = gu_string_buf(checker->tmp_pool);
GuStringBuf* sbuf = gu_new_string_buf(checker->tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_exn(checker->tmp_pool);