clang-format -

+QualifierAlignment: Right
+Standard: c++20
This commit is contained in:
Artem Pavlenko 2025-07-14 14:49:23 +01:00
parent e5b221f38d
commit e61128056f
297 changed files with 1384 additions and 1384 deletions

View File

@ -64,16 +64,16 @@ KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PackConstructorInitializers: Never # only clang-format > 14
PackConstructorInitializers: Never
PointerAlignment: Left
#QualifierAlignment: Left # only clang-format > 14
QualifierAlignment: Right
ReferenceAlignment: Left
ReflowComments: true
SortIncludes: Never
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeInheritanceColon: true
Standard: c++14
Standard: c++20
BinPackParameters: false
BreakBeforeInheritanceComma: false
IncludeCategories:

View File

@ -54,7 +54,7 @@ inline int parse_args(int argc, char** argv, mapnik::parameters& params)
{
for (int i = 1; i < argc; ++i)
{
const char* opt = argv[i];
char const* opt = argv[i];
if (opt[0] != '-')
{
// non-option argument, return its index
@ -145,14 +145,14 @@ struct big_number_fmt
{
int w;
double v;
const char* u;
char const* u;
big_number_fmt(int width, double value, int base = 1000)
: w(width),
v(value),
u("")
{
static const char* suffixes = "\0\0k\0M\0G\0T\0P\0E\0Z\0Y\0\0";
static char const* suffixes = "\0\0k\0M\0G\0T\0P\0E\0Z\0Y\0\0";
u = suffixes;
while (v > 1 && std::log10(std::round(v)) >= width && u[2])

View File

@ -21,8 +21,8 @@ bool compare_images(std::string const& src_fn, std::string const& dest_fn)
throw mapnik::image_reader_exception("Failed to load: " + src_fn);
}
const mapnik::image_any desc_any = reader1->read(0, 0, reader1->width(), reader1->height());
const mapnik::image_any src_any = reader2->read(0, 0, reader2->width(), reader2->height());
mapnik::image_any const desc_any = reader1->read(0, 0, reader1->width(), reader1->height());
mapnik::image_any const src_any = reader2->read(0, 0, reader2->width(), reader2->height());
mapnik::image_rgba8 const& dest = mapnik::util::get<mapnik::image_rgba8>(desc_any);
mapnik::image_rgba8 const& src = mapnik::util::get<mapnik::image_rgba8>(src_any);

View File

@ -26,14 +26,14 @@ class test : public benchmark::test_case
scale_factor_(*params.get<mapnik::value_double>("scale_factor", 1.0)),
preview_(*params.get<std::string>("preview", ""))
{
const auto map = params.get<std::string>("map");
auto const map = params.get<std::string>("map");
if (!map)
{
throw std::runtime_error("please provide a --map <path to xml> arg");
}
xml_ = *map;
const auto ext = params.get<std::string>("extent");
auto const ext = params.get<std::string>("extent");
if (ext && !ext->empty())
{
if (!extent_.from_string(*ext))
@ -101,7 +101,7 @@ int main(int argc, char** argv)
{
mapnik::parameters params;
benchmark::handle_args(argc, argv, params);
const auto name = params.get<std::string>("name");
auto const name = params.get<std::string>("name");
if (!name)
{
std::clog << "please provide a name for this test\n";

View File

@ -64,7 +64,7 @@ class test : public benchmark::test_case
preview_(*params.get<std::string>("preview", "")),
im_(m_->width(), m_->height())
{
const auto map = params.get<std::string>("map");
auto const map = params.get<std::string>("map");
if (!map)
{
throw std::runtime_error("please provide a --map=<path to xml> arg");
@ -133,8 +133,8 @@ class test : public benchmark::test_case
mapnik::image_rgba8 const& src = im_;
for (unsigned int y = 0; y < height_; ++y)
{
const unsigned int* row_from = src.get_row(y);
const unsigned int* row_to = dest.get_row(y);
unsigned int const* row_from = src.get_row(y);
unsigned int const* row_to = dest.get_row(y);
for (unsigned int x = 0; x < width_; ++x)
{
if (row_from[x] != row_to[x])
@ -156,7 +156,7 @@ int main(int argc, char** argv)
{
mapnik::parameters params;
benchmark::handle_args(argc, argv, params);
const auto name = params.get<std::string>("name");
auto const name = params.get<std::string>("name");
if (!name)
{
std::clog << "please provide a name for this test\n";

View File

@ -49,9 +49,9 @@
int main(int, char**)
{
using namespace mapnik;
const std::string srs_lcc =
std::string const srs_lcc =
"+proj=lcc +ellps=GRS80 +lat_0=49 +lon_0=-95 +lat+1=49 +lat_2=77 +datum=NAD83 +units=m +no_defs";
const std::string srs_merc = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 "
std::string const srs_merc = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 "
"+units=m +nadgrids=@null +wktext +no_defs +over";
mapnik::setup();
try

View File

@ -42,7 +42,7 @@ void LayerDelegate::paint(QPainter* painter, QStyleOptionViewItem const& option,
painter->setBrush(QBrush(QColor(255, 120, 0, 127)));
}
QSize LayerDelegate::sizeHint(const QStyleOptionViewItem& /* option */, const QModelIndex& /* index */) const
QSize LayerDelegate::sizeHint(QStyleOptionViewItem const& /* option */, QModelIndex const& /* index */) const
{
return QSize(120, 24);
}

View File

@ -35,8 +35,8 @@ class LayerDelegate : public QAbstractItemDelegate
public:
LayerDelegate(QObject* parent = 0);
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
void paint(QPainter* painter, QStyleOptionViewItem const& option, QModelIndex const& index) const;
QSize sizeHint(QStyleOptionViewItem const& option, QModelIndex const& index) const;
};
#endif // LAYER_DELEGATE_HPP

View File

@ -87,7 +87,7 @@ QVariant LayerListModel::headerData(int section, Qt::Orientation orientation, in
return QString("TODO Row %1").arg(section);
}
bool LayerListModel::setData(const QModelIndex& index, const QVariant& value, int role)
bool LayerListModel::setData(QModelIndex const& index, QVariant const& value, int role)
{
if (!map_)
return false;

View File

@ -33,10 +33,10 @@ class LayerListModel : public QAbstractListModel
Q_OBJECT
public:
LayerListModel(std::shared_ptr<mapnik::Map> map, QObject* parent = 0);
int rowCount(const QModelIndex& parent = QModelIndex()) const;
QVariant data(const QModelIndex& index, int role) const;
int rowCount(QModelIndex const& parent = QModelIndex()) const;
QVariant data(QModelIndex const& index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
bool setData(QModelIndex const& index, QVariant const& value, int role = Qt::EditRole);
Qt::ItemFlags flags(QModelIndex const& index) const;
boost::optional<mapnik::layer&> map_layer(int i);

View File

@ -40,13 +40,13 @@ void LayerTab::paintEvent(QPaintEvent* e)
QListView::paintEvent(e);
}
void LayerTab::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int>& roles)
void LayerTab::dataChanged(QModelIndex const& topLeft, QModelIndex const& bottomRight, QVector<int> const& roles)
{
emit update_mapwidget();
QListView::dataChanged(topLeft, bottomRight, roles);
}
void LayerTab::selectionChanged(const QItemSelection& selected, const QItemSelection&)
void LayerTab::selectionChanged(QItemSelection const& selected, QItemSelection const&)
{
QModelIndexList list = selected.indexes();
if (list.size() != 0)

View File

@ -37,8 +37,8 @@ class LayerTab : public QListView
void layerInfo();
void layerInfo2(QModelIndex const&);
protected slots:
void dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int>& roles);
void selectionChanged(const QItemSelection& selected, const QItemSelection&);
void dataChanged(QModelIndex const& topLeft, QModelIndex const& bottomRight, QVector<int> const& roles);
void selectionChanged(QItemSelection const& selected, QItemSelection const&);
};
class StyleTab : public QTreeView

View File

@ -92,7 +92,7 @@ class node : private mapnik::util::noncopyable
~node() { qDeleteAll(children_); }
private:
const std::unique_ptr<node_base> impl_;
std::unique_ptr<node_base> const impl_;
QList<node*> children_;
node* parent_;
};
@ -360,7 +360,7 @@ int StyleModel::columnCount(QModelIndex const&) const
return 1;
}
QVariant StyleModel::data(const QModelIndex& index, int role) const
QVariant StyleModel::data(QModelIndex const& index, int role) const
{
// qDebug("data index::internalId() = %lld", index.internalId());
if (!index.isValid())

View File

@ -38,11 +38,11 @@ class StyleModel : public QAbstractItemModel
QModelIndex parent(QModelIndex const& child) const;
int rowCount(QModelIndex const& parent = QModelIndex()) const;
int columnCount(QModelIndex const& parent = QModelIndex()) const;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
QVariant data(QModelIndex const& index, int role = Qt::DisplayRole) const;
private:
// std::shared_ptr<mapnik::Map> map_;
const std::unique_ptr<node> root_;
std::unique_ptr<node> const root_;
};
#endif // STYLE_MODEL_HPP

View File

@ -163,7 +163,7 @@ struct dense_hashtable_iterator
typedef typename value_alloc_type::pointer pointer;
// "Real" constructor and default constructor
dense_hashtable_iterator(const dense_hashtable<V, K, HF, ExK, SetK, EqK, A>* h,
dense_hashtable_iterator(dense_hashtable<V, K, HF, ExK, SetK, EqK, A> const* h,
pointer it,
pointer it_end,
bool advance)
@ -204,11 +204,11 @@ struct dense_hashtable_iterator
}
// Comparison.
bool operator==(const iterator& it) const { return pos == it.pos; }
bool operator!=(const iterator& it) const { return pos != it.pos; }
bool operator==(iterator const& it) const { return pos == it.pos; }
bool operator!=(iterator const& it) const { return pos != it.pos; }
// The actual data
const dense_hashtable<V, K, HF, ExK, SetK, EqK, A>* ht;
dense_hashtable<V, K, HF, ExK, SetK, EqK, A> const* ht;
pointer pos, end;
};
@ -231,7 +231,7 @@ struct dense_hashtable_const_iterator
typedef typename value_alloc_type::const_pointer pointer;
// "Real" constructor and default constructor
dense_hashtable_const_iterator(const dense_hashtable<V, K, HF, ExK, SetK, EqK, A>* h,
dense_hashtable_const_iterator(dense_hashtable<V, K, HF, ExK, SetK, EqK, A> const* h,
pointer it,
pointer it_end,
bool advance)
@ -248,7 +248,7 @@ struct dense_hashtable_const_iterator
end(pointer())
{}
// This lets us convert regular iterators to const iterators
dense_hashtable_const_iterator(const iterator& it)
dense_hashtable_const_iterator(iterator const& it)
: ht(it.ht),
pos(it.pos),
end(it.end)
@ -282,11 +282,11 @@ struct dense_hashtable_const_iterator
}
// Comparison.
bool operator==(const const_iterator& it) const { return pos == it.pos; }
bool operator!=(const const_iterator& it) const { return pos != it.pos; }
bool operator==(const_iterator const& it) const { return pos == it.pos; }
bool operator!=(const_iterator const& it) const { return pos != it.pos; }
// The actual data
const dense_hashtable<V, K, HF, ExK, SetK, EqK, A>* ht;
dense_hashtable<V, K, HF, ExK, SetK, EqK, A> const* ht;
pointer pos, end;
};
@ -320,23 +320,23 @@ class dense_hashtable
// How full we let the table get before we resize, by default.
// Knuth says .8 is good -- higher causes us to probe too much,
// though it saves memory.
static const int HT_OCCUPANCY_PCT; // defined at the bottom of this file
static int const HT_OCCUPANCY_PCT; // defined at the bottom of this file
// How empty we let the table get before we resize lower, by default.
// (0.0 means never resize lower.)
// It should be less than OCCUPANCY_PCT / 2 or we thrash resizing
static const int HT_EMPTY_PCT; // defined at the bottom of this file
static int const HT_EMPTY_PCT; // defined at the bottom of this file
// Minimum size we're willing to let hashtables be.
// Must be a power of two, and at least 4.
// Note, however, that for a given hashtable, the initial size is a
// function of the first constructor arg, and may be >HT_MIN_BUCKETS.
static const size_type HT_MIN_BUCKETS = 4;
static size_type const HT_MIN_BUCKETS = 4;
// By default, if you don't specify a hashtable size at
// construction-time, we use this size. Must be a power of two, and
// at least HT_MIN_BUCKETS.
static const size_type HT_DEFAULT_STARTING_BUCKETS = 32;
static size_type const HT_DEFAULT_STARTING_BUCKETS = 32;
// ITERATOR FUNCTIONS
iterator begin() { return iterator(this, table, table + num_buckets, true); }
@ -411,14 +411,14 @@ class dense_hashtable
// Test if the given key is the deleted indicator. Requires
// num_deleted > 0, for correctness of read(), and because that
// guarantees that key_info.delkey is valid.
bool test_deleted_key(const key_type& key) const
bool test_deleted_key(key_type const& key) const
{
assert(num_deleted > 0);
return equals(key_info.delkey, key);
}
public:
void set_deleted_key(const key_type& key)
void set_deleted_key(key_type const& key)
{
// the empty indicator (if specified) and the deleted indicator
// must be different
@ -448,13 +448,13 @@ class dense_hashtable
assert(settings.use_deleted() || num_deleted == 0);
return num_deleted > 0 && test_deleted_key(get_key(table[bucknum]));
}
bool test_deleted(const iterator& it) const
bool test_deleted(iterator const& it) const
{
// Invariant: !use_deleted() implies num_deleted is 0.
assert(settings.use_deleted() || num_deleted == 0);
return num_deleted > 0 && test_deleted_key(get_key(*it));
}
bool test_deleted(const const_iterator& it) const
bool test_deleted(const_iterator const& it) const
{
// Invariant: !use_deleted() implies num_deleted is 0.
assert(settings.use_deleted() || num_deleted == 0);
@ -462,7 +462,7 @@ class dense_hashtable
}
private:
void check_use_deleted(const char* caller)
void check_use_deleted(char const* caller)
{
(void)caller; // could log it if the assert failed
assert(settings.use_deleted());
@ -518,12 +518,12 @@ class dense_hashtable
assert(settings.use_empty()); // we always need to know what's empty!
return equals(get_key(val_info.emptyval), get_key(table[bucknum]));
}
bool test_empty(const iterator& it) const
bool test_empty(iterator const& it) const
{
assert(settings.use_empty()); // we always need to know what's empty!
return equals(get_key(val_info.emptyval), get_key(*it));
}
bool test_empty(const const_iterator& it) const
bool test_empty(const_iterator const& it) const
{
assert(settings.use_empty()); // we always need to know what's empty!
return equals(get_key(val_info.emptyval), get_key(*it));
@ -576,7 +576,7 @@ class dense_hashtable
private:
// Because of the above, size_type(-1) is never legal; use it for errors
static const size_type ILLEGAL_BUCKET = size_type(-1);
static size_type const ILLEGAL_BUCKET = size_type(-1);
// Used after a string of deletes. Returns true if we actually shrunk.
// TODO(csilvers): take a delta so we can take into account inserts
@ -593,11 +593,11 @@ class dense_hashtable
// shrink below HT_DEFAULT_STARTING_BUCKETS. Otherwise, something
// like "dense_hash_set<int> x; x.insert(4); x.erase(4);" will
// shrink us down to HT_MIN_BUCKETS buckets, which is too small.
const size_type num_remain = num_elements - num_deleted;
const size_type shrink_threshold = settings.shrink_threshold();
size_type const num_remain = num_elements - num_deleted;
size_type const shrink_threshold = settings.shrink_threshold();
if (shrink_threshold > 0 && num_remain < shrink_threshold && bucket_count() > HT_DEFAULT_STARTING_BUCKETS)
{
const float shrink_factor = settings.shrink_factor();
float const shrink_factor = settings.shrink_factor();
size_type sz = bucket_count() / 2; // find how much we should shrink
while (sz > HT_DEFAULT_STARTING_BUCKETS && num_remain < sz * shrink_factor)
{
@ -635,7 +635,7 @@ class dense_hashtable
// are currently taking up room). But later, when we decide what
// size to resize to, *don't* count deleted buckets, since they
// get discarded during the resize.
const size_type needed_size = settings.min_buckets(num_elements + delta, 0);
size_type const needed_size = settings.min_buckets(num_elements + delta, 0);
if (needed_size <= bucket_count()) // we have enough buckets
return did_resize;
@ -651,7 +651,7 @@ class dense_hashtable
// insert. Might as well grow now, since we're already going
// through the trouble of copying (in order to purge the
// deleted elements).
const size_type target = static_cast<size_type>(settings.shrink_size(resize_to * 2));
size_type const target = static_cast<size_type>(settings.shrink_size(resize_to * 2));
if (num_elements - num_deleted + delta >= target)
{
// Good, we won't be below the shrink threshhold even if we double.
@ -676,7 +676,7 @@ class dense_hashtable
}
// Used to actually do the rehashing when we grow/shrink a hashtable
void copy_from(const dense_hashtable& ht, size_type min_buckets_wanted)
void copy_from(dense_hashtable const& ht, size_type min_buckets_wanted)
{
clear_to_size(settings.min_buckets(ht.size(), min_buckets_wanted));
@ -688,7 +688,7 @@ class dense_hashtable
{
size_type num_probes = 0; // how many times we've probed
size_type bucknum;
const size_type bucket_count_minus_one = bucket_count() - 1;
size_type const bucket_count_minus_one = bucket_count() - 1;
for (bucknum = hash(get_key(*it)) & bucket_count_minus_one; !test_empty(bucknum); // not empty
bucknum = (bucknum + JUMP_(key, num_probes)) & bucket_count_minus_one)
{
@ -734,11 +734,11 @@ class dense_hashtable
// and key extractor. We also define a copy constructor and =.
// DESTRUCTOR -- needs to free the table
explicit dense_hashtable(size_type expected_max_items_in_table = 0,
const HashFcn& hf = HashFcn(),
const EqualKey& eql = EqualKey(),
const ExtractKey& ext = ExtractKey(),
const SetKey& set = SetKey(),
const Alloc& alloc = Alloc())
HashFcn const& hf = HashFcn(),
EqualKey const& eql = EqualKey(),
ExtractKey const& ext = ExtractKey(),
SetKey const& set = SetKey(),
Alloc const& alloc = Alloc())
: settings(hf),
key_info(ext, set, eql),
num_deleted(0),
@ -755,7 +755,7 @@ class dense_hashtable
// As a convenience for resize(), we allow an optional second argument
// which lets you make this new hashtable a different size than ht
dense_hashtable(const dense_hashtable& ht, size_type min_buckets_wanted = HT_DEFAULT_STARTING_BUCKETS)
dense_hashtable(dense_hashtable const& ht, size_type min_buckets_wanted = HT_DEFAULT_STARTING_BUCKETS)
: settings(ht.settings),
key_info(ht.key_info),
num_deleted(0),
@ -776,7 +776,7 @@ class dense_hashtable
copy_from(ht, min_buckets_wanted); // copy_from() ignores deleted entries
}
dense_hashtable& operator=(const dense_hashtable& ht)
dense_hashtable& operator=(dense_hashtable const& ht)
{
if (&ht == this)
return *this; // don't copy onto ourselves
@ -858,7 +858,7 @@ class dense_hashtable
{
// If the table is already empty, and the number of buckets is
// already as we desire, there's nothing to do.
const size_type new_num_buckets = settings.min_buckets(0, 0);
size_type const new_num_buckets = settings.min_buckets(0, 0);
if (num_elements == 0 && new_num_buckets == num_buckets)
{
return;
@ -890,10 +890,10 @@ class dense_hashtable
// if object is not found; 2nd is ILLEGAL_BUCKET if it is.
// Note: because of deletions where-to-insert is not trivial: it's the
// first deleted bucket we see, as long as we don't find the key later
std::pair<size_type, size_type> find_position(const key_type& key) const
std::pair<size_type, size_type> find_position(key_type const& key) const
{
size_type num_probes = 0; // how many times we've probed
const size_type bucket_count_minus_one = bucket_count() - 1;
size_type const bucket_count_minus_one = bucket_count() - 1;
size_type bucknum = hash(key) & bucket_count_minus_one;
size_type insert_pos = ILLEGAL_BUCKET; // where we would insert
while (1)
@ -922,7 +922,7 @@ class dense_hashtable
public:
iterator find(const key_type& key)
iterator find(key_type const& key)
{
if (size() == 0)
return end();
@ -933,7 +933,7 @@ class dense_hashtable
return iterator(this, table + pos.first, table + num_buckets, false);
}
const_iterator find(const key_type& key) const
const_iterator find(key_type const& key) const
{
if (size() == 0)
return end();
@ -946,21 +946,21 @@ class dense_hashtable
// This is a tr1 method: the bucket a given key is in, or what bucket
// it would be put in, if it were to be inserted. Shrug.
size_type bucket(const key_type& key) const
size_type bucket(key_type const& key) const
{
std::pair<size_type, size_type> pos = find_position(key);
return pos.first == ILLEGAL_BUCKET ? pos.second : pos.first;
}
// Counts how many elements have key key. For maps, it's either 0 or 1.
size_type count(const key_type& key) const
size_type count(key_type const& key) const
{
std::pair<size_type, size_type> pos = find_position(key);
return pos.first == ILLEGAL_BUCKET ? 0 : 1;
}
// Likewise, equal_range doesn't really make sense for us. Oh well.
std::pair<iterator, iterator> equal_range(const key_type& key)
std::pair<iterator, iterator> equal_range(key_type const& key)
{
iterator pos = find(key); // either an iterator or end
if (pos == end())
@ -969,11 +969,11 @@ class dense_hashtable
}
else
{
const iterator startpos = pos++;
iterator const startpos = pos++;
return std::pair<iterator, iterator>(startpos, pos);
}
}
std::pair<const_iterator, const_iterator> equal_range(const key_type& key) const
std::pair<const_iterator, const_iterator> equal_range(key_type const& key) const
{
const_iterator pos = find(key); // either an iterator or end
if (pos == end())
@ -982,7 +982,7 @@ class dense_hashtable
}
else
{
const const_iterator startpos = pos++;
const_iterator const startpos = pos++;
return std::pair<const_iterator, const_iterator>(startpos, pos);
}
}
@ -1019,7 +1019,7 @@ class dense_hashtable
assert((!settings.use_empty() || !equals(get_key(obj), get_key(val_info.emptyval))) &&
"Inserting the empty key");
assert((!settings.use_deleted() || !equals(get_key(obj), key_info.delkey)) && "Inserting the deleted key");
const std::pair<size_type, size_type> pos = find_position(get_key(obj));
std::pair<size_type, size_type> const pos = find_position(get_key(obj));
if (pos.first != ILLEGAL_BUCKET)
{ // object was already there
return std::pair<iterator, bool>(iterator(this, table + pos.first, table + num_buckets, false),
@ -1075,12 +1075,12 @@ class dense_hashtable
// DefaultValue is a functor that takes a key and returns a value_type
// representing the default value to be inserted if none is found.
template<class DefaultValue>
value_type& find_or_insert(const key_type& key)
value_type& find_or_insert(key_type const& key)
{
// First, double-check we're not inserting emptykey or delkey
assert((!settings.use_empty() || !equals(key, get_key(val_info.emptyval))) && "Inserting the empty key");
assert((!settings.use_deleted() || !equals(key, key_info.delkey)) && "Inserting the deleted key");
const std::pair<size_type, size_type> pos = find_position(key);
std::pair<size_type, size_type> const pos = find_position(key);
DefaultValue default_value;
if (pos.first != ILLEGAL_BUCKET)
{ // object was already there
@ -1098,7 +1098,7 @@ class dense_hashtable
}
// DELETION ROUTINES
size_type erase(const key_type& key)
size_type erase(key_type const& key)
{
// First, double-check we're not trying to erase delkey or emptyval.
assert((!settings.use_empty() || !equals(key, get_key(val_info.emptyval))) && "Erasing the empty key");
@ -1166,7 +1166,7 @@ class dense_hashtable
}
// COMPARISON
bool operator==(const dense_hashtable& ht) const
bool operator==(dense_hashtable const& ht) const
{
if (size() != ht.size())
{
@ -1191,7 +1191,7 @@ class dense_hashtable
return true;
}
}
bool operator!=(const dense_hashtable& ht) const { return !(*this == ht); }
bool operator!=(dense_hashtable const& ht) const { return !(*this == ht); }
// I/O
// We support reading and writing hashtables to disk. Alas, since
@ -1200,7 +1200,7 @@ class dense_hashtable
private:
// Every time the disk format changes, this should probably change too
typedef unsigned long MagicNumberType;
static const MagicNumberType MAGIC_NUMBER = 0x13578642;
static MagicNumberType const MAGIC_NUMBER = 0x13578642;
public:
// I/O -- this is an add-on for writing hash table to disk
@ -1296,7 +1296,7 @@ class dense_hashtable
typedef typename A::size_type size_type;
// Convert a normal allocator to one that has realloc_or_die()
alloc_impl(const A& a)
alloc_impl(A const& a)
: A(a)
{}
@ -1321,7 +1321,7 @@ class dense_hashtable
typedef typename libc_allocator_with_realloc<A>::pointer pointer;
typedef typename libc_allocator_with_realloc<A>::size_type size_type;
alloc_impl(const libc_allocator_with_realloc<A>& a)
alloc_impl(libc_allocator_with_realloc<A> const& a)
: libc_allocator_with_realloc<A>(a)
{}
@ -1350,11 +1350,11 @@ class dense_hashtable
public:
typedef typename alloc_impl<value_alloc_type>::value_type value_type;
ValInfo(const alloc_impl<value_alloc_type>& a)
ValInfo(alloc_impl<value_alloc_type> const& a)
: alloc_impl<value_alloc_type>(a),
emptyval()
{}
ValInfo(const ValInfo& v)
ValInfo(ValInfo const& v)
: alloc_impl<value_alloc_type>(v),
emptyval(v.emptyval)
{}
@ -1368,7 +1368,7 @@ class dense_hashtable
// different classes.
struct Settings : sparsehash_internal::sh_hashtable_settings<key_type, hasher, size_type, HT_MIN_BUCKETS>
{
explicit Settings(const hasher& hf)
explicit Settings(hasher const& hf)
: sparsehash_internal::sh_hashtable_settings<key_type, hasher, size_type, HT_MIN_BUCKETS>(
hf,
HT_OCCUPANCY_PCT / 100.0f,
@ -1382,7 +1382,7 @@ class dense_hashtable
public EqualKey
{
public:
KeyInfo(const ExtractKey& ek, const SetKey& sk, const EqualKey& eq)
KeyInfo(ExtractKey const& ek, SetKey const& sk, EqualKey const& eq)
: ExtractKey(ek),
SetKey(sk),
EqualKey(eq)
@ -1390,8 +1390,8 @@ class dense_hashtable
// We want to return the exact same type as ExtractKey: Key or const Key&
typename ExtractKey::result_type get_key(const_reference v) const { return ExtractKey::operator()(v); }
void set_key(pointer v, const key_type& k) const { SetKey::operator()(v, k); }
bool equals(const key_type& a, const key_type& b) const { return EqualKey::operator()(a, b); }
void set_key(pointer v, key_type const& k) const { SetKey::operator()(v, k); }
bool equals(key_type const& a, key_type const& b) const { return EqualKey::operator()(a, b); }
// Which key marks deleted entries.
// TODO(csilvers): make a pointer, and get rid of use_deleted (benchmark!)
@ -1399,10 +1399,10 @@ class dense_hashtable
};
// Utility functions to access the templated operators
size_type hash(const key_type& v) const { return settings.hash(v); }
bool equals(const key_type& a, const key_type& b) const { return key_info.equals(a, b); }
size_type hash(key_type const& v) const { return settings.hash(v); }
bool equals(key_type const& a, key_type const& b) const { return key_info.equals(a, b); }
typename ExtractKey::result_type get_key(const_reference v) const { return key_info.get_key(v); }
void set_key(pointer v, const key_type& k) const { key_info.set_key(v, k); }
void set_key(pointer v, key_type const& k) const { key_info.set_key(v, k); }
private:
// Actual data
@ -1426,7 +1426,7 @@ inline void swap(dense_hashtable<V, K, HF, ExK, SetK, EqK, A>& x, dense_hashtabl
#undef JUMP_
template<class V, class K, class HF, class ExK, class SetK, class EqK, class A>
const typename dense_hashtable<V, K, HF, ExK, SetK, EqK, A>::size_type
typename dense_hashtable<V, K, HF, ExK, SetK, EqK, A>::size_type const
dense_hashtable<V, K, HF, ExK, SetK, EqK, A>::ILLEGAL_BUCKET;
// How full we let the table get before we resize. Knuth says .8 is
@ -1436,12 +1436,12 @@ const typename dense_hashtable<V, K, HF, ExK, SetK, EqK, A>::size_type
// Feel free to play around with different values, though, via
// max_load_factor() and/or set_resizing_parameters().
template<class V, class K, class HF, class ExK, class SetK, class EqK, class A>
const int dense_hashtable<V, K, HF, ExK, SetK, EqK, A>::HT_OCCUPANCY_PCT = 50;
int const dense_hashtable<V, K, HF, ExK, SetK, EqK, A>::HT_OCCUPANCY_PCT = 50;
// How empty we let the table get before we resize lower.
// It should be less than OCCUPANCY_PCT / 2 or we thrash resizing.
template<class V, class K, class HF, class ExK, class SetK, class EqK, class A>
const int dense_hashtable<V, K, HF, ExK, SetK, EqK, A>::HT_EMPTY_PCT =
int const dense_hashtable<V, K, HF, ExK, SetK, EqK, A>::HT_EMPTY_PCT =
static_cast<int>(0.4 * dense_hashtable<V, K, HF, ExK, SetK, EqK, A>::HT_OCCUPANCY_PCT);
_END_GOOGLE_NAMESPACE_

View File

@ -86,7 +86,7 @@ inline bool read_data_internal(Ignored*, FILE* fp, void* data, size_t length)
}
template<typename Ignored>
inline bool write_data_internal(Ignored*, FILE* fp, const void* data, size_t length)
inline bool write_data_internal(Ignored*, FILE* fp, void const* data, size_t length)
{
return fwrite(data, length, 1, fp) == 1;
}
@ -109,12 +109,12 @@ inline bool read_data_internal(Ignored*, std::istream* fp, void* data, size_t le
}
template<typename OSTREAM>
inline bool write_data_internal_for_ostream(OSTREAM* fp, const void* data, size_t length)
inline bool write_data_internal_for_ostream(OSTREAM* fp, void const* data, size_t length)
{
return fp->write(reinterpret_cast<const char*>(data), length).good();
return fp->write(reinterpret_cast<char const*>(data), length).good();
}
template<typename Ignored>
inline bool write_data_internal(Ignored*, std::ostream* fp, const void* data, size_t length)
inline bool write_data_internal(Ignored*, std::ostream* fp, void const* data, size_t length)
{
return write_data_internal_for_ostream(fp, data, length);
}
@ -132,7 +132,7 @@ inline bool read_data_internal(INPUT* fp, void*, void* data, size_t length)
// The OUTPUT type needs to support a Write() operation that takes
// a buffer and a length and returns the number of bytes written.
template<typename OUTPUT>
inline bool write_data_internal(OUTPUT* fp, void*, const void* data, size_t length)
inline bool write_data_internal(OUTPUT* fp, void*, void const* data, size_t length)
{
return static_cast<size_t>(fp->Write(data, length)) == length;
}
@ -146,7 +146,7 @@ inline bool read_data(INPUT* fp, void* data, size_t length)
}
template<typename OUTPUT>
inline bool write_data(OUTPUT* fp, const void* data, size_t length)
inline bool write_data(OUTPUT* fp, void const* data, size_t length)
{
return write_data_internal(fp, fp, data, length);
}
@ -199,7 +199,7 @@ struct pod_serializer
}
template<typename OUTPUT>
bool operator()(OUTPUT* fp, const value_type& value) const
bool operator()(OUTPUT* fp, value_type const& value) const
{
return write_data(fp, &value, sizeof(value));
}
@ -226,7 +226,7 @@ class sh_hashtable_settings : public HashFunc
typedef SizeType size_type;
public:
sh_hashtable_settings(const hasher& hf, const float ht_occupancy_flt, const float ht_empty_flt)
sh_hashtable_settings(hasher const& hf, float const ht_occupancy_flt, float const ht_empty_flt)
: hasher(hf),
enlarge_threshold_(0),
shrink_threshold_(0),
@ -239,7 +239,7 @@ class sh_hashtable_settings : public HashFunc
set_shrink_factor(ht_empty_flt);
}
size_type hash(const key_type& v) const
size_type hash(key_type const& v) const
{
// We munge the hash value when we don't trust hasher::operator().
return hash_munger<Key>::MungedHash(hasher::operator()(v));

View File

@ -48,12 +48,12 @@ class libc_allocator_with_realloc
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T const* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef T const& const_reference;
libc_allocator_with_realloc() {}
libc_allocator_with_realloc(const libc_allocator_with_realloc&) {}
libc_allocator_with_realloc(libc_allocator_with_realloc const&) {}
~libc_allocator_with_realloc() {}
pointer address(reference r) const { return &r; }
@ -65,11 +65,11 @@ class libc_allocator_with_realloc
size_type max_size() const { return static_cast<size_type>(-1) / sizeof(value_type); }
void construct(pointer p, const value_type& val) { new (p) value_type(val); }
void construct(pointer p, value_type const& val) { new (p) value_type(val); }
void destroy(pointer p) { p->~value_type(); }
template<class U>
libc_allocator_with_realloc(const libc_allocator_with_realloc<U>&)
libc_allocator_with_realloc(libc_allocator_with_realloc<U> const&)
{}
template<class U>
@ -88,7 +88,7 @@ class libc_allocator_with_realloc<void>
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void const* const_pointer;
template<class U>
struct rebind
@ -98,13 +98,13 @@ class libc_allocator_with_realloc<void>
};
template<class T>
inline bool operator==(const libc_allocator_with_realloc<T>&, const libc_allocator_with_realloc<T>&)
inline bool operator==(libc_allocator_with_realloc<T> const&, libc_allocator_with_realloc<T> const&)
{
return true;
}
template<class T>
inline bool operator!=(const libc_allocator_with_realloc<T>&, const libc_allocator_with_realloc<T>&)
inline bool operator!=(libc_allocator_with_realloc<T> const&, libc_allocator_with_realloc<T> const&)
{
return false;
}

View File

@ -76,13 +76,13 @@ struct identity_
template<class T, T v>
struct integral_constant
{
static const T value = v;
static T const value = v;
typedef T value_type;
typedef integral_constant<T, v> type;
};
template<class T, T v>
const T integral_constant<T, v>::value;
T const integral_constant<T, v>::value;
// Abbreviations: true_type and false_type are structs that represent boolean
// true and false values. Also define the boost::mpl versions of those names,

View File

@ -163,13 +163,13 @@ struct is_integral<unsigned long long> : true_type
{};
#endif
template<class T>
struct is_integral<const T> : is_integral<T>
struct is_integral<T const> : is_integral<T>
{};
template<class T>
struct is_integral<volatile T> : is_integral<T>
struct is_integral<T volatile> : is_integral<T>
{};
template<class T>
struct is_integral<const volatile T> : is_integral<T>
struct is_integral<T const volatile> : is_integral<T>
{};
// is_floating_point is false except for the built-in floating-point types.
@ -187,13 +187,13 @@ template<>
struct is_floating_point<long double> : true_type
{};
template<class T>
struct is_floating_point<const T> : is_floating_point<T>
struct is_floating_point<T const> : is_floating_point<T>
{};
template<class T>
struct is_floating_point<volatile T> : is_floating_point<T>
struct is_floating_point<T volatile> : is_floating_point<T>
{};
template<class T>
struct is_floating_point<const volatile T> : is_floating_point<T>
struct is_floating_point<T const volatile> : is_floating_point<T>
{};
// is_pointer is false except for pointer types. A cv-qualified type (e.g.
@ -206,13 +206,13 @@ template<class T>
struct is_pointer<T*> : true_type
{};
template<class T>
struct is_pointer<const T> : is_pointer<T>
struct is_pointer<T const> : is_pointer<T>
{};
template<class T>
struct is_pointer<volatile T> : is_pointer<T>
struct is_pointer<T volatile> : is_pointer<T>
{};
template<class T>
struct is_pointer<const volatile T> : is_pointer<T>
struct is_pointer<T const volatile> : is_pointer<T>
{};
#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
@ -226,7 +226,7 @@ struct is_class_or_union
static small_ tester(void (U::*)());
template<class U>
static big_ tester(...);
static const bool value = sizeof(tester<T>(0)) == sizeof(small_);
static bool const value = sizeof(tester<T>(0)) == sizeof(small_);
};
// is_convertible chokes if the first argument is an array. That's why
@ -264,13 +264,13 @@ struct is_enum
{};
template<class T>
struct is_enum<const T> : is_enum<T>
struct is_enum<T const> : is_enum<T>
{};
template<class T>
struct is_enum<volatile T> : is_enum<T>
struct is_enum<T volatile> : is_enum<T>
{};
template<class T>
struct is_enum<const volatile T> : is_enum<T>
struct is_enum<T const volatile> : is_enum<T>
{};
#endif
@ -297,13 +297,13 @@ struct is_pod : integral_constant<bool,
is_pointer<T>::value)>
{};
template<class T>
struct is_pod<const T> : is_pod<T>
struct is_pod<T const> : is_pod<T>
{};
template<class T>
struct is_pod<volatile T> : is_pod<T>
struct is_pod<T volatile> : is_pod<T>
{};
template<class T>
struct is_pod<const volatile T> : is_pod<T>
struct is_pod<T const volatile> : is_pod<T>
{};
// We can't get has_trivial_constructor right without compiler help, so
@ -322,7 +322,7 @@ template<class A, int N>
struct has_trivial_constructor<A[N]> : has_trivial_constructor<A>
{};
template<class T>
struct has_trivial_constructor<const T> : has_trivial_constructor<T>
struct has_trivial_constructor<T const> : has_trivial_constructor<T>
{};
// We can't get has_trivial_copy right without compiler help, so fail
@ -341,7 +341,7 @@ template<class A, int N>
struct has_trivial_copy<A[N]> : has_trivial_copy<A>
{};
template<class T>
struct has_trivial_copy<const T> : has_trivial_copy<T>
struct has_trivial_copy<T const> : has_trivial_copy<T>
{};
// We can't get has_trivial_assign right without compiler help, so fail
@ -375,7 +375,7 @@ template<class A, int N>
struct has_trivial_destructor<A[N]> : has_trivial_destructor<A>
{};
template<class T>
struct has_trivial_destructor<const T> : has_trivial_destructor<T>
struct has_trivial_destructor<T const> : has_trivial_destructor<T>
{};
// Specified by TR1 [4.7.1]

View File

@ -129,9 +129,9 @@ struct agg_polygon_pattern : agg_pattern_base
agg::render_scanlines(ras, sl, rp);
}
const bool clip_;
const box2d<double> clip_box_;
const agg::trans_affine tr_;
bool const clip_;
box2d<double> const clip_box_;
agg::trans_affine const tr_;
VertexConverter converter_;
};

View File

@ -100,8 +100,8 @@ class buffer_stack
T& top() const { return *position_; }
private:
const std::size_t width_;
const std::size_t height_;
std::size_t const width_;
std::size_t const height_;
std::deque<T> buffers_;
typename std::deque<T>::iterator position_;
};
@ -189,7 +189,7 @@ class MAPNIK_DECL agg_renderer : public feature_style_processor<agg_renderer<T0>
std::stack<std::reference_wrapper<buffer_type>> buffers_;
buffer_stack<buffer_type> internal_buffers_;
std::unique_ptr<buffer_type> inflated_buffer_;
const std::unique_ptr<rasterizer> ras_ptr;
std::unique_ptr<rasterizer> const ras_ptr;
gamma_method_enum gamma_method_;
double gamma_;
renderer_common common_;

View File

@ -175,14 +175,14 @@ struct symbolizer_attributes
void operator()(raster_symbolizer const& sym)
{
const auto filter_factor = get_optional<double>(sym, keys::filter_factor);
auto const filter_factor = get_optional<double>(sym, keys::filter_factor);
if (filter_factor)
{
filter_factor_ = *filter_factor;
}
else
{
const auto scaling_method = get_optional<scaling_method_e>(sym, keys::scaling);
auto const scaling_method = get_optional<scaling_method_e>(sym, keys::scaling);
if (scaling_method && *scaling_method != SCALING_NEAR)
{
filter_factor_ = 2;

View File

@ -159,8 +159,8 @@ class cairo_pattern : private util::noncopyable
explicit cairo_pattern(image_rgba8 const& data, double opacity = 1.0)
{
std::size_t pixels = data.width() * data.height();
const unsigned int* in_ptr = data.data();
const unsigned int* in_end = in_ptr + pixels;
unsigned int const* in_ptr = data.data();
unsigned int const* in_end = in_ptr + pixels;
unsigned int* out_ptr;
surface_ = cairo_surface_ptr(cairo_image_surface_create(CAIRO_FORMAT_ARGB32,

View File

@ -47,8 +47,8 @@ static inline void cairo_image_to_rgba8(mapnik::image_rgba8& data, cairo_surface
int stride = cairo_image_surface_get_stride(&*surface) / 4;
const std::unique_ptr<unsigned int[]> out_row(new unsigned int[data.width()]);
const unsigned int* in_row = (const unsigned int*)cairo_image_surface_get_data(&*surface);
std::unique_ptr<unsigned int[]> const out_row(new unsigned int[data.width()]);
unsigned int const* in_row = (unsigned int const*)cairo_image_surface_get_data(&*surface);
for (unsigned int row = 0; row < data.height(); row++, in_row += stride)
{

View File

@ -101,7 +101,7 @@ struct cairo_renderer_process_visitor_p
}
agg::trans_affine const& image_tr_;
const double opacity_;
double const opacity_;
};
struct cairo_pattern_base
@ -193,9 +193,9 @@ struct cairo_polygon_pattern : cairo_pattern_base
context.fill();
}
const bool clip_;
const box2d<double> clip_box_;
const agg::trans_affine tr_;
bool const clip_;
box2d<double> const clip_box_;
agg::trans_affine const tr_;
VertexConverter converter_;
};

View File

@ -78,7 +78,7 @@ class MAPNIK_DECL color : boost::equality_comparable<color>
{}
// copy ctor
color(const color& rhs)
color(color const& rhs)
: red_(rhs.red_),
green_(rhs.green_),
blue_(rhs.blue_),

View File

@ -39,7 +39,7 @@ class config_error : public std::exception
config_error(std::string const& what, xml_node const& node);
config_error(std::string const& what, unsigned line_number, std::string const& filename);
virtual ~config_error() {}
virtual const char* what() const noexcept;
virtual char const* what() const noexcept;
void append_context(std::string const& ctx) const;
void append_context(std::string const& ctx, xml_node const& node) const;
void append_context(xml_node const& node) const;

View File

@ -86,7 +86,7 @@ struct coord<T, 2>
}
template<typename T2>
coord<T, 2>& operator=(const coord<T2, 2>& rhs)
coord<T, 2>& operator=(coord<T2, 2> const& rhs)
{
coord<T, 2> tmp(rhs);
swap(rhs);

View File

@ -214,9 +214,9 @@ struct named_colors_ : x3::symbols<color>
}
} const named_colors;
const x3::uint_parser<std::uint8_t, 16, 2, 2> hex2;
const x3::uint_parser<std::uint8_t, 16, 1, 1> hex1;
const x3::uint_parser<std::uint16_t, 10, 1, 3> dec3;
x3::uint_parser<std::uint8_t, 16, 2, 2> const hex2;
x3::uint_parser<std::uint8_t, 16, 1, 1> const hex1;
x3::uint_parser<std::uint16_t, 10, 1, 3> const dec3;
// rules
x3::rule<class hex2_color, color> const hex2_color("hex2_color");
@ -243,67 +243,67 @@ struct percent_converter
static std::uint8_t call(double val) { return safe_cast<std::uint8_t>(std::lround((255.0 * val) / 100.0)); }
};
const auto dec_red = [](auto& ctx) {
auto const dec_red = [](auto& ctx) {
_val(ctx).red_ = _attr(ctx);
};
const auto dec_green = [](auto& ctx) {
auto const dec_green = [](auto& ctx) {
_val(ctx).green_ = _attr(ctx);
};
const auto dec_blue = [](auto& ctx) {
auto const dec_blue = [](auto& ctx) {
_val(ctx).blue_ = _attr(ctx);
};
const auto opacity = [](auto& ctx) {
auto const opacity = [](auto& ctx) {
_val(ctx).alpha_ = uint8_t((255.0 * clip_opacity::call(_attr(ctx))) + 0.5);
};
const auto percent_red = [](auto& ctx) {
auto const percent_red = [](auto& ctx) {
_val(ctx).red_ = percent_converter::call(_attr(ctx));
};
const auto percent_green = [](auto& ctx) {
auto const percent_green = [](auto& ctx) {
_val(ctx).green_ = percent_converter::call(_attr(ctx));
};
const auto percent_blue = [](auto& ctx) {
auto const percent_blue = [](auto& ctx) {
_val(ctx).blue_ = percent_converter::call(_attr(ctx));
};
const auto hex1_red = [](auto& ctx) {
auto const hex1_red = [](auto& ctx) {
_val(ctx).red_ = _attr(ctx) | _attr(ctx) << 4;
};
const auto hex1_green = [](auto& ctx) {
auto const hex1_green = [](auto& ctx) {
_val(ctx).green_ = _attr(ctx) | _attr(ctx) << 4;
};
const auto hex1_blue = [](auto& ctx) {
auto const hex1_blue = [](auto& ctx) {
_val(ctx).blue_ = _attr(ctx) | _attr(ctx) << 4;
};
const auto hex1_opacity = [](auto& ctx) {
auto const hex1_opacity = [](auto& ctx) {
_val(ctx).alpha_ = _attr(ctx) | _attr(ctx) << 4;
};
const auto hex2_red = [](auto& ctx) {
auto const hex2_red = [](auto& ctx) {
_val(ctx).red_ = _attr(ctx);
};
const auto hex2_green = [](auto& ctx) {
auto const hex2_green = [](auto& ctx) {
_val(ctx).green_ = _attr(ctx);
};
const auto hex2_blue = [](auto& ctx) {
auto const hex2_blue = [](auto& ctx) {
_val(ctx).blue_ = _attr(ctx);
};
const auto hex2_opacity = [](auto& ctx) {
auto const hex2_opacity = [](auto& ctx) {
_val(ctx).alpha_ = _attr(ctx);
};
const auto hsl_to_rgba = [](auto& ctx) {
auto const hsl_to_rgba = [](auto& ctx) {
double h = std::get<0>(_attr(ctx));
double s = std::get<1>(_attr(ctx));
double l = std::get<2>(_attr(ctx));
@ -323,10 +323,10 @@ const auto hsl_to_rgba = [](auto& ctx) {
}
m1 = l * 2 - m2;
const double r = hue_to_rgb(m1, m2, h + 1.0 / 3.0);
const double g = hue_to_rgb(m1, m2, h);
const double b = hue_to_rgb(m1, m2, h - 1.0 / 3.0);
const uint8_t alpha = uint8_t((255.0 * clip_opacity::call(std::get<3>(_attr(ctx)))) + 0.5);
double const r = hue_to_rgb(m1, m2, h + 1.0 / 3.0);
double const g = hue_to_rgb(m1, m2, h);
double const b = hue_to_rgb(m1, m2, h - 1.0 / 3.0);
uint8_t const alpha = uint8_t((255.0 * clip_opacity::call(std::get<3>(_attr(ctx)))) + 0.5);
_val(ctx) = color(safe_cast<uint8_t>(std::lround(255.0 * r)),
safe_cast<uint8_t>(std::lround(255.0 * g)),
safe_cast<uint8_t>(std::lround(255.0 * b)),

View File

@ -157,20 +157,20 @@ using x3::raw;
using x3::standard::space;
// import unicode string rule
const auto css_string = mapnik::json::grammar::unicode_string;
auto const css_string = mapnik::json::grammar::unicode_string;
const auto assign_def = [](auto const& ctx) {
auto const assign_def = [](auto const& ctx) {
for (auto const& k : std::get<0>(_attr(ctx)))
{
_val(ctx).emplace(k, std::get<1>(_attr(ctx)));
}
};
const auto assign_key = [](auto const& ctx) {
auto const assign_key = [](auto const& ctx) {
_val(ctx).first = std::move(_attr(ctx));
};
const auto assign_value = [](auto const& ctx) {
auto const assign_value = [](auto const& ctx) {
_val(ctx).second = std::move(_attr(ctx));
};

View File

@ -51,7 +51,7 @@ class MAPNIK_DECL datasource_exception : public std::exception
~datasource_exception() {}
virtual const char* what() const noexcept { return message_.c_str(); }
virtual char const* what() const noexcept { return message_.c_str(); }
private:
std::string message_;
@ -103,7 +103,7 @@ class MAPNIK_DECL datasource : private util::noncopyable
parameters params_;
};
using datasource_name = const char* (*)();
using datasource_name = char const* (*)();
using create_ds = datasource* (*)(parameters const&);
using destroy_ds = void (*)(datasource*);

View File

@ -48,7 +48,7 @@ class MAPNIK_DECL datasource_cache : public singleton<datasource_cache, CreateSt
friend class CreateStatic<datasource_cache>;
public:
bool plugin_registered(const std::string& plugin_name) const;
bool plugin_registered(std::string const& plugin_name) const;
std::vector<std::string> plugin_names() const;
std::string plugin_directories();
bool register_datasources(std::string const& path, bool recurse = false);

View File

@ -12,7 +12,7 @@ class MAPNIK_DECL datasource_plugin
virtual ~datasource_plugin() = default;
virtual void after_load() const = 0;
virtual void before_unload() const = 0;
virtual const char* name() const = 0;
virtual char const* name() const = 0;
virtual datasource_ptr create(parameters const& params) const = 0;
};
} // namespace mapnik

View File

@ -171,7 +171,7 @@ class base_log : public util::noncopyable
base_log() {}
#ifdef MAPNIK_LOG
base_log(const char* object_name)
base_log(char const* object_name)
{
if (object_name != nullptr)
{
@ -179,7 +179,7 @@ class base_log : public util::noncopyable
}
}
#else
base_log(const char* /*object_name*/) {}
base_log(char const* /*object_name*/) {}
#endif
~base_log()
@ -230,7 +230,7 @@ class base_log_always : public util::noncopyable
base_log_always() {}
base_log_always(const char* object_name)
base_log_always(char const* object_name)
{
if (object_name != nullptr)
{
@ -273,7 +273,7 @@ class MAPNIK_DECL warn : public detail::base_log_warn
warn()
: detail::base_log_warn()
{}
warn(const char* object_name)
warn(char const* object_name)
: detail::base_log_warn(object_name)
{}
};
@ -284,7 +284,7 @@ class MAPNIK_DECL debug : public detail::base_log_debug
debug()
: detail::base_log_debug()
{}
debug(const char* object_name)
debug(char const* object_name)
: detail::base_log_debug(object_name)
{}
};
@ -295,7 +295,7 @@ class MAPNIK_DECL error : public detail::base_log_error
error()
: detail::base_log_error()
{}
error(const char* object_name)
error(char const* object_name)
: detail::base_log_error(object_name)
{}
};

View File

@ -52,10 +52,10 @@ class illegal_enum_value : public std::exception
{}
virtual ~illegal_enum_value() {}
virtual const char* what() const noexcept { return what_.c_str(); }
virtual char const* what() const noexcept { return what_.c_str(); }
protected:
const std::string what_;
std::string const what_;
};
namespace detail {
@ -89,7 +89,7 @@ constexpr EnumT EnumGetKey(EnumMapT<EnumT, N> const& map, char const* value, std
template<typename ENUM,
char const* (*F_TO_STRING)(ENUM),
ENUM (*F_FROM_STRING)(const char*),
ENUM (*F_FROM_STRING)(char const*),
std::map<ENUM, std::string> (*F_LOOKUP)()>
struct MAPNIK_DECL enumeration
{
@ -105,7 +105,7 @@ struct MAPNIK_DECL enumeration
: value_(v)
{}
void from_string(const std::string& str) { value_ = F_FROM_STRING(str.c_str()); }
void from_string(std::string const& str) { value_ = F_FROM_STRING(str.c_str()); }
std::string as_string() const { return F_TO_STRING(value_); }
static std::map<ENUM, std::string> lookupMap() { return F_LOOKUP(); }

View File

@ -61,7 +61,7 @@ using x3::no_case;
using x3::no_skip;
x3::uint_parser<char, 16, 2, 2> const hex2{};
const auto escaped_unicode = json::grammar::escaped_unicode;
auto const escaped_unicode = json::grammar::escaped_unicode;
template<typename Context>
inline mapnik::transcoder const& extract_transcoder(Context const& ctx)
@ -69,19 +69,19 @@ inline mapnik::transcoder const& extract_transcoder(Context const& ctx)
return x3::get<transcoder_tag>(ctx);
}
const auto append = [](auto const& ctx) {
auto const append = [](auto const& ctx) {
_val(ctx) += _attr(ctx);
};
const auto do_assign = [](auto const& ctx) {
auto const do_assign = [](auto const& ctx) {
_val(ctx) = std::move(_attr(ctx));
};
const auto do_negate = [](auto const& ctx) {
auto const do_negate = [](auto const& ctx) {
_val(ctx) = std::move(unary_node<mapnik::tags::negate>(_attr(ctx)));
};
const auto do_attribute = [](auto const& ctx) {
auto const do_attribute = [](auto const& ctx) {
auto const& attr = _attr(ctx);
if (attr == "mapnik::geometry_type")
{
@ -93,84 +93,84 @@ const auto do_attribute = [](auto const& ctx) {
}
};
const auto do_global_attribute = [](auto const& ctx) {
auto const do_global_attribute = [](auto const& ctx) {
_val(ctx) = std::move(global_attribute(_attr(ctx)));
};
const auto do_add = [](auto const& ctx) {
auto const do_add = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::plus>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_subt = [](auto const& ctx) {
auto const do_subt = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::minus>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_mult = [](auto const& ctx) {
auto const do_mult = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::mult>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_div = [](auto const& ctx) {
auto const do_div = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::div>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_mod = [](auto const& ctx) {
auto const do_mod = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::mod>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_unicode = [](auto const& ctx) {
auto const do_unicode = [](auto const& ctx) {
auto const& tr = extract_transcoder(ctx);
_val(ctx) = std::move(tr.transcode(_attr(ctx).c_str()));
};
const auto do_null = [](auto const& ctx) {
auto const do_null = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::value_null());
};
const auto do_not = [](auto const& ctx) {
auto const do_not = [](auto const& ctx) {
mapnik::unary_node<mapnik::tags::logical_not> node(_attr(ctx));
_val(ctx) = std::move(node);
};
const auto do_and = [](auto const& ctx) {
auto const do_and = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::logical_and>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_or = [](auto const& ctx) {
auto const do_or = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::logical_or>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_equal = [](auto const& ctx) {
auto const do_equal = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::equal_to>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_not_equal = [](auto const& ctx) {
auto const do_not_equal = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::not_equal_to>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_less = [](auto const& ctx) {
auto const do_less = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::less>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_less_equal = [](auto const& ctx) {
auto const do_less_equal = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::less_equal>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_greater = [](auto const& ctx) {
auto const do_greater = [](auto const& ctx) {
_val(ctx) = std::move(mapnik::binary_node<mapnik::tags::greater>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_greater_equal = [](auto const& ctx) {
auto const do_greater_equal = [](auto const& ctx) {
_val(ctx) =
std::move(mapnik::binary_node<mapnik::tags::greater_equal>(std::move(_val(ctx)), std::move(_attr(ctx))));
};
// regex
const auto do_regex_match = [](auto const& ctx) {
auto const do_regex_match = [](auto const& ctx) {
auto const& tr = extract_transcoder(ctx);
_val(ctx) = std::move(mapnik::regex_match_node(tr, std::move(_val(ctx)), std::move(_attr(ctx))));
};
const auto do_regex_replace = [](auto const& ctx) {
auto const do_regex_replace = [](auto const& ctx) {
auto const& tr = extract_transcoder(ctx);
auto const& pair = _attr(ctx);
auto const& pattern = std::get<0>(pair);

View File

@ -127,7 +127,7 @@ struct unary_node
: expr(a)
{}
static const char* type() { return Tag::str(); }
static char const* type() { return Tag::str(); }
expr_node expr;
};
@ -145,7 +145,7 @@ struct binary_node
right(b)
{}
static const char* type() { return Tag::str(); }
static char const* type() { return Tag::str(); }
expr_node left, right;
};

View File

@ -33,77 +33,77 @@ namespace mapnik {
namespace tags {
struct negate
{
static const char* str() { return "-"; }
static char const* str() { return "-"; }
};
struct plus
{
static const char* str() { return "+"; }
static char const* str() { return "+"; }
};
struct minus
{
static const char* str() { return "-"; }
static char const* str() { return "-"; }
};
struct mult
{
static const char* str() { return "*"; }
static char const* str() { return "*"; }
};
struct div
{
static const char* str() { return "/"; }
static char const* str() { return "/"; }
};
struct mod
{
static const char* str() { return "%"; }
static char const* str() { return "%"; }
};
struct less
{
static const char* str() { return "<"; }
static char const* str() { return "<"; }
};
struct less_equal
{
static const char* str() { return "<="; }
static char const* str() { return "<="; }
};
struct greater
{
static const char* str() { return ">"; }
static char const* str() { return ">"; }
};
struct greater_equal
{
static const char* str() { return ">="; }
static char const* str() { return ">="; }
};
struct equal_to
{
static const char* str() { return "="; }
static char const* str() { return "="; }
};
struct not_equal_to
{
static const char* str() { return "!="; }
static char const* str() { return "!="; }
};
struct logical_not
{
static const char* str() { return "not "; }
static char const* str() { return "not "; }
};
struct logical_and
{
static const char* str() { return " and "; }
static char const* str() { return " and "; }
};
struct logical_or
{
static const char* str() { return " or "; }
static char const* str() { return " or "; }
};
} // namespace tags

View File

@ -47,7 +47,7 @@ class factory : public singleton<factory<product_type, key_type, Args...>>
return map_.insert(typename product_map::value_type(key, creator)).second;
}
bool unregister_product(const key_type& key) { return map_.erase(key) == 1; }
bool unregister_product(key_type const& key) { return map_.erase(key) == 1; }
product_type* create_object(key_type const& key, Args... args)
{

View File

@ -89,7 +89,7 @@ class context : private util::noncopyable
using context_type = context<std::map<std::string, std::size_t>>;
using context_ptr = std::shared_ptr<context_type>;
static const value default_feature_value{};
static value const default_feature_value{};
class MAPNIK_DECL feature_impl : private util::noncopyable
{

View File

@ -248,7 +248,7 @@ void feature_style_processor<Processor>::prepare_layer(layer_rendering_material&
box2d<double> buffered_query_ext(query_ext); // buffered
double buffer_padding = 2.0 * scale * p.scale_factor();
const auto layer_buffer_size = lay.buffer_size();
auto const layer_buffer_size = lay.buffer_size();
if (layer_buffer_size) // if layer overrides buffer size, use this value to compute buffered extent
{
buffer_padding *= *layer_buffer_size;
@ -268,7 +268,7 @@ void feature_style_processor<Processor>::prepare_layer(layer_rendering_material&
}
box2d<double> layer_ext = lay.envelope();
const box2d<double> buffered_query_ext_map_srs = buffered_query_ext;
box2d<double> const buffered_query_ext_map_srs = buffered_query_ext;
bool fw_success = false;
bool early_return = false;

View File

@ -191,7 +191,7 @@ struct tag<mapnik::geometry::polygon<CoordinateType>>
template<typename CoordinateType>
struct point_order<mapnik::geometry::linear_ring<CoordinateType>>
{
static const order_selector value = counterclockwise;
static order_selector const value = counterclockwise;
};
template<typename CoordinateType>

View File

@ -82,13 +82,13 @@ struct index;
template<typename T, typename... Types>
struct index<T, std::tuple<T, Types...>>
{
static const std::size_t value = 0;
static std::size_t const value = 0;
};
template<typename T, typename U, typename... Types>
struct index<T, std::tuple<U, Types...>>
{
static const std::size_t value = 1 + index<T, std::tuple<Types...>>::value;
static std::size_t const value = 1 + index<T, std::tuple<Types...>>::value;
};
} // namespace detail

View File

@ -137,7 +137,7 @@ class MAPNIK_DECL box2d : boost::equality_comparable<
};
template<class charT, class traits, class T>
inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& out, const box2d<T>& e)
inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& out, box2d<T> const& e)
{
out << e.to_string();
return out;

View File

@ -68,37 +68,37 @@ namespace mapnik {
} while (0)
// read int16_t NDR (little endian)
inline void read_int16_ndr(const char* data, std::int16_t& val)
inline void read_int16_ndr(char const* data, std::int16_t& val)
{
std::memcpy(&val, data, 2);
}
// read int32_t NDR (little endian)
inline void read_int32_ndr(const char* data, std::int32_t& val)
inline void read_int32_ndr(char const* data, std::int32_t& val)
{
std::memcpy(&val, data, 4);
}
// read double NDR (little endian)
inline void read_double_ndr(const char* data, double& val)
inline void read_double_ndr(char const* data, double& val)
{
std::memcpy(&val, &data[0], 8);
}
// read int16_t XDR (big endian)
inline void read_int16_xdr(const char* data, std::int16_t& val)
inline void read_int16_xdr(char const* data, std::int16_t& val)
{
val = static_cast<std::int16_t>((data[3] & 0xff) | ((data[2] & 0xff) << 8));
}
// read int32_t XDR (big endian)
inline void read_int32_xdr(const char* data, std::int32_t& val)
inline void read_int32_xdr(char const* data, std::int32_t& val)
{
val = (data[3] & 0xff) | ((data[2] & 0xff) << 8) | ((data[1] & 0xff) << 16) | ((data[0] & 0xff) << 24);
}
// read double XDR (big endian)
inline void read_double_xdr(const char* data, double& val)
inline void read_double_xdr(char const* data, double& val)
{
std::int64_t bits =
(static_cast<std::int64_t>(data[7]) & 0xff) | (static_cast<std::int64_t>(data[6]) & 0xff) << 8 |

View File

@ -54,7 +54,7 @@ class MAPNIK_DECL hit_grid
// mapping between pixel id and key
using feature_key_type = std::map<value_type, lookup_type>;
using feature_type = std::map<lookup_type, mapnik::feature_ptr>;
static const value_type base_mask;
static value_type const base_mask;
private:
std::size_t width_;
@ -117,7 +117,7 @@ class MAPNIK_DECL hit_grid
inline bool checkBounds(std::size_t x, std::size_t y) const { return (x < width_ && y < height_); }
hit_grid& operator=(const hit_grid&);
hit_grid& operator=(hit_grid const&);
public:
inline void setPixel(std::size_t x, std::size_t y, value_type feature_id)

View File

@ -49,7 +49,7 @@ struct gray16
{}
//--------------------------------------------------------------------
gray16(const self_type& c, unsigned a_)
gray16(self_type const& c, unsigned a_)
: v(c.v),
a(value_type(a_))
{}
@ -58,14 +58,14 @@ struct gray16
void clear() { v = a = 0; }
//--------------------------------------------------------------------
const self_type& transparent()
self_type const& transparent()
{
a = 0;
return *this;
}
//--------------------------------------------------------------------
const self_type& premultiply()
self_type const& premultiply()
{
if (a == base_mask)
return *this;
@ -79,7 +79,7 @@ struct gray16
}
//--------------------------------------------------------------------
const self_type& premultiply(unsigned a_)
self_type const& premultiply(unsigned a_)
{
if (a == base_mask && a_ >= base_mask)
return *this;
@ -95,7 +95,7 @@ struct gray16
}
//--------------------------------------------------------------------
const self_type& demultiply()
self_type const& demultiply()
{
if (a == base_mask)
return *this;
@ -120,7 +120,7 @@ struct gray16
}
//--------------------------------------------------------------------
AGG_INLINE void add(const self_type& c, unsigned cover)
AGG_INLINE void add(self_type const& c, unsigned cover)
{
calc_type cv, ca;
if (cover == agg::cover_mask)
@ -177,7 +177,7 @@ struct gray32
{}
//--------------------------------------------------------------------
gray32(const self_type& c, unsigned a_)
gray32(self_type const& c, unsigned a_)
: v(c.v),
a(value_type(a_))
{}
@ -186,14 +186,14 @@ struct gray32
void clear() { v = a = 0; }
//--------------------------------------------------------------------
const self_type& transparent()
self_type const& transparent()
{
a = 0;
return *this;
}
//--------------------------------------------------------------------
const self_type& premultiply()
self_type const& premultiply()
{
if (a == base_mask)
return *this;
@ -207,7 +207,7 @@ struct gray32
}
//--------------------------------------------------------------------
const self_type& premultiply(unsigned a_)
self_type const& premultiply(unsigned a_)
{
if (a == base_mask && a_ >= base_mask)
return *this;
@ -223,7 +223,7 @@ struct gray32
}
//--------------------------------------------------------------------
const self_type& demultiply()
self_type const& demultiply()
{
if (a == base_mask)
return *this;
@ -248,7 +248,7 @@ struct gray32
}
//--------------------------------------------------------------------
AGG_INLINE void add(const self_type& c, unsigned cover)
AGG_INLINE void add(self_type const& c, unsigned cover)
{
calc_type cv, ca;
if (cover == agg::cover_mask)
@ -305,7 +305,7 @@ struct gray64
{}
//--------------------------------------------------------------------
gray64(const self_type& c, unsigned a_)
gray64(self_type const& c, unsigned a_)
: v(c.v),
a(value_type(a_))
{}
@ -314,14 +314,14 @@ struct gray64
void clear() { v = a = 0; }
//--------------------------------------------------------------------
const self_type& transparent()
self_type const& transparent()
{
a = 0;
return *this;
}
//--------------------------------------------------------------------
const self_type& premultiply()
self_type const& premultiply()
{
if (a == base_mask)
return *this;
@ -335,7 +335,7 @@ struct gray64
}
//--------------------------------------------------------------------
const self_type& premultiply(unsigned a_)
self_type const& premultiply(unsigned a_)
{
if (a == base_mask && a_ >= base_mask)
return *this;
@ -351,7 +351,7 @@ struct gray64
}
//--------------------------------------------------------------------
const self_type& demultiply()
self_type const& demultiply()
{
if (a == base_mask)
return *this;
@ -376,7 +376,7 @@ struct gray64
}
//--------------------------------------------------------------------
AGG_INLINE void add(const self_type& c, unsigned cover)
AGG_INLINE void add(self_type const& c, unsigned cover)
{
calc_type cv, ca;
if (cover == agg::cover_mask)

View File

@ -57,14 +57,14 @@ class apply_gamma_dir_gray
public:
using value_type = typename ColorT::value_type;
apply_gamma_dir_gray(const GammaLut& gamma)
apply_gamma_dir_gray(GammaLut const& gamma)
: m_gamma(gamma)
{}
AGG_INLINE void operator()(value_type* p) { *p = m_gamma.dir(*p); }
private:
const GammaLut& m_gamma;
GammaLut const& m_gamma;
};
//=====================================================apply_gamma_inv_gray
@ -74,14 +74,14 @@ class apply_gamma_inv_gray
public:
using value_type = typename ColorT::value_type;
apply_gamma_inv_gray(const GammaLut& gamma)
apply_gamma_inv_gray(GammaLut const& gamma)
: m_gamma(gamma)
{}
AGG_INLINE void operator()(value_type* p) { *p = m_gamma.inv(*p); }
private:
const GammaLut& m_gamma;
GammaLut const& m_gamma;
};
//=================================================pixfmt_alpha_blend_gray
@ -107,7 +107,7 @@ class pixfmt_alpha_blend_gray
private:
//--------------------------------------------------------------------
static AGG_INLINE void copy_or_blend_pix(value_type* p, const color_type& c, unsigned cover)
static AGG_INLINE void copy_or_blend_pix(value_type* p, color_type const& c, unsigned cover)
{
if (c.a)
{
@ -123,7 +123,7 @@ class pixfmt_alpha_blend_gray
}
}
static AGG_INLINE void copy_or_blend_pix(value_type* p, const color_type& c)
static AGG_INLINE void copy_or_blend_pix(value_type* p, color_type const& c)
{
if (c.a)
{
@ -166,15 +166,15 @@ class pixfmt_alpha_blend_gray
//--------------------------------------------------------------------
agg::int8u* row_ptr(int y) { return m_rbuf->row_ptr(y); }
const agg::int8u* row_ptr(int y) const { return m_rbuf->row_ptr(y); }
agg::int8u const* row_ptr(int y) const { return m_rbuf->row_ptr(y); }
row_data row(int y) const { return m_rbuf->row(y); }
const agg::int8u* pix_ptr(int x, int y) const { return m_rbuf->row_ptr(y) + x * Step + Offset; }
agg::int8u const* pix_ptr(int x, int y) const { return m_rbuf->row_ptr(y) + x * Step + Offset; }
agg::int8u* pix_ptr(int x, int y) { return m_rbuf->row_ptr(y) + x * Step + Offset; }
//--------------------------------------------------------------------
AGG_INLINE static void make_pix(agg::int8u* p, const color_type& c) { *(value_type*)p = c.v; }
AGG_INLINE static void make_pix(agg::int8u* p, color_type const& c) { *(value_type*)p = c.v; }
//--------------------------------------------------------------------
AGG_INLINE color_type pixel(int x, int y) const
@ -184,19 +184,19 @@ class pixfmt_alpha_blend_gray
}
//--------------------------------------------------------------------
AGG_INLINE void copy_pixel(int x, int y, const color_type& c)
AGG_INLINE void copy_pixel(int x, int y, color_type const& c)
{
*((value_type*)m_rbuf->row_ptr(x, y, 1) + x * Step + Offset) = c.v;
}
//--------------------------------------------------------------------
AGG_INLINE void blend_pixel(int x, int y, const color_type& c, agg::int8u cover)
AGG_INLINE void blend_pixel(int x, int y, color_type const& c, agg::int8u cover)
{
copy_or_blend_pix((value_type*)m_rbuf->row_ptr(x, y, 1) + x * Step + Offset, c, cover);
}
//--------------------------------------------------------------------
AGG_INLINE void copy_hline(int x, int y, unsigned len, const color_type& c)
AGG_INLINE void copy_hline(int x, int y, unsigned len, color_type const& c)
{
value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + x * Step + Offset;
@ -208,7 +208,7 @@ class pixfmt_alpha_blend_gray
}
//--------------------------------------------------------------------
AGG_INLINE void copy_vline(int x, int y, unsigned len, const color_type& c)
AGG_INLINE void copy_vline(int x, int y, unsigned len, color_type const& c)
{
do
{
@ -219,7 +219,7 @@ class pixfmt_alpha_blend_gray
}
//--------------------------------------------------------------------
void blend_hline(int x, int y, unsigned len, const color_type& c, agg::int8u /*cover*/)
void blend_hline(int x, int y, unsigned len, color_type const& c, agg::int8u /*cover*/)
{
value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + x * Step + Offset;
do
@ -256,7 +256,7 @@ class pixfmt_alpha_blend_gray
}
//--------------------------------------------------------------------
void blend_vline(int x, int y, unsigned len, const color_type& c, agg::int8u cover)
void blend_vline(int x, int y, unsigned len, color_type const& c, agg::int8u cover)
{
if (c.a)
{
@ -284,7 +284,7 @@ class pixfmt_alpha_blend_gray
}
//--------------------------------------------------------------------
void blend_solid_hspan(int x, int y, unsigned len, const color_type& c, const agg::int8u* covers)
void blend_solid_hspan(int x, int y, unsigned len, color_type const& c, agg::int8u const* covers)
{
if (c.a)
{
@ -308,7 +308,7 @@ class pixfmt_alpha_blend_gray
}
//--------------------------------------------------------------------
void blend_solid_vspan(int x, int y, unsigned len, const color_type& c, const agg::int8u* covers)
void blend_solid_vspan(int x, int y, unsigned len, color_type const& c, agg::int8u const* covers)
{
if (c.a)
{
@ -332,7 +332,7 @@ class pixfmt_alpha_blend_gray
}
//--------------------------------------------------------------------
void copy_color_hspan(int x, int y, unsigned len, const color_type* colors)
void copy_color_hspan(int x, int y, unsigned len, color_type const* colors)
{
value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + x * Step + Offset;
@ -345,7 +345,7 @@ class pixfmt_alpha_blend_gray
}
//--------------------------------------------------------------------
void copy_color_vspan(int x, int y, unsigned len, const color_type* colors)
void copy_color_vspan(int x, int y, unsigned len, color_type const* colors)
{
do
{
@ -359,8 +359,8 @@ class pixfmt_alpha_blend_gray
void blend_color_hspan(int x,
int y,
unsigned len,
const color_type* colors,
const agg::int8u* covers,
color_type const* colors,
agg::int8u const* covers,
agg::int8u cover)
{
value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + x * Step + Offset;
@ -406,8 +406,8 @@ class pixfmt_alpha_blend_gray
void blend_color_vspan(int x,
int y,
unsigned len,
const color_type* colors,
const agg::int8u* covers,
color_type const* colors,
agg::int8u const* covers,
agg::int8u cover)
{
value_type* p;
@ -475,23 +475,23 @@ class pixfmt_alpha_blend_gray
//--------------------------------------------------------------------
template<typename GammaLut>
void apply_gamma_dir(const GammaLut& g)
void apply_gamma_dir(GammaLut const& g)
{
for_each_pixel(apply_gamma_dir_gray<color_type, GammaLut>(g));
}
//--------------------------------------------------------------------
template<typename GammaLut>
void apply_gamma_inv(const GammaLut& g)
void apply_gamma_inv(GammaLut const& g)
{
for_each_pixel(apply_gamma_inv_gray<color_type, GammaLut>(g));
}
//--------------------------------------------------------------------
template<typename RenBuf2>
void copy_from(const RenBuf2& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len)
void copy_from(RenBuf2 const& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len)
{
const agg::int8u* p = from.row_ptr(ysrc);
agg::int8u const* p = from.row_ptr(ysrc);
if (p)
{
memmove(m_rbuf->row_ptr(xdst, ydst, len) + xdst * pix_width, p + xsrc * pix_width, len * pix_width);
@ -500,8 +500,8 @@ class pixfmt_alpha_blend_gray
//--------------------------------------------------------------------
template<typename SrcPixelFormatRenderer>
void blend_from_color(const SrcPixelFormatRenderer& from,
const color_type& color,
void blend_from_color(SrcPixelFormatRenderer const& from,
color_type const& color,
int xdst,
int ydst,
int /*xsrc*/,
@ -510,7 +510,7 @@ class pixfmt_alpha_blend_gray
agg::int8u cover)
{
using src_value_type = typename SrcPixelFormatRenderer::value_type;
const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc);
src_value_type const* psrc = (src_value_type*)from.row_ptr(ysrc);
if (psrc)
{
value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + xdst;
@ -525,8 +525,8 @@ class pixfmt_alpha_blend_gray
//--------------------------------------------------------------------
template<typename SrcPixelFormatRenderer>
void blend_from_lut(const SrcPixelFormatRenderer& from,
const color_type* color_lut,
void blend_from_lut(SrcPixelFormatRenderer const& from,
color_type const* color_lut,
int xdst,
int ydst,
int /*xsrc*/,
@ -535,7 +535,7 @@ class pixfmt_alpha_blend_gray
agg::int8u cover)
{
using src_value_type = typename SrcPixelFormatRenderer::value_type;
const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc);
src_value_type const* psrc = (src_value_type*)from.row_ptr(ysrc);
if (psrc)
{
value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + xdst;

View File

@ -118,7 +118,7 @@ class MAPNIK_DECL grid_renderer : public feature_style_processor<grid_renderer<T
private:
buffer_type& pixmap_;
const std::unique_ptr<grid_rasterizer> ras_ptr;
std::unique_ptr<grid_rasterizer> const ras_ptr;
renderer_common common_;
void setup(Map const& m);
};

View File

@ -115,7 +115,7 @@ class hit_grid_view
inline T const& data() const { return data_; }
inline const unsigned char* raw_data() const { return data_.bytes(); }
inline unsigned char const* raw_data() const { return data_.bytes(); }
inline std::set<std::string> const& get_fields() const { return names_; }

View File

@ -84,7 +84,7 @@ class spiral_iterator
void rewind() { i_ = x_ = y_ = 0; }
private:
const unsigned end_;
unsigned const end_;
unsigned i_;
int x_, y_;
};
@ -162,7 +162,7 @@ struct grid_vertex_converter
// Polygon with huge area can lead to excessive memory allocation.
// This is more or less arbitrarily chosen limit for the maximum bitmap resolution.
// Bitmap bigger than this limit is scaled down to fit into this resolution.
const std::size_t max_size = 8192 * 8192;
std::size_t const max_size = 8192 * 8192;
if (size > max_size)
{
return std::sqrt(max_size / size);
@ -220,11 +220,11 @@ struct grid_vertex_converter
return vertex_processor.polygon_;
}
const double hit_bitmap_scale_;
const T dx_, dy_;
const view_transform vt_;
const image_gray8 hit_bitmap_;
const mapnik::geometry::point<T> interior_;
double const hit_bitmap_scale_;
T const dx_, dy_;
view_transform const vt_;
image_gray8 const hit_bitmap_;
mapnik::geometry::point<T> const interior_;
spiral_iterator si_;
};

View File

@ -43,25 +43,25 @@ struct MAPNIK_DECL group_rule
{
using symbolizers = std::vector<symbolizer>;
group_rule(const expression_ptr& filter = std::make_shared<mapnik::expr_node>(true),
const expression_ptr& repeat_key = expression_ptr());
group_rule(expression_ptr const& filter = std::make_shared<mapnik::expr_node>(true),
expression_ptr const& repeat_key = expression_ptr());
group_rule& operator=(const group_rule& rhs);
bool operator==(const group_rule& rhs) const;
group_rule& operator=(group_rule const& rhs);
bool operator==(group_rule const& rhs) const;
void append(const symbolizer&);
void append(symbolizer const&);
const symbolizers& get_symbolizers() const { return symbolizers_; }
symbolizers const& get_symbolizers() const { return symbolizers_; }
inline symbolizers::const_iterator begin() const { return symbolizers_.begin(); }
inline symbolizers::const_iterator end() const { return symbolizers_.end(); }
inline void set_filter(const expression_ptr& filter) { filter_ = filter; }
inline void set_filter(expression_ptr const& filter) { filter_ = filter; }
inline expression_ptr const& get_filter() const { return filter_; }
inline void set_repeat_key(const expression_ptr& repeat_key) { repeat_key_ = repeat_key; }
inline void set_repeat_key(expression_ptr const& repeat_key) { repeat_key_ = repeat_key; }
inline expression_ptr const& get_repeat_key() const { return repeat_key_; }

View File

@ -38,9 +38,9 @@ namespace mapnik {
struct RGBAPolicy
{
const static unsigned MAX_LEVELS = 6;
const static unsigned MIN_ALPHA = 5;
const static unsigned MAX_ALPHA = 250;
static unsigned const MAX_LEVELS = 6;
static unsigned const MIN_ALPHA = 5;
static unsigned const MAX_ALPHA = 250;
inline static unsigned index_from_level(unsigned level, rgba const& c)
{
unsigned shift = 7 - level;
@ -99,7 +99,7 @@ class hextree : private util::noncopyable
// highest reduce_cost first
struct node_rev_cmp
{
bool operator()(const node* lhs, const node* rhs) const
bool operator()(node const* lhs, node const* rhs) const
{
if (lhs->reduce_cost != rhs->reduce_cost)
{
@ -113,7 +113,7 @@ class hextree : private util::noncopyable
unsigned colors_;
// flag indicating existance of invisible pixels (a < InsertPolicy::MIN_ALPHA)
bool has_holes_;
const std::unique_ptr<node> root_;
std::unique_ptr<node> const root_;
// working palette for quantization, sorted on mean(r,g,b,a) for easier searching NN
std::vector<rgba> sorted_pal_;
// index remaping of sorted_pal_ indexes to indexes of returned image palette

View File

@ -135,10 +135,10 @@ namespace mapnik {
namespace filter {
namespace detail {
static const float blur_matrix[] = {0.1111f, 0.1111f, 0.1111f, 0.1111f, 0.1111f, 0.1111f, 0.1111f, 0.1111f, 0.1111f};
static const float emboss_matrix[] = {-2, -1, 0, -1, 1, 1, 0, 1, 2};
static const float sharpen_matrix[] = {0, -1, 0, -1, 5, -1, 0, -1, 0};
static const float edge_detect_matrix[] = {0, 1, 0, 1, -4, 1, 0, 1, 0};
static float const blur_matrix[] = {0.1111f, 0.1111f, 0.1111f, 0.1111f, 0.1111f, 0.1111f, 0.1111f, 0.1111f, 0.1111f};
static float const emboss_matrix[] = {-2, -1, 0, -1, 1, 1, 0, 1, 2};
static float const sharpen_matrix[] = {0, -1, 0, -1, 5, -1, 0, -1, 0};
static float const edge_detect_matrix[] = {0, 1, 0, 1, -4, 1, 0, 1, 0};
} // namespace detail

View File

@ -62,30 +62,30 @@ using x3::lit;
using x3::symbols;
using x3::uint_parser;
const auto push_back = [](auto& ctx) {
auto const push_back = [](auto& ctx) {
_val(ctx).push_back(_attr(ctx));
};
const auto set_rx_ry = [](auto& ctx) {
auto const set_rx_ry = [](auto& ctx) {
_val(ctx).rx = _val(ctx).ry = _attr(ctx);
};
const auto set_ry = [](auto& ctx) {
auto const set_ry = [](auto& ctx) {
_val(ctx).ry = _attr(ctx);
};
const auto offset_value = [](auto& ctx) {
auto const offset_value = [](auto& ctx) {
_val(ctx) = _attr(ctx);
};
const auto percent = [](auto& ctx) {
auto const percent = [](auto& ctx) {
double val = std::abs(_val(ctx) / 100.0);
if (val > 1.0)
val = 1.0;
_val(ctx) = val;
};
const x3::uint_parser<unsigned, 10, 1, 3> radius;
x3::uint_parser<unsigned, 10, 1, 3> const radius;
// Import the expression rule
namespace {

View File

@ -158,7 +158,7 @@ inline typename image<T>::pixel_type& image<T>::operator()(std::size_t i, std::s
}
template<typename T>
inline const typename image<T>::pixel_type& image<T>::operator()(std::size_t i, std::size_t j) const
inline typename image<T>::pixel_type const& image<T>::operator()(std::size_t i, std::size_t j) const
{
assert(i < dimensions_.width() && j < dimensions_.height());
return *get_row(j, i);
@ -195,9 +195,9 @@ inline void image<T>::set(pixel_type const& t)
}
template<typename T>
inline const typename image<T>::pixel_type* image<T>::data() const
inline typename image<T>::pixel_type const* image<T>::data() const
{
return reinterpret_cast<const pixel_type*>(buffer_.data());
return reinterpret_cast<pixel_type const*>(buffer_.data());
}
template<typename T>
@ -207,7 +207,7 @@ inline typename image<T>::pixel_type* image<T>::data()
}
template<typename T>
inline const unsigned char* image<T>::bytes() const
inline unsigned char const* image<T>::bytes() const
{
return buffer_.data();
}
@ -250,7 +250,7 @@ inline typename image<T>::pixel_type const* image<T>::get_row(std::size_t row) c
}
template<typename T>
inline const typename image<T>::pixel_type* image<T>::get_row(std::size_t row, std::size_t x0) const
inline typename image<T>::pixel_type const* image<T>::get_row(std::size_t row, std::size_t x0) const
{
return data() + row * dimensions_.width() + x0;
}

View File

@ -38,7 +38,7 @@ class MAPNIK_DECL image<null_t>
{
public:
using pixel_type = null_t::type;
static const image_dtype dtype = null_t::id;
static image_dtype const dtype = null_t::id;
private:
public:
@ -65,7 +65,7 @@ class MAPNIK_DECL image<null_t>
{
throw std::runtime_error("Can not get or set values for null image");
}
unsigned const char* bytes() const { return nullptr; }
unsigned char const* bytes() const { return nullptr; }
unsigned char* bytes() { return nullptr; }
double get_offset() const { return 0.0; }
void set_offset(double) {}

View File

@ -48,7 +48,7 @@ class image_reader_exception : public std::exception
~image_reader_exception() {}
virtual const char* what() const noexcept { return message_.c_str(); }
virtual char const* what() const noexcept { return message_.c_str(); }
};
struct MAPNIK_DECL image_reader : private util::noncopyable

View File

@ -63,7 +63,7 @@ class image_writer_exception : public std::exception
~image_writer_exception() {}
virtual const char* what() const noexcept { return message_.c_str(); }
virtual char const* what() const noexcept { return message_.c_str(); }
};
template<typename T>

View File

@ -35,7 +35,7 @@ class MAPNIK_DECL image_view<image_null>
{
public:
using pixel_type = image_null::pixel_type;
static const image_dtype dtype = image_null::dtype;
static image_dtype const dtype = image_null::dtype;
image_view() {}
~image_view(){};
@ -55,8 +55,8 @@ class MAPNIK_DECL image_view<image_null>
}
std::size_t size() const { return 0; }
std::size_t row_size() const { return 0; }
const pixel_type* get_row(std::size_t) const { return nullptr; }
const pixel_type* get_row(std::size_t, std::size_t) const { return nullptr; }
pixel_type const* get_row(std::size_t) const { return nullptr; }
pixel_type const* get_row(std::size_t, std::size_t) const { return nullptr; }
bool get_premultiplied() const { return false; }
double get_offset() const { return 0.0; }
double get_scaling() const { return 1.0; }

View File

@ -111,7 +111,7 @@ void save_as_jpeg(T1& file, int quality, T2 const& image)
JSAMPLE* row = reinterpret_cast<JSAMPLE*>(::operator new(sizeof(JSAMPLE) * width * 3));
while (cinfo.next_scanline < cinfo.image_height)
{
const unsigned* imageRow = image.get_row(cinfo.next_scanline);
unsigned const* imageRow = image.get_row(cinfo.next_scanline);
int index = 0;
for (int i = 0; i < width; ++i)
{

View File

@ -158,10 +158,10 @@ struct geometry_type_ : x3::symbols<mapnik::geometry::geometry_types>
namespace {
const auto assign_name = [](auto const& ctx) {
auto const assign_name = [](auto const& ctx) {
std::get<0>(_val(ctx)) = std::move(_attr(ctx));
};
const auto assign_value = [](auto const& ctx) {
auto const assign_value = [](auto const& ctx) {
std::get<1>(_val(ctx)) = std::move(_attr(ctx));
};
@ -207,7 +207,7 @@ auto const assign_collection = [](auto const& ctx) {
std::get<2>(_val(ctx)) = std::move(_attr(ctx));
};
const auto assign_property = [](auto const& ctx) {
auto const assign_property = [](auto const& ctx) {
mapnik::feature_impl& feature = x3::get<grammar::feature_tag>(ctx);
mapnik::transcoder const& tr = x3::get<grammar::transcoder_tag>(ctx);
feature.put_new(std::get<0>(_attr(ctx)),

View File

@ -35,27 +35,27 @@ namespace x3 = boost::spirit::x3;
namespace {
const auto make_null = [](auto const& ctx) {
auto const make_null = [](auto const& ctx) {
_val(ctx) = mapnik::value_null{};
};
const auto make_true = [](auto const& ctx) {
auto const make_true = [](auto const& ctx) {
_val(ctx) = true;
};
const auto make_false = [](auto const& ctx) {
auto const make_false = [](auto const& ctx) {
_val(ctx) = false;
};
const auto assign = [](auto const& ctx) {
auto const assign = [](auto const& ctx) {
_val(ctx) = std::move(_attr(ctx));
};
const auto assign_key = [](auto const& ctx) {
auto const assign_key = [](auto const& ctx) {
std::get<0>(_val(ctx)) = std::move(_attr(ctx));
};
const auto assign_value = [](auto const& ctx) {
auto const assign_value = [](auto const& ctx) {
std::get<1>(_val(ctx)) = std::move(_attr(ctx));
};
@ -64,7 +64,7 @@ const auto assign_value = [](auto const& ctx) {
using x3::lit;
// import unicode string rule
const auto json_string = mapnik::json::grammar::unicode_string;
auto const json_string = mapnik::json::grammar::unicode_string;
// rules
x3::rule<class json_object_tag, json_object> const object("JSON Object");

View File

@ -35,30 +35,30 @@ namespace grammar {
namespace x3 = boost::spirit::x3;
const auto make_null = [](auto const& ctx) {
auto const make_null = [](auto const& ctx) {
_val(ctx) = mapnik::value_null{};
};
const auto make_true = [](auto const& ctx) {
auto const make_true = [](auto const& ctx) {
_val(ctx) = true;
};
const auto make_false = [](auto const& ctx) {
auto const make_false = [](auto const& ctx) {
_val(ctx) = false;
};
const auto assign = [](auto const& ctx) {
auto const assign = [](auto const& ctx) {
_val(ctx) = std::move(_attr(ctx));
};
const auto assign_key = [](auto const& ctx) {
auto const assign_key = [](auto const& ctx) {
std::string const& name = _attr(ctx);
keys_map& keys = x3::get<keys_tag>(ctx);
auto result = keys.insert(keys_map::value_type(name, keys.size() + 1));
std::get<0>(_val(ctx)) = result.first->right;
};
const auto assign_value = [](auto const& ctx) {
auto const assign_value = [](auto const& ctx) {
std::get<1>(_val(ctx)) = std::move(_attr(ctx));
};
@ -95,9 +95,9 @@ auto const geojson_double = x3::real_parser<value_double, x3::strict_real_polici
auto const geojson_integer = x3::int_parser<value_integer, 10, 1, -1>();
// import unicode string rule
const auto geojson_string = unicode_string;
auto const geojson_string = unicode_string;
// import positions rule
const auto positions_rule = positions;
auto const positions_rule = positions;
// GeoJSON types
// clang-format off

View File

@ -35,7 +35,7 @@ using x3::double_;
using x3::lit;
using x3::omit;
const auto assign_helper = [](auto const& ctx) {
auto const assign_helper = [](auto const& ctx) {
_val(ctx) = std::move(_attr(ctx));
};

View File

@ -169,7 +169,7 @@ struct create_multi_polygon
}
};
const auto create_geometry = [](auto const& ctx) {
auto const create_geometry = [](auto const& ctx) {
auto const geom_type = std::get<0>(_attr(ctx));
auto const& coord = std::get<1>(_attr(ctx));
auto const& arcs = std::get<2>(_attr(ctx));
@ -199,27 +199,27 @@ const auto create_geometry = [](auto const& ctx) {
_val(ctx) = std::move(geom);
};
const auto assign_bbox = [](auto const& ctx) {
auto const assign_bbox = [](auto const& ctx) {
_val(ctx).bbox = std::move(_attr(ctx));
};
const auto assign_transform = [](auto const& ctx) {
auto const assign_transform = [](auto const& ctx) {
_val(ctx).tr = std::move(_attr(ctx));
};
const auto assign_arcs = [](auto const& ctx) {
auto const assign_arcs = [](auto const& ctx) {
_val(ctx).arcs = std::move(_attr(ctx));
};
const auto assign_objects = [](auto const& ctx) {
auto const assign_objects = [](auto const& ctx) {
_val(ctx).geometries = std::move(_attr(ctx));
};
const auto push_geometry = [](auto const& ctx) {
auto const push_geometry = [](auto const& ctx) {
_val(ctx).push_back(std::move(_attr(ctx)));
};
const auto push_collection = [](auto const& ctx) {
auto const push_collection = [](auto const& ctx) {
auto& dest = _val(ctx);
auto& src = _attr(ctx);
if (dest.empty())
@ -231,27 +231,27 @@ const auto push_collection = [](auto const& ctx) {
}
};
const auto assign_geometry_type = [](auto const& ctx) {
auto const assign_geometry_type = [](auto const& ctx) {
std::get<0>(_val(ctx)) = _attr(ctx);
};
const auto assign_coordinates = [](auto const& ctx) {
auto const assign_coordinates = [](auto const& ctx) {
std::get<1>(_val(ctx)) = std::move(_attr(ctx));
};
const auto assign_rings = [](auto const& ctx) {
auto const assign_rings = [](auto const& ctx) {
std::get<2>(_val(ctx)) = std::move(_attr(ctx));
};
const auto assign_properties = [](auto const& ctx) {
auto const assign_properties = [](auto const& ctx) {
std::get<3>(_val(ctx)) = std::move(_attr(ctx));
};
const auto assign_prop_name = [](auto const& ctx) {
auto const assign_prop_name = [](auto const& ctx) {
std::get<0>(_val(ctx)) = std::move(_attr(ctx));
};
const auto assign_prop_value = [](auto const& ctx) {
auto const assign_prop_value = [](auto const& ctx) {
std::get<1>(_val(ctx)) = std::move(_attr(ctx));
};
@ -263,9 +263,9 @@ using x3::lit;
using x3::omit;
// import unicode string rule
const auto json_string = json::grammar::unicode_string;
auto const json_string = json::grammar::unicode_string;
// json value
const auto json_value = json::grammar::value;
auto const json_value = json::grammar::value;
using coordinates_type = util::variant<topojson::coordinate, std::vector<topojson::coordinate>>;
using arcs_type = util::variant<std::vector<index_type>,

View File

@ -35,7 +35,7 @@ namespace x3 = boost::spirit::x3;
using uchar = std::uint32_t; // a unicode code point
const auto append = [](auto const& ctx) {
auto const append = [](auto const& ctx) {
_val(ctx) += _attr(ctx);
};
@ -50,15 +50,15 @@ static inline void push_utf8_impl(std::string& str, uchar code_point)
}
} // namespace detail
const auto push_char = [](auto const& ctx) {
auto const push_char = [](auto const& ctx) {
_val(ctx).push_back(_attr(ctx));
};
const auto push_utf8 = [](auto const& ctx) {
auto const push_utf8 = [](auto const& ctx) {
detail::push_utf8_impl(_val(ctx), _attr(ctx));
};
const auto push_utf16 = [](auto const& ctx) {
auto const push_utf16 = [](auto const& ctx) {
using iterator_type = std::vector<std::uint16_t>::const_iterator;
auto const& utf16 = _attr(ctx);
try
@ -76,7 +76,7 @@ const auto push_utf16 = [](auto const& ctx) {
}
};
const auto push_esc = [](auto const& ctx) {
auto const push_esc = [](auto const& ctx) {
std::string& utf8 = _val(ctx);
char c = _attr(ctx);
switch (c)

View File

@ -75,8 +75,8 @@ class MAPNIK_DECL Map : boost::equality_comparable<Map>
};
private:
static const unsigned MIN_MAPSIZE = 16;
static const unsigned MAX_MAPSIZE = MIN_MAPSIZE << 10;
static unsigned const MIN_MAPSIZE = 16;
static unsigned const MAX_MAPSIZE = MIN_MAPSIZE << 10;
unsigned width_;
unsigned height_;
std::string srs_;

View File

@ -40,7 +40,7 @@ class MAPNIK_DECL memory_datasource : public datasource
public:
memory_datasource(parameters const& params);
static const char* name();
static char const* name();
virtual ~memory_datasource();
virtual datasource::datasource_t type() const;
virtual featureset_ptr features(query const& q) const;

View File

@ -37,8 +37,8 @@ namespace mapnik {
struct RGBPolicy
{
const static unsigned MAX_LEVELS = 6;
const static unsigned MIN_LEVELS = 2;
static unsigned const MAX_LEVELS = 6;
static unsigned const MIN_LEVELS = 2;
inline static unsigned index_from_level(unsigned level, rgb const& c)
{
unsigned shift = 7 - level;
@ -88,7 +88,7 @@ class octree : private util::noncopyable
};
struct node_cmp
{
bool operator()(const node* lhs, const node* rhs) const { return lhs->reduce_cost < rhs->reduce_cost; }
bool operator()(node const* lhs, node const* rhs) const { return lhs->reduce_cost < rhs->reduce_cost; }
};
std::deque<node*> reducible_[InsertPolicy::MAX_LEVELS];

View File

@ -68,7 +68,7 @@ struct MAPNIK_DECL rgb
{}
rgb(rgba const& c);
inline bool operator==(const rgb& y) const { return r == y.r && g == y.g && b == y.b; }
inline bool operator==(rgb const& y) const { return r == y.r && g == y.g && b == y.b; }
};
struct MAPNIK_DECL rgba
@ -104,7 +104,7 @@ struct MAPNIK_DECL rgba
// ordering by mean(a,r,g,b), a, r, g, b
struct MAPNIK_DECL mean_sort_cmp
{
bool operator()(const rgba& x, const rgba& y) const;
bool operator()(rgba const& x, rgba const& y) const;
};
inline bool operator<(rgba const& y) const { return std::tie(r, g, b, a) < std::tie(y.r, y.g, y.b, y.a); }

View File

@ -35,7 +35,7 @@ template<typename T, template<typename> class Container = vertex_vector>
class path : private util::noncopyable
{
public:
static const std::uint8_t geometry_bits = 7;
static std::uint8_t const geometry_bits = 7;
enum types : std::uint8_t {
Unknown = 0x00,
Point = 0x01,

View File

@ -32,10 +32,10 @@ namespace grammar {
namespace x3 = boost::spirit::x3;
using x3::lexeme;
using x3::standard_wide::char_;
const auto create_string = [](auto& ctx) {
auto const create_string = [](auto& ctx) {
_val(ctx).push_back(_attr(ctx));
};
const auto create_attribute = [](auto& ctx) {
auto const create_attribute = [](auto& ctx) {
_val(ctx).push_back(mapnik::attribute(_attr(ctx)));
};
// rules

View File

@ -46,62 +46,62 @@ enum image_dtype : std::uint8_t {
struct null_t
{
using type = std::uint8_t;
static const image_dtype id = image_dtype_null;
static image_dtype const id = image_dtype_null;
};
struct rgba8_t
{
using type = std::uint32_t;
static const image_dtype id = image_dtype_rgba8;
static image_dtype const id = image_dtype_rgba8;
};
struct gray8_t
{
using type = std::uint8_t;
static const image_dtype id = image_dtype_gray8;
static image_dtype const id = image_dtype_gray8;
};
struct gray8s_t
{
using type = std::int8_t;
static const image_dtype id = image_dtype_gray8s;
static image_dtype const id = image_dtype_gray8s;
};
struct gray16_t
{
using type = std::uint16_t;
static const image_dtype id = image_dtype_gray16;
static image_dtype const id = image_dtype_gray16;
};
struct gray16s_t
{
using type = std::int16_t;
static const image_dtype id = image_dtype_gray16s;
static image_dtype const id = image_dtype_gray16s;
};
struct gray32_t
{
using type = std::uint32_t;
static const image_dtype id = image_dtype_gray32;
static image_dtype const id = image_dtype_gray32;
};
struct gray32s_t
{
using type = std::int32_t;
static const image_dtype id = image_dtype_gray32s;
static image_dtype const id = image_dtype_gray32s;
};
struct gray32f_t
{
using type = float;
static const image_dtype id = image_dtype_gray32f;
static image_dtype const id = image_dtype_gray32f;
};
struct gray64_t
{
using type = std::uint64_t;
static const image_dtype id = image_dtype_gray64;
static image_dtype const id = image_dtype_gray64;
};
struct gray64s_t
{
using type = std::int64_t;
static const image_dtype id = image_dtype_gray64s;
static image_dtype const id = image_dtype_gray64s;
};
struct gray64f_t
{
using type = double;
static const image_dtype id = image_dtype_gray64f;
static image_dtype const id = image_dtype_gray64f;
};
} // namespace mapnik

View File

@ -37,7 +37,7 @@ using mapnik_lib_t = struct _mapnik_lib_t;
class PluginInfo : util::noncopyable
{
public:
using callable_returning_string = const char* (*)();
using callable_returning_string = char const* (*)();
using callable_returning_void = void (*)();
PluginInfo(std::string const& filename, std::string const& library_name);
~PluginInfo();

View File

@ -129,10 +129,10 @@ void save_as_png(T1& file, T2 const& image, png_options const& opts)
PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT,
PNG_FILTER_TYPE_DEFAULT);
const std::unique_ptr<png_bytep[]> row_pointers(new png_bytep[image.height()]);
std::unique_ptr<png_bytep[]> const row_pointers(new png_bytep[image.height()]);
for (unsigned int i = 0; i < image.height(); ++i)
{
row_pointers[i] = const_cast<png_bytep>(reinterpret_cast<const unsigned char*>(image.get_row(i)));
row_pointers[i] = const_cast<png_bytep>(reinterpret_cast<unsigned char const*>(image.get_row(i)));
}
png_set_rows(png_ptr, info_ptr, row_pointers.get());
png_write_png(png_ptr,
@ -313,7 +313,7 @@ void save_as_png(T& file,
PNG_COMPRESSION_TYPE_DEFAULT,
PNG_FILTER_TYPE_DEFAULT);
png_color* pal = const_cast<png_color*>(reinterpret_cast<const png_color*>(&palette[0]));
png_color* pal = const_cast<png_color*>(reinterpret_cast<png_color const*>(&palette[0]));
png_set_PLTE(png_ptr, info_ptr, pal, static_cast<unsigned>(palette.size()));
// make transparent lowest indexes, so tRNS is small
@ -350,7 +350,7 @@ void save_as_png8_oct(T1& file, T2 const& image, png_options const& opts)
{
// number of alpha ranges in png8 format; 2 results in smallest image with binary transparency
// 3 is minimum for semitransparency, 4 is recommended, anything else is worse
const unsigned TRANSPARENCY_LEVELS = (opts.trans_mode == 2 || opts.trans_mode < 0) ? MAX_OCTREE_LEVELS : 2;
unsigned const TRANSPARENCY_LEVELS = (opts.trans_mode == 2 || opts.trans_mode < 0) ? MAX_OCTREE_LEVELS : 2;
unsigned width = image.width();
unsigned height = image.height();
unsigned alphaHist[256]; // transparency histogram

View File

@ -52,7 +52,7 @@ class Pool : private util::noncopyable
#endif
public:
Pool(const Creator<T>& creator, unsigned initialSize, unsigned maxSize)
Pool(Creator<T> const& creator, unsigned initialSize, unsigned maxSize)
: creator_(creator),
initialSize_(initialSize),
maxSize_(maxSize)

View File

@ -31,7 +31,7 @@ class proj_transform; // fwd decl
namespace proj_transform_cache {
MAPNIK_DECL void init(std::string const& source, std::string const& dest);
MAPNIK_DECL proj_transform const* get(std::string const& source, std::string const& dest);
MAPNIK_DECL const proj_transform* get(std::string const& source, std::string const& dest);
} // namespace proj_transform_cache
} // namespace mapnik

View File

@ -69,8 +69,8 @@ class MAPNIK_DECL projection
~projection();
projection& operator=(projection const& rhs);
bool operator==(const projection& other) const;
bool operator!=(const projection& other) const;
bool operator==(projection const& other) const;
bool operator!=(projection const& other) const;
bool is_initialized() const;
bool is_geographic() const;
std::optional<well_known_srs_e> well_known() const;

View File

@ -309,8 +309,8 @@ class quad_tree : util::noncopyable
}
}
const unsigned int max_depth_;
const double ratio_;
unsigned int const max_depth_;
double const ratio_;
result_type query_result_;
nodes_type nodes_;
node* root_;

View File

@ -198,7 +198,7 @@ class MAPNIK_DECL raster_colorizer
//! \brief Set the epsilon value for exact mode
//! \param[in] e The epsilon value
inline void set_epsilon(const float e)
inline void set_epsilon(float const e)
{
if (e > 0)
epsilon_ = e;

View File

@ -52,25 +52,25 @@ void render_point_symbolizer(point_symbolizer const& sym,
if (!mark->is<mapnik::marker_null>())
{
const value_double opacity = get<value_double, keys::opacity>(sym, feature, common.vars_);
const value_bool allow_overlap = get<value_bool, keys::allow_overlap>(sym, feature, common.vars_);
const value_bool ignore_placement = get<value_bool, keys::ignore_placement>(sym, feature, common.vars_);
const point_placement_enum placement =
value_double const opacity = get<value_double, keys::opacity>(sym, feature, common.vars_);
value_bool const allow_overlap = get<value_bool, keys::allow_overlap>(sym, feature, common.vars_);
value_bool const ignore_placement = get<value_bool, keys::ignore_placement>(sym, feature, common.vars_);
point_placement_enum const placement =
get<point_placement_enum, keys::point_placement_type>(sym, feature, common.vars_);
const box2d<double>& bbox = mark->bounding_box();
const coord2d center = bbox.center();
box2d<double> const& bbox = mark->bounding_box();
coord2d const center = bbox.center();
agg::trans_affine tr;
const auto image_transform = get_optional<transform_type>(sym, keys::image_transform);
auto const image_transform = get_optional<transform_type>(sym, keys::image_transform);
if (image_transform)
evaluate_transform(tr, feature, common.vars_, *image_transform, common.scale_factor_);
const agg::trans_affine_translation recenter(-center.x, -center.y);
const agg::trans_affine recenter_tr = recenter * tr;
agg::trans_affine_translation const recenter(-center.x, -center.y);
agg::trans_affine const recenter_tr = recenter * tr;
box2d<double> label_ext = bbox * recenter_tr * agg::trans_affine_scaling(common.scale_factor_);
const mapnik::geometry::geometry<double>& geometry = feature.get_geometry();
mapnik::geometry::geometry<double> const& geometry = feature.get_geometry();
mapnik::geometry::point<double> pt;
geometry::geometry_types type = geometry::geometry_type(geometry);
if (placement == point_placement_enum::CENTROID_POINT_PLACEMENT || type == geometry::geometry_types::Point ||

View File

@ -54,7 +54,7 @@ class MAPNIK_DECL rule
rule(std::string const& name,
double min_scale_denominator = 0,
double max_scale_denominator = std::numeric_limits<double>::infinity());
rule(const rule& rhs);
rule(rule const& rhs);
rule(rule&& rhs);
rule& operator=(rule rhs);
bool operator==(rule const& rhs) const;

View File

@ -121,16 +121,16 @@ struct numeric_compare<T,
template<typename T, typename Enable = void>
struct bounds
{
static const T lowest() { return static_cast<T>(-std::numeric_limits<T>::max()); }
static const T highest() { return std::numeric_limits<T>::max(); }
static T const lowest() { return static_cast<T>(-std::numeric_limits<T>::max()); }
static T const highest() { return std::numeric_limits<T>::max(); }
};
// integers
template<typename T>
struct bounds<T, typename std::enable_if<std::numeric_limits<T>::is_integer>::type>
{
static const T lowest() { return std::numeric_limits<T>::min(); }
static const T highest() { return std::numeric_limits<T>::max(); }
static T const lowest() { return std::numeric_limits<T>::min(); }
static T const highest() { return std::numeric_limits<T>::max(); }
};
} // namespace detail
@ -138,8 +138,8 @@ struct bounds<T, typename std::enable_if<std::numeric_limits<T>::is_integer>::ty
template<typename T, typename S>
inline T safe_cast(S s)
{
static const auto max_val = detail::bounds<T>::highest();
static const auto min_val = detail::bounds<T>::lowest();
static auto const max_val = detail::bounds<T>::highest();
static auto const min_val = detail::bounds<T>::lowest();
if (detail::numeric_compare<S, T>::greater(s, max_val))
{

View File

@ -46,7 +46,7 @@ struct weighted_vertex : private util::noncopyable
struct ascending_sort
{
bool operator()(const weighted_vertex* a, const weighted_vertex* b) const { return b->weight > a->weight; }
bool operator()(weighted_vertex const* a, weighted_vertex const* b) const { return b->weight > a->weight; }
};
};
@ -477,7 +477,7 @@ struct simplify_converter
return status_ = process;
}
void RDP(std::vector<vertex2d>& vertices, const size_t first, const size_t last)
void RDP(std::vector<vertex2d>& vertices, size_t const first, size_t const last)
{
// Squared length of a vector
auto sqlen = [](vertex2d const& vec) {

View File

@ -68,7 +68,7 @@ class span_image_resample_gray_affine : public agg::span_image_resample_affine<S
int radius_y = (diameter * base_type::m_ry) >> 1;
int len_x_lr = (diameter * base_type::m_rx + agg::image_subpixel_mask) >> agg::image_subpixel_shift;
const agg::int16* weight_array = base_type::filter().weight_array();
agg::int16 const* weight_array = base_type::filter().weight_array();
do
{
@ -78,7 +78,7 @@ class span_image_resample_gray_affine : public agg::span_image_resample_affine<S
{
int src_x = x >> agg::image_subpixel_shift;
int src_y = y >> agg::image_subpixel_shift;
const value_type* pix = reinterpret_cast<const value_type*>(base_type::source().span(src_x, src_y, 1));
value_type const* pix = reinterpret_cast<value_type const*>(base_type::source().span(src_x, src_y, 1));
if (*nodata_value_ == *pix)
{
span->v = *nodata_value_;
@ -103,8 +103,8 @@ class span_image_resample_gray_affine : public agg::span_image_resample_affine<S
agg::image_subpixel_shift;
int x_hr2 = x_hr;
const value_type* fg_ptr =
reinterpret_cast<const value_type*>(base_type::source().span(x_lr, y_lr, len_x_lr));
value_type const* fg_ptr =
reinterpret_cast<value_type const*>(base_type::source().span(x_lr, y_lr, len_x_lr));
for (;;)
{
int weight_y = weight_array[y_hr];
@ -120,12 +120,12 @@ class span_image_resample_gray_affine : public agg::span_image_resample_affine<S
x_hr += base_type::m_rx_inv;
if (x_hr >= filter_scale)
break;
fg_ptr = reinterpret_cast<const value_type*>(base_type::source().next_x());
fg_ptr = reinterpret_cast<value_type const*>(base_type::source().next_x());
}
y_hr += base_type::m_ry_inv;
if (y_hr >= filter_scale)
break;
fg_ptr = reinterpret_cast<const value_type*>(base_type::source().next_y());
fg_ptr = reinterpret_cast<value_type const*>(base_type::source().next_y());
}
if (total_weight == 0)

View File

@ -125,9 +125,9 @@ inline std::string unquote_copy(char quot, std::string const& str)
s << ",\"" << field << "\"";
}
const std::regex re_from{"\\bFROM\\b", std::regex::icase};
std::regex const re_from{"\\bFROM\\b", std::regex::icase};
const std::regex re_table_name{"\\s*(\\w+|(\"[^\"]*\")+)" // $1 = schema
std::regex const re_table_name{"\\s*(\\w+|(\"[^\"]*\")+)" // $1 = schema
"(\\.(\\w+|(\"[^\"]*\")+))?" // $4 = table
"\\s*"};

View File

@ -122,10 +122,10 @@ struct rect_output_attributes
fill_color_("#000000")
{}
rect_output_attributes(const int x,
const int y,
const unsigned width,
const unsigned height,
rect_output_attributes(int const x,
int const y,
unsigned const width,
unsigned const height,
color const& _fill_color)
: x_(x),
y_(y),
@ -134,10 +134,10 @@ struct rect_output_attributes
fill_color_(_fill_color.to_hex_string())
{}
void set_x(const int x);
void set_y(const int y);
void set_width(const unsigned width);
void set_height(const unsigned height);
void set_x(int const x);
void set_y(int const y);
void set_width(unsigned const width);
void set_height(unsigned const height);
void set_fill_color(color const& fill_color);
int x() const;
@ -174,10 +174,10 @@ struct root_output_attributes
{
root_output_attributes();
root_output_attributes(const unsigned width, const unsigned height);
root_output_attributes(unsigned const width, unsigned const height);
void set_width(const unsigned width);
void set_height(const unsigned height);
void set_width(unsigned const width);
void set_height(unsigned const height);
void set_svg_version(double svg_version);
void set_svg_namespace_url(std::string const& svg_namespace_url);
@ -192,9 +192,9 @@ struct root_output_attributes
void reset();
// SVG version to which the generated document will be compliant.
static const double SVG_VERSION;
static double const SVG_VERSION;
// SVG XML namespace url.
static const std::string SVG_NAMESPACE_URL;
static std::string const SVG_NAMESPACE_URL;
// private:
unsigned width_;

View File

@ -123,7 +123,7 @@ class MAPNIK_DECL svg_renderer : public feature_style_processor<svg_renderer<Out
inline OutputIterator& get_output_iterator() { return output_iterator_; }
inline const OutputIterator& get_output_iterator() const { return output_iterator_; }
inline OutputIterator const& get_output_iterator() const { return output_iterator_; }
private:
OutputIterator& output_iterator_;

View File

@ -42,7 +42,7 @@ class MAPNIK_DECL svg_parser_exception : public std::exception
~svg_parser_exception() {}
virtual const char* what() const noexcept { return message_.c_str(); }
virtual char const* what() const noexcept { return message_.c_str(); }
private:
std::string message_;

View File

@ -101,7 +101,7 @@ class path_adapter : util::noncopyable
// Accessors
//--------------------------------------------------------------------
const container_type& vertices() const { return vertices_; }
container_type const& vertices() const { return vertices_; }
container_type& vertices() { return vertices_; }
std::size_t total_vertices() const;
@ -208,7 +208,7 @@ class path_adapter : util::noncopyable
//--------------------------------------------------------------------
template<class Trans>
void transform(const Trans& trans, unsigned path_id = 0)
void transform(Trans const& trans, unsigned path_id = 0)
{
unsigned num_ver = vertices_.total_vertices();
for (; path_id < num_ver; path_id++)
@ -227,7 +227,7 @@ class path_adapter : util::noncopyable
//--------------------------------------------------------------------
template<class Trans>
void transform_all_paths(const Trans& trans)
void transform_all_paths(Trans const& trans)
{
unsigned idx;
unsigned num_ver = vertices_.total_vertices();
@ -355,7 +355,7 @@ void path_adapter<VC>::arc_to(double rx,
{
if (vertices_.total_vertices() && is_vertex(vertices_.last_command()))
{
const double epsilon = 1e-30;
double const epsilon = 1e-30;
double x0 = 0.0;
double y0 = 0.0;
vertices_.last_vertex(&x0, &y0);
@ -899,7 +899,7 @@ class vertex_stl_adapter : util::noncopyable
unsigned vertex(unsigned idx, double* x, double* y) const
{
const vertex_type& v = vertices_[idx];
vertex_type const& v = vertices_[idx];
*x = v.x;
*y = v.y;
return v.cmd;

View File

@ -33,18 +33,18 @@ namespace mapnik {
namespace svg {
template<typename PathType>
bool parse_path(const char* wkt, PathType& p);
bool parse_path(char const* wkt, PathType& p);
template<typename PathType>
bool parse_points(const char* wkt, PathType& p);
bool parse_points(char const* wkt, PathType& p);
template<typename TransformType>
bool parse_svg_transform(const char* wkt, TransformType& tr);
bool parse_svg_transform(char const* wkt, TransformType& tr);
//
extern template bool MAPNIK_DECL parse_path<svg_converter_type>(const char*, svg_converter_type&);
extern template bool MAPNIK_DECL parse_points<svg_converter_type>(const char*, svg_converter_type&);
extern template bool MAPNIK_DECL parse_svg_transform<agg::trans_affine>(const char*, agg::trans_affine&);
extern template bool MAPNIK_DECL parse_path<svg_converter_type>(char const*, svg_converter_type&);
extern template bool MAPNIK_DECL parse_points<svg_converter_type>(char const*, svg_converter_type&);
extern template bool MAPNIK_DECL parse_svg_transform<agg::trans_affine>(char const*, agg::trans_affine&);
} // namespace svg
} // namespace mapnik

View File

@ -383,8 +383,8 @@ struct extract_raw_value
}
};
using property_meta_type = std::tuple<const char*, std::function<std::string(enumeration_wrapper)>, property_types>;
MAPNIK_DECL property_meta_type const& get_meta(mapnik::keys key);
using property_meta_type = std::tuple<char const*, std::function<std::string(enumeration_wrapper)>, property_types>;
MAPNIK_DECL const property_meta_type& get_meta(mapnik::keys key);
MAPNIK_DECL mapnik::keys get_key(std::string const& name);
template<typename T>

View File

@ -101,7 +101,7 @@ struct strict_value : value_base_type
{
strict_value() = default;
strict_value(const char* val) noexcept(false)
strict_value(char const* val) noexcept(false)
: value_base_type(std::string(val))
{}

View File

@ -384,14 +384,14 @@ struct set_symbolizer_property_impl
using value_type = T;
try
{
const auto val = node.get_opt_attr<value_type>(name);
auto const val = node.get_opt_attr<value_type>(name);
if (val)
put(sym, key, *val);
}
catch (config_error const& ex)
{
// try parsing as an expression
const auto val = node.get_opt_attr<expression_ptr>(name);
auto const val = node.get_opt_attr<expression_ptr>(name);
if (val)
{
// first try pre-evaluate expressions which don't have dynamic properties
@ -419,7 +419,7 @@ struct set_symbolizer_property_impl<Symbolizer, transform_type, false>
{
static void apply(Symbolizer& sym, keys key, std::string const& name, xml_node const& node)
{
const auto transform = node.get_opt_attr<std::string>(name);
auto const transform = node.get_opt_attr<std::string>(name);
if (transform)
put(sym, key, mapnik::parse_transform(*transform));
}
@ -430,7 +430,7 @@ struct set_symbolizer_property_impl<Symbolizer, dash_array, false>
{
static void apply(Symbolizer& sym, keys key, std::string const& name, xml_node const& node)
{
const auto str = node.get_opt_attr<std::string>(name);
auto const str = node.get_opt_attr<std::string>(name);
if (str)
{
dash_array dash;
@ -440,11 +440,11 @@ struct set_symbolizer_property_impl<Symbolizer, dash_array, false>
}
else
{
const auto val = node.get_opt_attr<expression_ptr>(name);
auto const val = node.get_opt_attr<expression_ptr>(name);
if (val)
{
// first try pre-evaluate expressions which don't have dynamic properties
const auto [value, is_evaluated] = pre_evaluate_expression<mapnik::value>(*val);
auto const [value, is_evaluated] = pre_evaluate_expression<mapnik::value>(*val);
if (is_evaluated)
{
set_property_from_value(sym, key, value);
@ -471,24 +471,24 @@ struct set_symbolizer_property_impl<Symbolizer, T, true>
static void apply(Symbolizer& sym, keys key, std::string const& name, xml_node const& node)
{
using value_type = T;
const auto enum_str = node.get_opt_attr<std::string>(name);
auto const enum_str = node.get_opt_attr<std::string>(name);
if (enum_str)
{
const auto enum_val = detail::enum_traits<value_type>::from_string(*enum_str);
auto const enum_val = detail::enum_traits<value_type>::from_string(*enum_str);
if (enum_val)
{
put(sym, key, *enum_val);
}
else
{
const auto val = node.get_opt_attr<expression_ptr>(name);
auto const val = node.get_opt_attr<expression_ptr>(name);
if (val)
{
// first try pre-evaluating expression
const auto [result_value, is_evaluated] = pre_evaluate_expression<value>(*val);
auto const [result_value, is_evaluated] = pre_evaluate_expression<value>(*val);
if (is_evaluated)
{
const auto enum_val2 = detail::enum_traits<value_type>::from_string(result_value.to_string());
auto const enum_val2 = detail::enum_traits<value_type>::from_string(result_value.to_string());
if (enum_val2)
{
put(sym, key, *enum_val);

View File

@ -70,7 +70,7 @@ class MAPNIK_DECL font_face : util::noncopyable
bool init_color_font();
FT_Face face_;
const bool color_font_;
bool const color_font_;
};
using face_ptr = std::shared_ptr<font_face>;

View File

@ -62,7 +62,7 @@ class MAPNIK_DECL font_feature_settings
void append(std::string const& feature);
void append(font_feature const& feature) { features_.push_back(feature); }
const font_feature* get_features() const { return features_.data(); }
font_feature const* get_features() const { return features_.data(); }
feature_vector::size_type count() const { return features_.size(); }
feature_vector const& features() const { return features_; }
@ -84,7 +84,7 @@ inline bool operator==(font_feature_settings const& lhs, font_feature_settings c
}
constexpr unsigned int font_feature_range_global_start = 0u;
static const unsigned int font_feature_range_global_end = std::numeric_limits<unsigned int>::max();
static unsigned int const font_feature_range_global_end = std::numeric_limits<unsigned int>::max();
#include <mapnik/warning.hpp>
MAPNIK_DISABLE_WARNING_PUSH

View File

@ -55,12 +55,12 @@ static inline hb_script_t _icu_script_to_script(UScriptCode script)
return hb_script_from_string(uscript_getShortName(script), -1);
}
static inline const uint16_t* uchar_to_utf16(const UChar* src)
static inline uint16_t const* uchar_to_utf16(UChar const* src)
{
static_assert(sizeof(UChar) == sizeof(uint16_t), "UChar is eq size to uint16_t");
#if defined(_MSC_VER) || (U_ICU_VERSION_MAJOR_NUM >= 59)
// ^^ http://site.icu-project.org/download/59#TOC-ICU4C-char16_t1
return reinterpret_cast<const uint16_t*>(src);
return reinterpret_cast<uint16_t const*>(src);
#else
return src;
#endif
@ -241,7 +241,7 @@ struct harfbuzz_shaper
auto hb_buffer_deleter = [](hb_buffer_t* buffer) {
hb_buffer_destroy(buffer);
};
const std::unique_ptr<hb_buffer_t, decltype(hb_buffer_deleter)> buffer(hb_buffer_create(), hb_buffer_deleter);
std::unique_ptr<hb_buffer_t, decltype(hb_buffer_deleter)> const buffer(hb_buffer_create(), hb_buffer_deleter);
hb_buffer_pre_allocate(buffer.get(), safe_cast<int>(length));
mapnik::value_unicode_string const& text = itemizer.text();
for (auto const& text_item : list)

View File

@ -70,7 +70,7 @@ class placement_finder : util::noncopyable
// Adjusts user defined spacing to place an integer number of labels.
double get_spacing(double path_length, double layout_width) const;
// Checks for collision.
bool collision(box2d<double> const& box, const value_unicode_string& repeat_key, bool line_placement) const;
bool collision(box2d<double> const& box, value_unicode_string const& repeat_key, bool line_placement) const;
// Adds marker to glyph_positions and to collision detector. Returns false if there is a collision.
bool add_marker(glyph_positions_ptr& glyphs, pixel_position const& pos, std::vector<box2d<double>>& bboxes) const;
// Maps upright==auto, left-only and right-only to left,right to simplify processing.

View File

@ -60,13 +60,13 @@ struct set_property_from_xml_impl
{
try
{
const auto val_ = node.get_opt_attr<target_type>(name);
auto const val_ = node.get_opt_attr<target_type>(name);
if (val_)
val = *val_;
}
catch (config_error const& ex)
{
const auto val_ = node.get_opt_attr<expression_ptr>(name);
auto const val_ = node.get_opt_attr<expression_ptr>(name);
if (val_)
val = *val_;
else
@ -86,14 +86,14 @@ struct set_property_from_xml_impl<std::string, false>
{
try
{
const auto val_ = node.get_opt_attr<expression_ptr>(name);
auto const val_ = node.get_opt_attr<expression_ptr>(name);
if (!val_)
throw config_error("Failed to extract property");
val = *val_;
}
catch (config_error const& ex)
{
const auto val_ = node.get_opt_attr<target_type>(name);
auto const val_ = node.get_opt_attr<target_type>(name);
if (val_)
{
val = *val_;
@ -115,7 +115,7 @@ struct set_property_from_xml_impl<T0, true>
{
try
{
const auto enum_str = node.get_opt_attr<std::string>(name);
auto const enum_str = node.get_opt_attr<std::string>(name);
if (enum_str)
{
target_enum_type e;
@ -125,7 +125,7 @@ struct set_property_from_xml_impl<T0, true>
}
catch (...)
{
const auto expr = node.get_opt_attr<expression_ptr>(name);
auto const expr = node.get_opt_attr<expression_ptr>(name);
if (expr)
val = *expr;
else

Some files were not shown because too many files have changed in this diff Show More