workaround clang LSP warnings & errors

This commit is contained in:
SowinskiBraeden committed 2024-10-10 23:00:52 -07:00
1 parent 75baef6e10
commit d1311b27e8
2 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@
int createDirectory(const char *dir_name) { int createDirectory(const char *dir_name) {
// check if directory already exists // check if directory already exists
struct stat statbuf; struct stat statbuf;
if (stat(dir_name, &statbuf) == 0 && S_ISDIR(statbuf.st_mode)) if (stat(dir_name, &statbuf) == 0 && (statbuf.st_mode & S_IFMT) == S_IFDIR)
return 0; // Directory exists return 0; // Directory exists
if (MKDIR(dir_name) == 0) { if (MKDIR(dir_name) == 0) {
+3 -3
View File
@@ -49,8 +49,8 @@ uint8_t *equal(uint8_t *arr, size_t size) {
TIMETABLE generateTimetable(STUDENT *students, size_t size_students, COURSE *courses, size_t size_courses) { TIMETABLE generateTimetable(STUDENT *students, size_t size_students, COURSE *courses, size_t size_courses) {
TIMETABLE timetable = {{{{0}}}, false}; TIMETABLE timetable = {{{{0}}}, false};
uint8_t MEDIAN = floor((MIN_REQ + CLASS_CAP) / 2); uint8_t MEDIAN = floor((float) (MIN_REQ + CLASS_CAP) / 2);
uint8_t BLOCKS_PER_SEMESTER = TOTAL_BLOCKS / 2; // uint8_t BLOCKS_PER_SEMESTER = TOTAL_BLOCKS / 2;
// Step 1 - Tally requests to check which courses are eligable to run // Step 1 - Tally requests to check which courses are eligable to run
@@ -103,7 +103,7 @@ TIMETABLE generateTimetable(STUDENT *students, size_t size_students, COURSE *cou
size_t currentIndex = 0; size_t currentIndex = 0;
for (size_t i = 0; i < activeCourseIndex; i++) { for (size_t i = 0; i < activeCourseIndex; i++) {
uint16_t index = activeCoursesIndexes[i]; uint16_t index = activeCoursesIndexes[i];
uint8_t classRunCount = floor(courses[index].requests / MEDIAN); uint8_t classRunCount = floor((float) courses[index].requests / MEDIAN);
uint8_t remaining = courses[index].requests % MEDIAN; uint8_t remaining = courses[index].requests % MEDIAN;
size_t *courseClassIndexes = malloc((classRunCount + 1) * sizeof(size_t)); // add 1 to classRunCount in case we need to create an extra class with remaining size_t *courseClassIndexes = malloc((classRunCount + 1) * sizeof(size_t)); // add 1 to classRunCount in case we need to create an extra class with remaining