fix: should now compile with gcc
ci/woodpecker/pr/lint Pipeline was successful Details
ci/woodpecker/pr/docs Pipeline was successful Details
ci/woodpecker/pr/build Pipeline was successful Details
ci/woodpecker/pr/docker Pipeline was successful Details
ci/woodpecker/pr/man Pipeline was successful Details
ci/woodpecker/pr/test Pipeline was successful Details

Jef Roosens 2023-01-14 21:19:29 +01:00
parent 433184877c
commit 58b58806f3
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,9 @@
# =====CONFIG===== # =====CONFIG=====
SRC_DIR := src SRC_DIR := src
SOURCES != find '$(SRC_DIR)' -\( -iname '*.v' -or -iname '*.h' -or -iname '*.c' -\) SRCS_C != find '$(SRC_DIR)' -iname '*.c'
SRCS_H != find '$(SRC_DIR)' -iname '*.h'
SRCS_V != find '$(SRC_DIR)' -iname '*.v'
SOURCES := $(SRCS_C) $(SRCS_H) $(SRCS_V)
V_PATH ?= v V_PATH ?= v
V := $(V_PATH) -showcc -gc boehm -W -d use_openssl -skip-unused V := $(V_PATH) -showcc -gc boehm -W -d use_openssl -skip-unused

View File

@ -1,6 +1,7 @@
#include "expression.h" #include "expression.h"
const uint8_t month_days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; // This prefix is needed to properly compile
const uint8_t parse_month_days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
// Allowed value ranges for the minute, hour, day and month field // Allowed value ranges for the minute, hour, day and month field
const uint8_t min[4] = {0, 0, 1, 1}; const uint8_t min[4] = {0, 0, 1, 1};
@ -245,7 +246,7 @@ enum cron_parse_error ce_parse_expression(cron_expression *out, char *s) {
uint8_t max_day_value = 0; uint8_t max_day_value = 0;
for (uint8_t i = 0; i < out->month_count; i++) { for (uint8_t i = 0; i < out->month_count; i++) {
max_day_value = MAX(max_day_value, month_days[out->months[i] - 1]); max_day_value = MAX(max_day_value, parse_month_days[out->months[i] - 1]);
} }
// Days // Days