From 62f4b4fcf30a1032f4978432d58d1c4b66f4e5f2 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 2 Sep 2017 21:09:45 +0100 Subject: [PATCH] More warnings --- build/warning-check | 21 +++++++++------ src/actions.cpp | 9 ++++--- src/code_snippet.cpp | 54 +++++++++++++++++-------------------- src/document_state.cpp | 22 +++++++-------- src/document_state_impl.hpp | 6 ++--- src/files.cpp | 44 +++++++++++++++--------------- src/files.hpp | 16 +++++------ src/glob.cpp | 4 +-- src/id_generation.cpp | 24 ++++++++--------- src/id_xml.cpp | 2 +- src/iterator.hpp | 4 +-- src/post_process.cpp | 22 +++++++-------- src/stream.cpp | 4 +-- src/stream.hpp | 4 +-- src/template_stack.cpp | 16 +++++------ src/values.hpp | 2 +- 16 files changed, 129 insertions(+), 125 deletions(-) diff --git a/build/warning-check b/build/warning-check index 5ec5b15..be9fd41 100755 --- a/build/warning-check +++ b/build/warning-check @@ -1,5 +1,4 @@ #!/usr/bin/env bash -set -e cd $(dirname $0)/../src @@ -8,17 +7,23 @@ tmpfile=$(tempfile) CXX=${CXX:-g++} BOOST_ROOT=${BOOST_ROOT:-../../..} -ls *.cpp | while read filename +failure=0 + +for filename in *.cpp do set -x - $CXX -c -O0 -isystem $BOOST_ROOT $filename -o $tmpfile \ - -Werror -Wall -Wextra + if ! $CXX -c -O0 -isystem $BOOST_ROOT $filename -o $tmpfile \ + -pedantic -Wstrict-aliasing -fstrict-aliasing \ + -Werror -Wall -Wextra \ + -Wunused-parameter -Wshadow \ + -Wfloat-equal \ + -Wsign-promo -Wconversion -Wno-sign-conversion + then + failure=1 + fi - #-pedantic -Wstrict-aliasing -fstrict-aliasing \ - #-Wall -Wextra -Wunused-parameter -Wshadow \ - #-Wsign-promo -Wsign-conversion -Wconversion \ - #-Wfloat-equal set +x done rm $tmpfile +exit $failure diff --git a/src/actions.cpp b/src/actions.cpp index a146b85..4305e54 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -861,7 +861,8 @@ namespace quickbook if(hex_digits.size() == 2 && *first > '0' && *first <= '7') { using namespace std; - detail::print_char(strtol(hex_digits.c_str(), 0, 16), + detail::print_char( + (char) strtol(hex_digits.c_str(), 0, 16), state.phrase.get()); } else { @@ -1028,7 +1029,8 @@ namespace quickbook { attributes.insert(std::make_pair( "contentwidth", encoded_value(std::string( - svg_text.begin() + a + 1, svg_text.begin() + b)) + boost::next(svg_text.begin(), a + 1), + boost::next(svg_text.begin(), b))) )); } a = svg_text.find("height"); @@ -1039,7 +1041,8 @@ namespace quickbook { attributes.insert(std::make_pair( "contentdepth", encoded_value(std::string( - svg_text.begin() + a + 1, svg_text.begin() + b)) + boost::next(svg_text.begin(), a + 1), + boost::next(svg_text.begin(), b))) )); } } diff --git a/src/code_snippet.cpp b/src/code_snippet.cpp index 92051c7..39a88d6 100644 --- a/src/code_snippet.cpp +++ b/src/code_snippet.cpp @@ -63,7 +63,7 @@ namespace quickbook std::string id; bool start_code; string_iterator source_pos; - mapped_file_builder::pos start_pos; + mapped_file_builder::pos_type start_pos; boost::shared_ptr next; }; @@ -114,9 +114,7 @@ namespace quickbook definition(python_code_snippet_grammar const& self) { - actions_type& actions = self.actions; - - start_ = (*code_elements) [boost::bind(&actions_type::end_file, &actions, _1, _2)] + start_ = (*code_elements) [boost::bind(&actions_type::end_file, &self.actions, _1, _2)] ; identifier = @@ -124,11 +122,11 @@ namespace quickbook ; code_elements = - start_snippet [boost::bind(&actions_type::start_snippet, &actions, _1, _2)] - | end_snippet [boost::bind(&actions_type::end_snippet, &actions, _1, _2)] - | escaped_comment [boost::bind(&actions_type::escaped_comment, &actions, _1, _2)] - | pass_thru_comment [boost::bind(&actions_type::pass_thru, &actions, _1, _2)] - | ignore [boost::bind(&actions_type::append_code, &actions, _1, _2)] + start_snippet [boost::bind(&actions_type::start_snippet, &self.actions, _1, _2)] + | end_snippet [boost::bind(&actions_type::end_snippet, &self.actions, _1, _2)] + | escaped_comment [boost::bind(&actions_type::escaped_comment, &self.actions, _1, _2)] + | pass_thru_comment [boost::bind(&actions_type::pass_thru, &self.actions, _1, _2)] + | ignore [boost::bind(&actions_type::append_code, &self.actions, _1, _2)] | cl::anychar_p ; @@ -137,7 +135,7 @@ namespace quickbook >> !(cl::eol_p >> *cl::blank_p) >> "#[" >> *cl::blank_p - >> identifier [boost::bind(&actions_type::mark, &actions, _1, _2)] + >> identifier [boost::bind(&actions_type::mark, &self.actions, _1, _2)] >> *(cl::anychar_p - cl::eol_p) ; @@ -169,12 +167,12 @@ namespace quickbook escaped_comment = cl::confix_p( *cl::space_p >> "#`", - (*cl::anychar_p) [boost::bind(&actions_type::mark, &actions, _1, _2)], + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], (cl::eol_p | cl::end_p) ) | cl::confix_p( *cl::space_p >> "\"\"\"`", - (*cl::anychar_p) [boost::bind(&actions_type::mark, &actions, _1, _2)], + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], "\"\"\"" ) ; @@ -185,10 +183,10 @@ namespace quickbook = "#=" >> (cl::eps_p - '=') >> ( *(cl::anychar_p - cl::eol_p) >> (cl::eol_p | cl::end_p) - ) [boost::bind(&actions_type::mark, &actions, _1, _2)] + ) [boost::bind(&actions_type::mark, &self.actions, _1, _2)] | cl::confix_p( "\"\"\"=" >> (cl::eps_p - '='), - (*cl::anychar_p) [boost::bind(&actions_type::mark, &actions, _1, _2)], + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], "\"\"\"" ) ; @@ -219,9 +217,7 @@ namespace quickbook { definition(cpp_code_snippet_grammar const& self) { - actions_type& actions = self.actions; - - start_ = (*code_elements) [boost::bind(&actions_type::end_file, &actions, _1, _2)] + start_ = (*code_elements) [boost::bind(&actions_type::end_file, &self.actions, _1, _2)] ; identifier = @@ -229,11 +225,11 @@ namespace quickbook ; code_elements = - start_snippet [boost::bind(&actions_type::start_snippet, &actions, _1, _2)] - | end_snippet [boost::bind(&actions_type::end_snippet, &actions, _1, _2)] - | escaped_comment [boost::bind(&actions_type::escaped_comment, &actions, _1, _2)] - | ignore [boost::bind(&actions_type::append_code, &actions, _1, _2)] - | pass_thru_comment [boost::bind(&actions_type::pass_thru, &actions, _1, _2)] + start_snippet [boost::bind(&actions_type::start_snippet, &self.actions, _1, _2)] + | end_snippet [boost::bind(&actions_type::end_snippet, &self.actions, _1, _2)] + | escaped_comment [boost::bind(&actions_type::escaped_comment, &self.actions, _1, _2)] + | ignore [boost::bind(&actions_type::append_code, &self.actions, _1, _2)] + | pass_thru_comment [boost::bind(&actions_type::pass_thru, &self.actions, _1, _2)] | cl::anychar_p ; @@ -242,7 +238,7 @@ namespace quickbook >> !(cl::eol_p >> *cl::blank_p) >> "//[" >> *cl::blank_p - >> identifier [boost::bind(&actions_type::mark, &actions, _1, _2)] + >> identifier [boost::bind(&actions_type::mark, &self.actions, _1, _2)] >> *(cl::anychar_p - cl::eol_p) | *cl::blank_p @@ -250,7 +246,7 @@ namespace quickbook >> *cl::blank_p >> "/*[" >> *cl::space_p - >> identifier [boost::bind(&actions_type::mark, &actions, _1, _2)] + >> identifier [boost::bind(&actions_type::mark, &self.actions, _1, _2)] >> *cl::space_p >> "*/" >> *cl::blank_p @@ -258,7 +254,7 @@ namespace quickbook | "/*[" >> *cl::space_p - >> identifier [boost::bind(&actions_type::mark, &actions, _1, _2)] + >> identifier [boost::bind(&actions_type::mark, &self.actions, _1, _2)] >> *cl::space_p >> "*/" ; @@ -302,12 +298,12 @@ namespace quickbook escaped_comment = cl::confix_p( *cl::space_p >> "//`", - (*cl::anychar_p) [boost::bind(&actions_type::mark, &actions, _1, _2)], + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], (cl::eol_p | cl::end_p) ) | cl::confix_p( *cl::space_p >> "/*`", - (*cl::anychar_p) [boost::bind(&actions_type::mark, &actions, _1, _2)], + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], "*/" ) ; @@ -318,10 +314,10 @@ namespace quickbook = "//=" >> (cl::eps_p - '=') >> ( *(cl::anychar_p - cl::eol_p) >> (cl::eol_p | cl::end_p) - ) [boost::bind(&actions_type::mark, &actions, _1, _2)] + ) [boost::bind(&actions_type::mark, &self.actions, _1, _2)] | cl::confix_p( "/*=" >> (cl::eps_p - '='), - (*cl::anychar_p) [boost::bind(&actions_type::mark, &actions, _1, _2)], + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], "*/" ) ; diff --git a/src/document_state.cpp b/src/document_state.cpp index 24bf649..4f12108 100644 --- a/src/document_state.cpp +++ b/src/document_state.cpp @@ -106,22 +106,22 @@ namespace quickbook document_state::~document_state() {} void document_state::start_file( - unsigned compatibility_version, + unsigned compatibility_version_, quickbook::string_view include_doc_id, quickbook::string_view id, - value const& title) + value const& title_) { - state->start_file(compatibility_version, false, include_doc_id, id, title); + state->start_file(compatibility_version_, false, include_doc_id, id, title_); } std::string document_state::start_file_with_docinfo( - unsigned compatibility_version, + unsigned compatibility_version_, quickbook::string_view include_doc_id, quickbook::string_view id, - value const& title) + value const& title_) { - return state->start_file(compatibility_version, true, include_doc_id, - id, title)->to_string(); + return state->start_file(compatibility_version_, true, include_doc_id, + id, title_)->to_string(); } void document_state::end_file() @@ -130,10 +130,10 @@ namespace quickbook } std::string document_state::begin_section( - value const& explicit_id, quickbook::string_view id, + value const& explicit_id_, quickbook::string_view id, id_category category, source_mode_info const& source_mode) { - return state->begin_section(explicit_id, id, category, source_mode) + return state->begin_section(explicit_id_, id, category, source_mode) ->to_string(); } @@ -197,7 +197,7 @@ namespace quickbook // id_placeholder::id_placeholder( - unsigned index_, + std::size_t index_, quickbook::string_view id_, id_category category_, id_placeholder const* parent_) @@ -235,7 +235,7 @@ namespace quickbook if (value.size() <= 1 || *value.begin() != '$') return 0; - unsigned index = boost::lexical_cast(std::string( + unsigned index = boost::lexical_cast(std::string( value.begin() + 1, value.end())); return &placeholders.at(index); diff --git a/src/document_state_impl.hpp b/src/document_state_impl.hpp index 96258b7..8b428e2 100644 --- a/src/document_state_impl.hpp +++ b/src/document_state_impl.hpp @@ -30,7 +30,7 @@ namespace quickbook struct id_placeholder { - unsigned index; // The index in document_state_impl::placeholders. + std::size_t index; // The index in document_state_impl::placeholders. // Use for the dollar identifiers in // intermediate xml. std::string id; // The node id. @@ -41,12 +41,12 @@ namespace quickbook id_placeholder const* parent; // Placeholder of the parent id. id_category category; - unsigned num_dots; // Number of dots in the id. + std::ptrdiff_t num_dots; // Number of dots in the id. // Normally equal to the section level // but not when an explicit id contains // dots. - id_placeholder(unsigned index, quickbook::string_view id, + id_placeholder(std::size_t index, quickbook::string_view id, id_category category, id_placeholder const* parent_); std::string to_string() const; diff --git a/src/files.cpp b/src/files.cpp index bb966d5..0ee2811 100644 --- a/src/files.cpp +++ b/src/files.cpp @@ -414,7 +414,7 @@ namespace quickbook return data->new_file->source().empty(); } - mapped_file_builder::pos mapped_file_builder::get_pos() const + mapped_file_builder::pos_type mapped_file_builder::get_pos() const { return data->new_file->source().size(); } @@ -437,7 +437,7 @@ namespace quickbook } void mapped_file_builder::add(mapped_file_builder const& x, - pos begin, pos end) + pos_type begin, pos_type end) { assert(data->new_file->original == x.data->new_file->original); assert(begin <= x.data->new_file->source_.size()); @@ -445,22 +445,22 @@ namespace quickbook if (begin != end) { - std::vector::const_iterator start = + std::vector::const_iterator i = x.data->new_file->find_section( x.data->new_file->source().begin() + begin); std::string::size_type size = data->new_file->source_.size(); data->new_file->mapped_sections.push_back(mapped_file_section( - x.data->new_file->to_original_pos(start, begin), - size, start->section_type)); + x.data->new_file->to_original_pos(i, begin), + size, i->section_type)); - for (++start; start != x.data->new_file->mapped_sections.end() && - start->our_pos < end; ++start) + for (++i; i != x.data->new_file->mapped_sections.end() && + i->our_pos < end; ++i) { data->new_file->mapped_sections.push_back(mapped_file_section( - start->original_pos, start->our_pos - begin + size, - start->section_type)); + i->original_pos, i->our_pos - begin + size, + i->section_type)); } data->new_file->source_.append( @@ -500,20 +500,20 @@ namespace quickbook std::string const program(x.begin(), x.end()); // Erase leading blank lines and newlines: - std::string::size_type start = program.find_first_not_of(" \t\r\n"); - if (start == std::string::npos) return; + std::string::size_type text_start = program.find_first_not_of(" \t\r\n"); + if (text_start == std::string::npos) return; - start = program.find_last_of("\r\n", start); - start = start == std::string::npos ? 0 : start + 1; + text_start = program.find_last_of("\r\n", text_start); + text_start = text_start == std::string::npos ? 0 : text_start + 1; - assert(start < program.size()); + assert(text_start < program.size()); // Get the first line indentation - std::string::size_type indent = program.find_first_not_of(" \t", start) - start; + std::string::size_type indent = program.find_first_not_of(" \t", text_start) - text_start; quickbook::string_view::size_type full_indent = indentation_count( - quickbook::string_view(&program[start], indent)); + quickbook::string_view(&program[text_start], indent)); - std::string::size_type pos = start; + std::string::size_type pos = text_start; // Calculate the minimum indent from the rest of the lines // Detecting a mix of spaces and tabs. @@ -535,8 +535,8 @@ namespace quickbook // Detect if indentation is mixed. bool mixed_indentation = false; - quickbook::string_view first_indent(&program[start], indent); - pos = start; + quickbook::string_view first_indent(&program[text_start], indent); + pos = text_start; while (std::string::npos != (pos = program.find_first_of("\r\n", pos))) { @@ -554,8 +554,8 @@ namespace quickbook // Trim white spaces from column 0..indent std::string unindented_program; - std::string::size_type copy_start = start; - pos = start; + std::string::size_type copy_start = text_start; + pos = text_start; do { if (std::string::npos == (pos = program.find_first_not_of("\r\n", pos))) @@ -570,7 +570,7 @@ namespace quickbook if (mixed_indentation) { - unsigned length = indentation_count(quickbook::string_view( + string_view::size_type length = indentation_count(quickbook::string_view( &program[pos], next - pos)); if (length > full_indent) { diff --git a/src/files.hpp b/src/files.hpp index 56a19a0..647d6af 100644 --- a/src/files.hpp +++ b/src/files.hpp @@ -29,10 +29,10 @@ namespace quickbook { struct file_position { file_position() : line(1), column(1) {} - file_position(int l, int c) : line(l), column(c) {} + file_position(std::ptrdiff_t l, std::ptrdiff_t c) : line(l), column(c) {} - int line; - int column; + std::ptrdiff_t line; + std::ptrdiff_t column; bool operator==(file_position const& other) const { @@ -67,8 +67,8 @@ namespace quickbook { ref_count(0) {} - file(file const& f, quickbook::string_view source) : - path(f.path), source_(source.begin(), source.end()), + explicit file(file const& f, quickbook::string_view s) : + path(f.path), source_(s.begin(), s.end()), is_code_snippets(f.is_code_snippets), qbk_version(f.qbk_version), ref_count(0) {} @@ -116,7 +116,7 @@ namespace quickbook { struct mapped_file_builder { typedef string_iterator iterator; - typedef quickbook::string_view::size_type pos; + typedef quickbook::string_view::size_type pos_type; mapped_file_builder(); ~mapped_file_builder(); @@ -126,12 +126,12 @@ namespace quickbook { void clear(); bool empty() const; - pos get_pos() const; + pos_type get_pos() const; void add_at_pos(quickbook::string_view, iterator); void add(quickbook::string_view); void add(mapped_file_builder const&); - void add(mapped_file_builder const&, pos, pos); + void add(mapped_file_builder const&, pos_type, pos_type); void unindent_and_add(quickbook::string_view); private: mapped_file_builder_data* data; diff --git a/src/glob.cpp b/src/glob.cpp index 89078b7..b8d34c6 100644 --- a/src/glob.cpp +++ b/src/glob.cpp @@ -19,7 +19,7 @@ namespace quickbook bool match_section(glob_iterator& pattern_begin, glob_iterator pattern_end, glob_iterator& filename_begin, glob_iterator& filename_end); bool match_range(glob_iterator& pattern_begin, glob_iterator pattern_end, - unsigned char x); + char x); bool check_glob(quickbook::string_view pattern) { @@ -203,7 +203,7 @@ namespace quickbook } bool match_range(glob_iterator& pattern_begin, glob_iterator pattern_end, - unsigned char x) + char x) { assert(pattern_begin != pattern_end && *pattern_begin == '['); ++pattern_begin; diff --git a/src/id_generation.cpp b/src/id_generation.cpp index b107edc..f4aa036 100644 --- a/src/id_generation.cpp +++ b/src/id_generation.cpp @@ -73,7 +73,7 @@ namespace quickbook { { std::vector& order; - placeholder_compare(std::vector& order) : order(order) {} + placeholder_compare(std::vector& order_) : order(order_) {} bool operator()(id_placeholder const* x, id_placeholder const* y) const { @@ -95,10 +95,10 @@ namespace quickbook { std::vector& order; unsigned count; - get_placeholder_order_callback(document_state_impl const& state, - std::vector& order) - : state(state), - order(order), + get_placeholder_order_callback(document_state_impl const& state_, + std::vector& order_) + : state(state_), + order(order_), count(0) {} @@ -146,8 +146,8 @@ namespace quickbook { chosen_id_map chosen_ids; std::vector& generated_ids; - generate_id_block_type(std::vector& generated_ids) : - generated_ids(generated_ids) {} + explicit generate_id_block_type(std::vector& generated_ids_) : + generated_ids(generated_ids_) {} void generate(placeholder_index::iterator begin, placeholder_index::iterator end); @@ -227,7 +227,7 @@ namespace quickbook { // Since we're adding digits, don't want an id that ends in // a digit. - unsigned int length = base_id.size(); + std::string::size_type length = base_id.size(); if (length > 0 && std::isdigit(base_id[length - 1])) { if (length < max_size - 1) { @@ -290,10 +290,10 @@ namespace quickbook { string_iterator source_pos; std::string result; - replace_ids_callback(document_state_impl const& state, - std::vector const* ids) - : state(state), - ids(ids), + replace_ids_callback(document_state_impl const& state_, + std::vector const* ids_) + : state(state_), + ids(ids_), source_pos(), result() {} diff --git a/src/id_xml.cpp b/src/id_xml.cpp index f8b1f79..e220f66 100644 --- a/src/id_xml.cpp +++ b/src/id_xml.cpp @@ -25,7 +25,7 @@ namespace quickbook xml_processor::xml_processor() { - static int const n_id_attributes = sizeof(id_attributes_)/sizeof(char const*); + static std::size_t const n_id_attributes = sizeof(id_attributes_)/sizeof(char const*); for (int i = 0; i != n_id_attributes; ++i) { id_attributes.push_back(id_attributes_[i]); diff --git a/src/iterator.hpp b/src/iterator.hpp index fdadfc4..9b138e4 100644 --- a/src/iterator.hpp +++ b/src/iterator.hpp @@ -28,8 +28,8 @@ namespace quickbook > { lookback_iterator() {} - explicit lookback_iterator(Iterator base) - : original_(base), base_(base) {} + explicit lookback_iterator(Iterator i) + : original_(i), base_(i) {} friend bool operator==( lookback_iterator const& x, diff --git a/src/post_process.cpp b/src/post_process.cpp index fac6c13..341ae2c 100644 --- a/src/post_process.cpp +++ b/src/post_process.cpp @@ -20,9 +20,9 @@ namespace quickbook struct printer { - printer(std::string& out, int& current_indent, int linewidth) - : prev(0), out(out), current_indent(current_indent) , column(0) - , in_string(false), linewidth(linewidth) {} + printer(std::string& out_, int& current_indent_, int linewidth_) + : prev(0), out(out_), current_indent(current_indent_) , column(0) + , in_string(false), linewidth(linewidth_) {} void indent() { @@ -228,17 +228,17 @@ namespace quickbook struct tidy_compiler { - tidy_compiler(std::string& out, int linewidth) - : out(out), current_indent(0), printer_(out, current_indent, linewidth) + tidy_compiler(std::string& out_, int linewidth_) + : out(out_), current_indent(0), printer_(out, current_indent, linewidth_) { - static int const n_block_tags = sizeof(block_tags_)/sizeof(char const*); - for (int i = 0; i != n_block_tags; ++i) + static std::size_t const n_block_tags = sizeof(block_tags_)/sizeof(char const*); + for (std::size_t i = 0; i != n_block_tags; ++i) { block_tags.insert(block_tags_[i]); } - static int const n_doc_types = sizeof(doc_types_)/sizeof(char const*); - for (int i = 0; i != n_doc_types; ++i) + static std::size_t const n_doc_types = sizeof(doc_types_)/sizeof(char const*); + for (std::size_t i = 0; i != n_doc_types; ++i) { block_tags.insert(doc_types_[i]); block_tags.insert(doc_types_[i] + std::string("info")); @@ -261,8 +261,8 @@ namespace quickbook struct tidy_grammar : cl::grammar { - tidy_grammar(tidy_compiler& state, int indent) - : state(state), indent(indent) {} + tidy_grammar(tidy_compiler& state_, int indent_) + : state(state_), indent(indent_) {} template struct definition diff --git a/src/stream.cpp b/src/stream.cpp index 33ff545..05241d0 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -86,7 +86,7 @@ namespace detail { return error_stream() << "Error: "; } - ostream& outerr(fs::path const& file, int line) + ostream& outerr(fs::path const& file, std::ptrdiff_t line) { if (line >= 0) { @@ -106,7 +106,7 @@ namespace detail { return outerr(f->path, f->position_of(pos).line); } - ostream& outwarn(fs::path const& file, int line) + ostream& outwarn(fs::path const& file, std::ptrdiff_t line) { if (line >= 0) { diff --git a/src/stream.hpp b/src/stream.hpp index 1e32bda..380711b 100644 --- a/src/stream.hpp +++ b/src/stream.hpp @@ -75,8 +75,8 @@ namespace quickbook // error message. void set_ms_errors(bool); ostream& outerr(); - ostream& outerr(fs::path const& file, int line = -1); - ostream& outwarn(fs::path const& file, int line = -1); + ostream& outerr(fs::path const& file, std::ptrdiff_t line = -1); + ostream& outwarn(fs::path const& file, std::ptrdiff_t line = -1); ostream& outerr(file_ptr const&, string_iterator); ostream& outwarn(file_ptr const&, string_iterator); } diff --git a/src/template_stack.cpp b/src/template_stack.cpp index fba7255..901d12a 100644 --- a/src/template_stack.cpp +++ b/src/template_stack.cpp @@ -18,14 +18,14 @@ namespace quickbook { template_symbol::template_symbol( - std::string const& identifier, - std::vector const& params, - value const& content, - template_scope const* lexical_parent) - : identifier(identifier) - , params(params) - , content(content) - , lexical_parent(lexical_parent) + std::string const& identifier_, + std::vector const& params_, + value const& content_, + template_scope const* lexical_parent_) + : identifier(identifier_) + , params(params_) + , content(content_) + , lexical_parent(lexical_parent_) { assert(content.get_tag() == template_tags::block || content.get_tag() == template_tags::phrase || diff --git a/src/values.hpp b/src/values.hpp index ea6b02a..7bcca41 100644 --- a/src/values.hpp +++ b/src/values.hpp @@ -109,7 +109,7 @@ namespace quickbook iterator end() const; // Item accessors - int get_tag() const { return value_->tag_; } + tag_type get_tag() const { return value_->tag_; } file_ptr get_file() const { return value_->get_file(); } string_iterator get_position() const