pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:1593:    *! with the @tt{@i{<replacement string>@}@}.    *! And in the @tt{@i{<replacement string>@}@}, @tt{arg1@} and @tt{arg2@}    *! will be replaced with @tt{something1@} and @tt{something2@}.    */      static struct pike_string *make_define_name(struct CPP_struct *this,    const char *name)   {    if (this->prefix) {    struct string_builder s; -  int len = strlen(name); +        init_string_builder(&s, 0);    string_builder_append(&s, MKPCHARP_STR(this->prefix),    this->prefix->len);    string_builder_putchar(&s, '_'); -  string_builder_binary_strcat(&s, name, len); +  string_builder_strcat(&s, name);    return finish_string_builder(&s);    }    return make_shared_string(name);   }      static struct define_struct *do_magic_define(struct CPP_struct *this,    const char *name,    magic_define_fun fun)   {    struct define_struct* def;
pike.git/src/cpp.cmod:3533:    pop_n_elems(Pike_sp-save_sp);    break;    } else if (TYPEOF(Pike_sp[-1]) == PIKE_T_INT) {    cpp_error_sprintf(this, "Couldn't read include file \"%S\".",    new_file);    pop_n_elems(Pike_sp-save_sp);    break;    }       { -  char buffer[47]; +     struct pike_string *save_current_file;    INT_TYPE save_current_line;       save_current_file=this->current_file;    save_current_line=this->current_line;    copy_shared_string(this->current_file,new_file);    this->current_line=1;       string_builder_binary_strcat(&this->buf, "#line 1 ", 8);    PUSH_STRING_SHIFT(new_file->str, new_file->len,
pike.git/src/cpp.cmod:3587:    MKPCHARP_STR(Pike_sp[-1].u.string),    Pike_sp[-1].u.string->len,    flags&~(CPP_EXPECT_ENDIF | CPP_EXPECT_ELSE),    charset);    }       free_string(this->current_file);    this->current_file=save_current_file;    this->current_line=save_current_line;    -  sprintf(buffer,"\n#line %ld ", (long)this->current_line); -  string_builder_binary_strcat(&this->buf, buffer, strlen(buffer)); +  string_builder_sprintf(&this->buf, "\n#line %ld ", (long)this->current_line);    PUSH_STRING_SHIFT(this->current_file->str,    this->current_file->len,    this->current_file->size_shift,    &this->buf);    string_builder_putchar(&this->buf, '\n');    if ((include_mode & 2) && (pos < len)) {    /* NOTE: The rest of the current buffer has already been    * expanded once.    */    string_builder_append(&this->buf, ADD_PCHARP(data, pos), len - pos);