diff --git a/src/main_menu.cpp b/src/main_menu.cpp index cfb3712..08c82cd 100644 --- a/src/main_menu.cpp +++ b/src/main_menu.cpp @@ -5,9 +5,7 @@ #include #include #include -#include #include -#include #include "marks.h" diff --git a/src/marks.cpp b/src/marks.cpp index bdad0db..e8167b7 100644 --- a/src/marks.cpp +++ b/src/marks.cpp @@ -8,8 +8,6 @@ #include #include #include -#include -#include #include #include #include @@ -47,6 +45,7 @@ void marks_page() { size_t size_my_panels = resp_from_api["Subjects"].size(); my_panels = new (std::nothrow) PANEL *[size_my_panels]; + // trows compiler warning for some reason but cannot be removed PANEL *top; int ch; @@ -137,7 +136,7 @@ void init_wins(WINDOW **wins, int n, json marks_json) { x = DEFAULT_X_OFFSET; uint8_t curent_color = 0; - int MaxHight = 0; + unsigned int MaxHight = 0; // this loop through subjects for (i = 0; i < n; ++i) { @@ -154,7 +153,7 @@ void init_wins(WINDOW **wins, int n, json marks_json) { wsub_name.c_str(), wsub_avg_s.c_str()); size_t max_text_length = wcslen(label); - for (int j = 0; j < marks_json["Subjects"][i]["Marks"].size(); j++) { + for (unsigned int j = 0; j < static_cast(marks_json["Subjects"][i]["Marks"].size()); j++) { std::string caption = rm_tr_le_whitespace(marks_json["Subjects"][i]["Marks"][j]["Caption"]); std::string theme = @@ -179,8 +178,7 @@ void init_wins(WINDOW **wins, int n, json marks_json) { MaxHight = 0; } - if (marks_json["Subjects"][i]["Marks"].size() * 2 + DEFAULT_PADDING > - MaxHight) { + if (static_cast(marks_json["Subjects"][i]["Marks"].size()) * 2 + DEFAULT_PADDING > MaxHight) { MaxHight = marks_json["Subjects"][i]["Marks"].size() * 2 + DEFAULT_PADDING; } @@ -198,6 +196,8 @@ void init_wins(WINDOW **wins, int n, json marks_json) { /* Show the window with a border and a label */ void win_show(WINDOW *win, wchar_t *label, int label_color, int width, int height, json marks_json, int SubjectIndex) { + + // is the compiler smoking weed or something, why is it thinking starty is not used ?? int startx, starty; wresize(win, height, width); diff --git a/src/timetable.cpp b/src/timetable.cpp index dcdc9f3..7381e1b 100644 --- a/src/timetable.cpp +++ b/src/timetable.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -76,10 +75,9 @@ json *find_atom_by_indexes(json &resp_from_api, uint8_t day_index, void timetable_page() { // DONT FORGET TO UNCOMMENT - // json resp_from_api = - // bakaapi::get_data_from_endpoint("api/3/timetable/actual"); - std::ifstream f("test-data/timetable.json"); - json resp_from_api = json::parse(f); + json resp_from_api = bakaapi::get_data_from_endpoint("api/3/timetable/actual"); + /*std::ifstream f("test-data/timetable.json"); + json resp_from_api = json::parse(f);*/ // this may be unnecessary but i dont have enaugh data to test it // it sorts the hours by start time @@ -295,6 +293,7 @@ void timetable_page() { int ch; while ((ch = getch()) != KEY_F(1)) { if (is_info_box_open) { + move_panel(infobox_panel, LINES -1, COLS-1); werase(infobox_window); wrefresh(infobox_window); hide_panel(infobox_panel); @@ -380,7 +379,7 @@ void timetable_page() { atom->at("GroupsIds")[i].get()) { groups.append(string_to_wstring( resp_from_api["Groups"][j]["Name"].get())); - if (i + 1 < atom->at("GroupsIds").size()) { + if (static_cast(i + 1) < atom->at("GroupsIds").size()) { groups.append(L", "); } } @@ -543,4 +542,4 @@ void refresh_cells(uint8_t num_of_columns, uint8_t num_of_days, } } } -} \ No newline at end of file +}