diff --git a/firmware/application/file.cpp b/firmware/application/file.cpp index 439c0a9c..4898ee74 100644 --- a/firmware/application/file.cpp +++ b/firmware/application/file.cpp @@ -25,7 +25,7 @@ File::~File() { close(); } -bool File::open_for_append(const std::string file_path) { +bool File::open_for_append(const std::string& file_path) { const auto open_result = f_open(&f, file_path.c_str(), FA_WRITE | FA_OPEN_ALWAYS); if( open_result == FR_OK ) { const auto seek_result = f_lseek(&f, f_size(&f)); @@ -60,7 +60,7 @@ bool File::write(const void* const data, const size_t bytes_to_write) { return (result == FR_OK) && (bytes_written == bytes_to_write); } -bool File::puts(const std::string string) { +bool File::puts(const std::string& string) { const auto result = f_puts(string.c_str(), &f); return (result >= 0); } diff --git a/firmware/application/file.hpp b/firmware/application/file.hpp index 363bd866..24705a8e 100644 --- a/firmware/application/file.hpp +++ b/firmware/application/file.hpp @@ -31,7 +31,7 @@ class File { public: ~File(); - bool open_for_append(const std::string file_path); + bool open_for_append(const std::string& file_path); bool close(); bool is_ready(); @@ -39,7 +39,7 @@ public: bool read(void* const data, const size_t bytes_to_read); bool write(const void* const data, const size_t bytes_to_write); - bool puts(const std::string string); + bool puts(const std::string& string); bool sync(); diff --git a/firmware/application/ui_console.cpp b/firmware/application/ui_console.cpp index 65482236..28b9f298 100644 --- a/firmware/application/ui_console.cpp +++ b/firmware/application/ui_console.cpp @@ -35,7 +35,7 @@ void Console::clear() { display.scroll_set_position(0); } -void Console::write(const std::string message) { +void Console::write(const std::string& message) { const Style& s = style(); const Font& font = s.font; const auto rect = screen_rect(); @@ -58,7 +58,7 @@ void Console::write(const std::string message) { } } -void Console::writeln(const std::string message) { +void Console::writeln(const std::string& message) { write(message); crlf(); } diff --git a/firmware/application/ui_console.hpp b/firmware/application/ui_console.hpp index 4f29486a..db49acc7 100644 --- a/firmware/application/ui_console.hpp +++ b/firmware/application/ui_console.hpp @@ -33,8 +33,8 @@ namespace ui { class Console : public Widget { public: void clear(); - void write(const std::string message); - void writeln(const std::string message); + void write(const std::string& message); + void writeln(const std::string& message); void paint(Painter& painter) override; diff --git a/firmware/application/ui_menu.hpp b/firmware/application/ui_menu.hpp index 5863e048..3c01e98c 100644 --- a/firmware/application/ui_menu.hpp +++ b/firmware/application/ui_menu.hpp @@ -70,7 +70,7 @@ public: void add_item(const MenuItem item); template - void add_items(const std::array items) { + void add_items(const std::array& items) { for(const auto& item : items) { add_item(item); } diff --git a/firmware/application/ui_setup.cpp b/firmware/application/ui_setup.cpp index 596d1534..95beba9b 100644 --- a/firmware/application/ui_setup.cpp +++ b/firmware/application/ui_setup.cpp @@ -82,7 +82,7 @@ void SetDateTimeView::focus() { button_cancel.focus(); } -void SetDateTimeView::form_init(const SetDateTimeModel model) { +void SetDateTimeView::form_init(const SetDateTimeModel& model) { field_year.set_value(model.year); field_month.set_value(model.month); field_day.set_value(model.day); @@ -134,7 +134,7 @@ void SetFrequencyCorrectionView::focus() { button_cancel.focus(); } -void SetFrequencyCorrectionView::form_init(const SetFrequencyCorrectionModel model) { +void SetFrequencyCorrectionView::form_init(const SetFrequencyCorrectionModel& model) { field_ppm.set_value(model.ppm); } diff --git a/firmware/application/ui_setup.hpp b/firmware/application/ui_setup.hpp index c012d5fc..cb205292 100644 --- a/firmware/application/ui_setup.hpp +++ b/firmware/application/ui_setup.hpp @@ -128,7 +128,7 @@ private: "Cancel", }; - void form_init(const SetDateTimeModel model); + void form_init(const SetDateTimeModel& model); SetDateTimeModel form_collect(); }; @@ -172,7 +172,7 @@ private: "Cancel", }; - void form_init(const SetFrequencyCorrectionModel model); + void form_init(const SetFrequencyCorrectionModel& model); SetFrequencyCorrectionModel form_collect(); };