fix all real warnings
This commit is contained in:
parent
17e850e6d7
commit
04f0ef76ee
@ -5,9 +5,7 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#include <locale>
|
|
||||||
#include <menu.h>
|
#include <menu.h>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "marks.h"
|
#include "marks.h"
|
||||||
|
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#include <format>
|
#include <format>
|
||||||
#include <iostream>
|
|
||||||
#include <locale>
|
|
||||||
#include <menu.h>
|
#include <menu.h>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
#include <panel.h>
|
#include <panel.h>
|
||||||
@ -47,6 +45,7 @@ void marks_page() {
|
|||||||
size_t size_my_panels = resp_from_api["Subjects"].size();
|
size_t size_my_panels = resp_from_api["Subjects"].size();
|
||||||
my_panels = new (std::nothrow) PANEL *[size_my_panels];
|
my_panels = new (std::nothrow) PANEL *[size_my_panels];
|
||||||
|
|
||||||
|
// trows compiler warning for some reason but cannot be removed
|
||||||
PANEL *top;
|
PANEL *top;
|
||||||
int ch;
|
int ch;
|
||||||
|
|
||||||
@ -137,7 +136,7 @@ void init_wins(WINDOW **wins, int n, json marks_json) {
|
|||||||
x = DEFAULT_X_OFFSET;
|
x = DEFAULT_X_OFFSET;
|
||||||
uint8_t curent_color = 0;
|
uint8_t curent_color = 0;
|
||||||
|
|
||||||
int MaxHight = 0;
|
unsigned int MaxHight = 0;
|
||||||
// this loop through subjects
|
// this loop through subjects
|
||||||
for (i = 0; i < n; ++i) {
|
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());
|
wsub_name.c_str(), wsub_avg_s.c_str());
|
||||||
|
|
||||||
size_t max_text_length = wcslen(label);
|
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<unsigned int>(marks_json["Subjects"][i]["Marks"].size()); j++) {
|
||||||
std::string caption =
|
std::string caption =
|
||||||
rm_tr_le_whitespace(marks_json["Subjects"][i]["Marks"][j]["Caption"]);
|
rm_tr_le_whitespace(marks_json["Subjects"][i]["Marks"][j]["Caption"]);
|
||||||
std::string theme =
|
std::string theme =
|
||||||
@ -179,8 +178,7 @@ void init_wins(WINDOW **wins, int n, json marks_json) {
|
|||||||
MaxHight = 0;
|
MaxHight = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (marks_json["Subjects"][i]["Marks"].size() * 2 + DEFAULT_PADDING >
|
if (static_cast<unsigned int>(marks_json["Subjects"][i]["Marks"].size()) * 2 + DEFAULT_PADDING > MaxHight) {
|
||||||
MaxHight) {
|
|
||||||
MaxHight =
|
MaxHight =
|
||||||
marks_json["Subjects"][i]["Marks"].size() * 2 + DEFAULT_PADDING;
|
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 */
|
/* Show the window with a border and a label */
|
||||||
void win_show(WINDOW *win, wchar_t *label, int label_color, int width,
|
void win_show(WINDOW *win, wchar_t *label, int label_color, int width,
|
||||||
int height, json marks_json, int SubjectIndex) {
|
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;
|
int startx, starty;
|
||||||
|
|
||||||
wresize(win, height, width);
|
wresize(win, height, width);
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <ncurses.h>
|
#include <ncurses.h>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
@ -76,10 +75,9 @@ json *find_atom_by_indexes(json &resp_from_api, uint8_t day_index,
|
|||||||
|
|
||||||
void timetable_page() {
|
void timetable_page() {
|
||||||
// DONT FORGET TO UNCOMMENT
|
// DONT FORGET TO UNCOMMENT
|
||||||
// json resp_from_api =
|
json resp_from_api = bakaapi::get_data_from_endpoint("api/3/timetable/actual");
|
||||||
// bakaapi::get_data_from_endpoint("api/3/timetable/actual");
|
/*std::ifstream f("test-data/timetable.json");
|
||||||
std::ifstream f("test-data/timetable.json");
|
json resp_from_api = json::parse(f);*/
|
||||||
json resp_from_api = json::parse(f);
|
|
||||||
|
|
||||||
// this may be unnecessary but i dont have enaugh data to test it
|
// this may be unnecessary but i dont have enaugh data to test it
|
||||||
// it sorts the hours by start time
|
// it sorts the hours by start time
|
||||||
@ -295,6 +293,7 @@ void timetable_page() {
|
|||||||
int ch;
|
int ch;
|
||||||
while ((ch = getch()) != KEY_F(1)) {
|
while ((ch = getch()) != KEY_F(1)) {
|
||||||
if (is_info_box_open) {
|
if (is_info_box_open) {
|
||||||
|
move_panel(infobox_panel, LINES -1, COLS-1);
|
||||||
werase(infobox_window);
|
werase(infobox_window);
|
||||||
wrefresh(infobox_window);
|
wrefresh(infobox_window);
|
||||||
hide_panel(infobox_panel);
|
hide_panel(infobox_panel);
|
||||||
@ -380,7 +379,7 @@ void timetable_page() {
|
|||||||
atom->at("GroupsIds")[i].get<std::string>()) {
|
atom->at("GroupsIds")[i].get<std::string>()) {
|
||||||
groups.append(string_to_wstring(
|
groups.append(string_to_wstring(
|
||||||
resp_from_api["Groups"][j]["Name"].get<std::string>()));
|
resp_from_api["Groups"][j]["Name"].get<std::string>()));
|
||||||
if (i + 1 < atom->at("GroupsIds").size()) {
|
if (static_cast<size_t>(i + 1) < atom->at("GroupsIds").size()) {
|
||||||
groups.append(L", ");
|
groups.append(L", ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -543,4 +542,4 @@ void refresh_cells(uint8_t num_of_columns, uint8_t num_of_days,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user