Don't right-align escaped newlines, e.g. for #define. This has previously led to long diffs in the commit history.
This commit is contained in:
+16
-16
@@ -37,23 +37,23 @@
|
||||
static constexpr char hex_char_table_upper[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
|
||||
static constexpr char hex_char_table_lower[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||
|
||||
#define BSEARCH_CHAR_RANGE(m_array) \
|
||||
int low = 0; \
|
||||
int high = std_size(m_array) - 1; \
|
||||
int middle = (low + high) / 2; \
|
||||
\
|
||||
while (low <= high) { \
|
||||
if (p_char < m_array[middle].start) { \
|
||||
high = middle - 1; \
|
||||
#define BSEARCH_CHAR_RANGE(m_array) \
|
||||
int low = 0; \
|
||||
int high = std_size(m_array) - 1; \
|
||||
int middle = (low + high) / 2; \
|
||||
\
|
||||
while (low <= high) { \
|
||||
if (p_char < m_array[middle].start) { \
|
||||
high = middle - 1; \
|
||||
} else if (p_char > m_array[middle].end) { \
|
||||
low = middle + 1; \
|
||||
} else { \
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
middle = (low + high) / 2; \
|
||||
} \
|
||||
\
|
||||
low = middle + 1; \
|
||||
} else { \
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
middle = (low + high) / 2; \
|
||||
} \
|
||||
\
|
||||
return false
|
||||
|
||||
constexpr bool is_unicode_identifier_start(char32_t p_char) {
|
||||
|
||||
@@ -58,11 +58,11 @@ extern void print_error(const String &p_string);
|
||||
extern bool is_print_verbose_enabled();
|
||||
|
||||
// This version avoids processing the text to be printed until it actually has to be printed, saving some CPU usage.
|
||||
#define print_verbose(m_text) \
|
||||
{ \
|
||||
#define print_verbose(m_text) \
|
||||
{ \
|
||||
if (is_print_verbose_enabled()) { \
|
||||
print_line(m_text); \
|
||||
} \
|
||||
print_line(m_text); \
|
||||
} \
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
|
||||
+10
-10
@@ -1645,16 +1645,16 @@ String String::hex_encode_buffer(const uint8_t *p_buffer, int p_len) {
|
||||
Vector<uint8_t> String::hex_decode() const {
|
||||
ERR_FAIL_COND_V_MSG(length() % 2 != 0, Vector<uint8_t>(), "Hexadecimal string of uneven length.");
|
||||
|
||||
#define HEX_TO_BYTE(m_output, m_index) \
|
||||
uint8_t m_output; \
|
||||
c = operator[](m_index); \
|
||||
if (is_digit(c)) { \
|
||||
m_output = c - '0'; \
|
||||
} else if (c >= 'a' && c <= 'f') { \
|
||||
m_output = c - 'a' + 10; \
|
||||
} else if (c >= 'A' && c <= 'F') { \
|
||||
m_output = c - 'A' + 10; \
|
||||
} else { \
|
||||
#define HEX_TO_BYTE(m_output, m_index) \
|
||||
uint8_t m_output; \
|
||||
c = operator[](m_index); \
|
||||
if (is_digit(c)) { \
|
||||
m_output = c - '0'; \
|
||||
} else if (c >= 'a' && c <= 'f') { \
|
||||
m_output = c - 'a' + 10; \
|
||||
} else if (c >= 'A' && c <= 'F') { \
|
||||
m_output = c - 'A' + 10; \
|
||||
} else { \
|
||||
ERR_FAIL_V_MSG(Vector<uint8_t>(), "Invalid hexadecimal character \"" + chr(c) + "\" at index " + m_index + "."); \
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user