mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-05-23 11:38:22 +00:00
Make assorted arguments pass-by-reference.
This commit is contained in:
parent
a9451c17b4
commit
3172fb1ad6
@ -25,7 +25,7 @@ File::~File() {
|
|||||||
close();
|
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);
|
const auto open_result = f_open(&f, file_path.c_str(), FA_WRITE | FA_OPEN_ALWAYS);
|
||||||
if( open_result == FR_OK ) {
|
if( open_result == FR_OK ) {
|
||||||
const auto seek_result = f_lseek(&f, f_size(&f));
|
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);
|
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);
|
const auto result = f_puts(string.c_str(), &f);
|
||||||
return (result >= 0);
|
return (result >= 0);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ class File {
|
|||||||
public:
|
public:
|
||||||
~File();
|
~File();
|
||||||
|
|
||||||
bool open_for_append(const std::string file_path);
|
bool open_for_append(const std::string& file_path);
|
||||||
bool close();
|
bool close();
|
||||||
|
|
||||||
bool is_ready();
|
bool is_ready();
|
||||||
@ -39,7 +39,7 @@ public:
|
|||||||
bool read(void* const data, const size_t bytes_to_read);
|
bool read(void* const data, const size_t bytes_to_read);
|
||||||
bool write(const void* const data, const size_t bytes_to_write);
|
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();
|
bool sync();
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ void Console::clear() {
|
|||||||
display.scroll_set_position(0);
|
display.scroll_set_position(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Console::write(const std::string message) {
|
void Console::write(const std::string& message) {
|
||||||
const Style& s = style();
|
const Style& s = style();
|
||||||
const Font& font = s.font;
|
const Font& font = s.font;
|
||||||
const auto rect = screen_rect();
|
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);
|
write(message);
|
||||||
crlf();
|
crlf();
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ namespace ui {
|
|||||||
class Console : public Widget {
|
class Console : public Widget {
|
||||||
public:
|
public:
|
||||||
void clear();
|
void clear();
|
||||||
void write(const std::string message);
|
void write(const std::string& message);
|
||||||
void writeln(const std::string message);
|
void writeln(const std::string& message);
|
||||||
|
|
||||||
void paint(Painter& painter) override;
|
void paint(Painter& painter) override;
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
void add_item(const MenuItem item);
|
void add_item(const MenuItem item);
|
||||||
|
|
||||||
template<size_t N>
|
template<size_t N>
|
||||||
void add_items(const std::array<MenuItem, N> items) {
|
void add_items(const std::array<MenuItem, N>& items) {
|
||||||
for(const auto& item : items) {
|
for(const auto& item : items) {
|
||||||
add_item(item);
|
add_item(item);
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ void SetDateTimeView::focus() {
|
|||||||
button_cancel.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_year.set_value(model.year);
|
||||||
field_month.set_value(model.month);
|
field_month.set_value(model.month);
|
||||||
field_day.set_value(model.day);
|
field_day.set_value(model.day);
|
||||||
@ -134,7 +134,7 @@ void SetFrequencyCorrectionView::focus() {
|
|||||||
button_cancel.focus();
|
button_cancel.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetFrequencyCorrectionView::form_init(const SetFrequencyCorrectionModel model) {
|
void SetFrequencyCorrectionView::form_init(const SetFrequencyCorrectionModel& model) {
|
||||||
field_ppm.set_value(model.ppm);
|
field_ppm.set_value(model.ppm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ private:
|
|||||||
"Cancel",
|
"Cancel",
|
||||||
};
|
};
|
||||||
|
|
||||||
void form_init(const SetDateTimeModel model);
|
void form_init(const SetDateTimeModel& model);
|
||||||
SetDateTimeModel form_collect();
|
SetDateTimeModel form_collect();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ private:
|
|||||||
"Cancel",
|
"Cancel",
|
||||||
};
|
};
|
||||||
|
|
||||||
void form_init(const SetFrequencyCorrectionModel model);
|
void form_init(const SetFrequencyCorrectionModel& model);
|
||||||
SetFrequencyCorrectionModel form_collect();
|
SetFrequencyCorrectionModel form_collect();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user