mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-28 16:29:34 +08:00
Warn against Microsoft <windows.h> min and max macro (#1084)
Warn users they have defined the min/max macros which is not compatible with other code from the standard library or FTXUI. Co-authored-by: Sylko Olzscher <sylko.olzscher@solostec.ch> Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
@@ -23,8 +23,9 @@ bool GeneratorBool(const char*& data, size_t& size) {
|
||||
|
||||
std::string GeneratorString(const char*& data, size_t& size) {
|
||||
int index = 0;
|
||||
while (index < size && data[index])
|
||||
while (index < size && data[index]) {
|
||||
++index;
|
||||
}
|
||||
|
||||
auto out = std::string(data, data + index);
|
||||
data += index;
|
||||
@@ -40,8 +41,9 @@ std::string GeneratorString(const char*& data, size_t& size) {
|
||||
}
|
||||
|
||||
int GeneratorInt(const char* data, size_t size) {
|
||||
if (size == 0)
|
||||
if (size == 0) {
|
||||
return 0;
|
||||
}
|
||||
auto out = int(data[0]);
|
||||
data++;
|
||||
size--;
|
||||
@@ -113,8 +115,9 @@ Components GeneratorComponents(const char*& data, size_t& size, int depth);
|
||||
Component GeneratorComponent(const char*& data, size_t& size, int depth) {
|
||||
depth--;
|
||||
int value = GeneratorInt(data, size);
|
||||
if (depth <= 0)
|
||||
if (depth <= 0) {
|
||||
return Button(GeneratorString(data, size), [] {});
|
||||
}
|
||||
|
||||
constexpr int value_max = 19;
|
||||
value = (value % value_max + value_max) % value_max;
|
||||
|
Reference in New Issue
Block a user