fix some warnings (#660)

Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
Prokop Randáček 2023-06-03 13:59:39 +02:00 committed by GitHub
parent d464a071da
commit 59bbe3ed5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
73 changed files with 77 additions and 77 deletions

View File

@ -9,7 +9,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
int value = 50;
// The tree of components. This defines how to navigate using the keyboard.

View File

@ -11,7 +11,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
int value = 50;
// The tree of components. This defines how to navigate using the keyboard.

View File

@ -11,7 +11,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
int counter = 0;
auto on_click = [&] { counter++; };

View File

@ -10,7 +10,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
int value = 0;
auto action = [&] { value++; };
auto action_renderer =

View File

@ -14,7 +14,7 @@
#include "ftxui/dom/canvas.hpp" // for Canvas
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
int mouse_x = 0;

View File

@ -8,12 +8,12 @@
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
Component input_list = Container::Vertical({});
std::vector<std::string> items(100, "");
for (int i = 0; i < items.size(); ++i) {
for (size_t i = 0; i < items.size(); ++i) {
input_list->Add(Input(&(items[i]), "placeholder " + std::to_string(i)));
}

View File

@ -10,7 +10,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
std::array<bool, 30> states;
auto container = Container::Vertical({});

View File

@ -26,7 +26,7 @@ Component Empty() {
return std::make_shared<ComponentBase>();
}
int main(int argc, const char* argv[]) {
int main() {
auto component =
Collapsible("Collapsible 1",
Inner({

View File

@ -11,7 +11,7 @@ using namespace ftxui;
// An example of how to compose multiple components into one and maintain their
// interactiveness.
int main(int argc, const char* argv[]) {
int main() {
auto left_count = 0;
auto right_count = 0;

View File

@ -11,7 +11,7 @@
#include "ftxui/component/loop.hpp" // for Loop
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto screen = ScreenInteractive::FitComponent();

View File

@ -5,7 +5,7 @@
#include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
std::vector<std::string> entries = {

View File

@ -13,7 +13,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::Fullscreen();
int direction_index = 0;

View File

@ -31,7 +31,7 @@ Element make_grid() {
return gridbox(rows);
};
int main(int argc, const char* argv[]) {
int main() {
float focus_x = 0.5f;
float focus_y = 0.5f;

View File

@ -19,7 +19,7 @@ Component Instance(std::string label, Decorator focusCursor) {
});
};
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::Fullscreen();
screen.Loop(Container::Vertical({
Instance("focus", focus),

View File

@ -23,7 +23,7 @@ Component Wrap(std::string name, Component component) {
});
}
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::FitComponent();
// -- Menu

View File

@ -24,7 +24,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::Fullscreen();
// ---------------------------------------------------------------------------

View File

@ -9,7 +9,7 @@
#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
#include "ftxui/util/ref.hpp" // for Ref
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
std::string first_name;

View File

@ -10,7 +10,7 @@
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
#include "ftxui/dom/elements.hpp" // for operator|=, Element, bgcolor, operator|, separatorEmpty, color, borderEmpty, separator, text, center, dim, hbox, vbox, border, borderDouble, borderRounded
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
InputOption style_1 = InputOption::Default();

View File

@ -9,7 +9,7 @@
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto screen = ScreenInteractive::Fullscreen();

View File

@ -10,7 +10,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
std::vector<std::string> entries = {
"entry 1",
"entry 2",

View File

@ -8,7 +8,7 @@
#include "ftxui/component/component_options.hpp" // for MenuOption
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto screen = ScreenInteractive::TerminalOutput();

View File

@ -10,7 +10,7 @@
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
#include "ftxui/dom/elements.hpp" // for text, separator, bold, hcenter, vbox, hbox, gauge, Element, operator|, border
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto screen = ScreenInteractive::TerminalOutput();

View File

@ -28,7 +28,7 @@ MenuEntryOption Colored(ftxui::Color c) {
return option;
}
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::TerminalOutput();
int selected = 0;

View File

@ -24,7 +24,7 @@ MenuEntryOption Colored(ftxui::Color c) {
return option;
}
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::TerminalOutput();
int selected = 0;

View File

@ -10,7 +10,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
std::vector<std::string> entries;
int selected = 0;

View File

@ -17,7 +17,7 @@ Component Window(std::string title, Component component) {
});
}
int main(int argc, const char* argv[]) {
int main() {
int menu_selected[] = {0, 0, 0};
std::vector<std::vector<std::string>> menu_entries = {
{

View File

@ -30,7 +30,7 @@ Component HMenu3(std::vector<std::string>* entries, int* selected);
Component HMenu4(std::vector<std::string>* entries, int* selected);
Component HMenu5(std::vector<std::string>* entries, int* selected);
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::TerminalOutput();
std::vector<std::string> entries{

View File

@ -27,7 +27,7 @@ Component Text(const std::string& t) {
return Renderer([t] { return text(t) | borderEmpty; });
}
int main(int argc, const char* argv[]) {
int main() {
using namespace std::literals;
std::vector<std::string> tab_values{
"Tab 1", "Tab 2", "Tab 3", "A very very long tab", "",

View File

@ -8,7 +8,7 @@
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
#include "ftxui/dom/elements.hpp" // for operator|, Element, filler, text, hbox, separator, center, vbox, bold, border, clear_under, dbox, size, GREATER_THAN, HEIGHT
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto screen = ScreenInteractive::TerminalOutput();

View File

@ -35,7 +35,7 @@ void Nested(std::string path) {
screen.Loop(renderer);
}
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::FitComponent();
auto button_quit = Button("Quit", screen.ExitLoopClosure());
auto button_nested = Button("Nested", [] { Nested(""); });

View File

@ -134,7 +134,7 @@ std::string Stringify(Event event) {
return out;
}
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::TerminalOutput();
std::vector<Event> keys;

View File

@ -7,7 +7,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
std::vector<std::string> radiobox_list = {
"Use gcc",
"Use clang",

View File

@ -10,7 +10,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
std::vector<std::string> entries;
int selected = 0;

View File

@ -7,7 +7,7 @@
#include "ftxui/dom/elements.hpp" // for operator|, Element, text, bold, border, center, color
#include "ftxui/screen/color.hpp" // for Color, Color::Red
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto screen = ScreenInteractive::FitComponent();

View File

@ -8,7 +8,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::Fullscreen();
auto middle = Renderer([] { return text("middle") | center; });

View File

@ -4,7 +4,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::TerminalOutput();
int value = 50;
auto slider = Slider("Value:", &value, 0, 100, 1);

View File

@ -13,7 +13,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
auto screen = ScreenInteractive::TerminalOutput();
std::array<int, 30> values;
for (int i = 0; i < values.size(); ++i) {
@ -21,10 +21,10 @@ int main(int argc, const char* argv[]) {
}
auto layout_horizontal = Container::Horizontal({});
for (int i = 0; i < values.size(); ++i) {
for (auto& value : values) {
// In C++17:
SliderOption<int> option;
option.value = &values[i];
option.value = &value;
option.max = 100;
option.increment = 5;
option.direction = Direction::Up;

View File

@ -23,7 +23,7 @@ Element ColorString(int red, int green, int blue) {
);
}
int main(int argc, const char* argv[]) {
int main() {
int red = 128;
int green = 25;
int blue = 100;

View File

@ -10,7 +10,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
std::vector<std::string> tab_values{
"tab_1",
"tab_2",

View File

@ -10,7 +10,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
std::vector<std::string> tab_values{
"tab_1",
"tab_2",

View File

@ -7,7 +7,7 @@
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
#include "ftxui/dom/elements.hpp" // for operator|, separator, text, Element, flex, vbox, border
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
std::string content_1;

View File

@ -10,7 +10,7 @@
using namespace ftxui;
int main(int argc, const char* argv[]) {
int main() {
std::vector<std::string> toggle_1_entries = {
"On",
"Off",

View File

@ -6,7 +6,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto make_boxed = [] {

View File

@ -6,7 +6,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = vbox({

View File

@ -8,7 +8,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto c = Canvas(100, 100);

View File

@ -10,7 +10,7 @@
using namespace ftxui;
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
int main(int argc, const char* argv[]) {
int main() {
std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
// Draw every columns

View File

@ -6,7 +6,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for Color, ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
int saturation = 255;

View File

@ -6,7 +6,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for Color, ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
int saturation = 255;

View File

@ -5,7 +5,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = dbox({
vbox({

View File

@ -8,7 +8,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
using namespace std::chrono_literals;

View File

@ -8,7 +8,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
using namespace std::chrono_literals;

View File

@ -6,7 +6,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto cell = [](const char* t) { return text(t) | border; };
auto document = //

View File

@ -6,7 +6,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto make_box = [](int dimx, int dimy) {
std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);

View File

@ -9,7 +9,7 @@
#include "ftxui/screen/box.hpp" // for ftxui
#include "ftxui/screen/color.hpp" // for Color, Color::Red
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
using namespace std::chrono_literals;

View File

@ -6,7 +6,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for Color, Color::DeepPink1, Color::DeepSkyBlue1, Color::Yellow, ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = text("gradient") | center;

View File

@ -12,7 +12,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for Color, Color::Green, Color::Red, Color::RedLight, ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
struct Task {

View File

@ -10,13 +10,13 @@
#include "ftxui/screen/box.hpp" // for ftxui
using namespace std::chrono_literals;
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
std::string p =
R"(In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule) describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For example, if cancer is related to age, then, using Bayes' theorem, a person's age can be used to more accurately assess the probability that they have cancer, compared to the assessment of the probability of cancer made without knowledge of the person's age. One of the many applications of Bayes' theorem is Bayesian inference, a particular approach to statistical inference. When applied, the probabilities involved in Bayes' theorem may have different probability interpretations. With the Bayesian probability interpretation the theorem expresses how a subjective degree of belief should rationally change to account for availability of related evidence. Bayesian inference is fundamental to Bayesian statistics.)";
std::string reset_position;
for (int i = 0;; ++i) {
while (true) {
auto document = vbox({
hflow(paragraph(p)),
separator(),

View File

@ -5,7 +5,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = hbox({
text("left-column"),

View File

@ -6,7 +6,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = vbox({

View File

@ -7,7 +7,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto make_box = [](const std::string& title) {
return window(text(title) | hcenter | bold,

View File

@ -10,7 +10,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
using namespace std::chrono_literals;

View File

@ -5,7 +5,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = //
hbox({

View File

@ -5,7 +5,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = //
hbox({

View File

@ -6,7 +6,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for Color, operator""_rgb, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::DeepSkyBlue4, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::SkyBlue1, Color::White, Color::Yellow, Color::YellowLight, ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = hbox({
vbox({

View File

@ -5,7 +5,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = //
hbox({

View File

@ -5,7 +5,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
// clang-format off
auto document =

View File

@ -5,7 +5,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = hbox({
text("This text is "),

View File

@ -5,7 +5,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = //
hbox({

View File

@ -5,7 +5,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = //
hbox({

View File

@ -5,7 +5,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = //
hbox({

View File

@ -8,7 +8,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::White, ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto table = Table({

View File

@ -6,7 +6,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto document = //
vbox({

View File

@ -6,7 +6,7 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
int main(int argc, const char* argv[]) {
int main() {
using namespace ftxui;
auto make_box = [](int dimx, int dimy) {
std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);