Uncrustify maxscale
See script directory for method. The script to run in the top level MaxScale directory is called maxscale-uncrustify.sh, which uses another script, list-src, from the same directory (so you need to set your PATH). The uncrustify version was 0.66.
This commit is contained in:
@ -84,7 +84,7 @@ bool GtidList::can_replicate_from(const GtidList& master_gtid)
|
||||
{
|
||||
/* The result of this function is false if the source and master have a common domain id where
|
||||
* the source is ahead of the master. */
|
||||
return (events_ahead(master_gtid, MISSING_DOMAIN_IGNORE) == 0);
|
||||
return events_ahead(master_gtid, MISSING_DOMAIN_IGNORE) == 0;
|
||||
}
|
||||
|
||||
bool GtidList::empty() const
|
||||
@ -92,7 +92,7 @@ bool GtidList::empty() const
|
||||
return m_triplets.empty();
|
||||
}
|
||||
|
||||
bool GtidList::operator == (const GtidList& rhs) const
|
||||
bool GtidList::operator==(const GtidList& rhs) const
|
||||
{
|
||||
return m_triplets == rhs.m_triplets;
|
||||
}
|
||||
@ -110,8 +110,8 @@ uint64_t GtidList::events_ahead(const GtidList& rhs, substraction_mode_t domain_
|
||||
auto lhs_triplet = m_triplets[ind_lhs];
|
||||
auto rhs_triplet = rhs.m_triplets[ind_rhs];
|
||||
// Server id -1 should never be saved in a real gtid variable.
|
||||
mxb_assert(lhs_triplet.m_server_id != SERVER_ID_UNKNOWN &&
|
||||
rhs_triplet.m_server_id != SERVER_ID_UNKNOWN);
|
||||
mxb_assert(lhs_triplet.m_server_id != SERVER_ID_UNKNOWN
|
||||
&& rhs_triplet.m_server_id != SERVER_ID_UNKNOWN);
|
||||
// Search for matching domain_id:s, advance the smaller one.
|
||||
if (lhs_triplet.m_domain < rhs_triplet.m_domain)
|
||||
{
|
||||
@ -145,8 +145,8 @@ uint64_t GtidList::events_ahead(const GtidList& rhs, substraction_mode_t domain_
|
||||
Gtid Gtid::from_string(const char* str, char** endptr)
|
||||
{
|
||||
/* Error checking the gtid string is a bit questionable, as having an error means that the server is
|
||||
buggy or network has faults, in which case nothing can be trusted. But without error checking
|
||||
MaxScale may crash if string is wrong. */
|
||||
* buggy or network has faults, in which case nothing can be trusted. But without error checking
|
||||
* MaxScale may crash if string is wrong. */
|
||||
mxb_assert(endptr);
|
||||
const char* ptr = str;
|
||||
char* strtoull_endptr = NULL;
|
||||
@ -199,13 +199,15 @@ Gtid::Gtid()
|
||||
: m_domain(0)
|
||||
, m_server_id(SERVER_ID_UNKNOWN)
|
||||
, m_sequence(0)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
Gtid::Gtid(uint32_t domain, int64_t server_id, uint64_t sequence)
|
||||
: m_domain(domain)
|
||||
, m_server_id(server_id)
|
||||
, m_sequence(sequence)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
bool Gtid::eq(const Gtid& rhs) const
|
||||
{
|
||||
@ -227,7 +229,9 @@ Gtid GtidList::get_gtid(uint32_t domain) const
|
||||
Gtid rval;
|
||||
// Make a dummy triplet for the domain search
|
||||
Gtid search_val(domain, -1, 0);
|
||||
auto found = std::lower_bound(m_triplets.begin(), m_triplets.end(), search_val,
|
||||
auto found = std::lower_bound(m_triplets.begin(),
|
||||
m_triplets.end(),
|
||||
search_val,
|
||||
Gtid::compare_domains);
|
||||
if (found != m_triplets.end() && found->m_domain == domain)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user