utils: Prefix macros with GCAL_
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/842>
This commit is contained in:
@@ -84,8 +84,8 @@ gcal_date_time_get_start_of_week (GDateTime *date)
|
||||
g_assert (date != NULL);
|
||||
|
||||
first_weekday = gcal_util_get_first_weekday ();
|
||||
weekday = g_date_time_get_day_of_week (date) % N_WEEKDAYS;
|
||||
n_days_after_week_start = (N_WEEKDAYS + weekday - first_weekday) % N_WEEKDAYS;
|
||||
weekday = g_date_time_get_day_of_week (date) % GCAL_N_WEEKDAYS;
|
||||
n_days_after_week_start = (GCAL_N_WEEKDAYS + weekday - first_weekday) % GCAL_N_WEEKDAYS;
|
||||
|
||||
start_of_week = g_date_time_add_days (date, -n_days_after_week_start);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
*/
|
||||
|
||||
static const gint
|
||||
ab_day[N_WEEKDAYS] =
|
||||
ab_day[GCAL_N_WEEKDAYS] =
|
||||
{
|
||||
ABDAY_1,
|
||||
ABDAY_2,
|
||||
@@ -327,7 +327,7 @@ gcal_util_get_first_weekday (void)
|
||||
else
|
||||
g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.\n");
|
||||
|
||||
week_start = (week_1stday + first_weekday - 1) % N_WEEKDAYS;
|
||||
week_start = (week_1stday + first_weekday - 1) % GCAL_N_WEEKDAYS;
|
||||
|
||||
#else
|
||||
|
||||
@@ -343,7 +343,7 @@ gcal_util_get_first_weekday (void)
|
||||
else
|
||||
week_start = -1;
|
||||
|
||||
if (week_start < 0 || week_start > N_WEEKDAYS - 1)
|
||||
if (week_start < 0 || week_start > GCAL_N_WEEKDAYS - 1)
|
||||
{
|
||||
g_warning ("Whoever translated calendar:week_start:0 for GTK+ "
|
||||
"did so wrongly.\n");
|
||||
@@ -500,7 +500,7 @@ gcal_util_get_alarm_trigger_minutes (GcalEvent *event,
|
||||
alarm_dt = g_date_time_add_full (gcal_event_get_date_start (event),
|
||||
0,
|
||||
0,
|
||||
- (i_cal_duration_get_days (duration) + i_cal_duration_get_weeks (duration) * N_WEEKDAYS),
|
||||
- (i_cal_duration_get_days (duration) + i_cal_duration_get_weeks (duration) * GCAL_N_WEEKDAYS),
|
||||
- i_cal_duration_get_hours (duration),
|
||||
- i_cal_duration_get_minutes (duration),
|
||||
- i_cal_duration_get_seconds (duration));
|
||||
@@ -563,7 +563,7 @@ gcal_util_is_workday (guint day)
|
||||
gchar territory[3] = { 0, };
|
||||
guint i;
|
||||
|
||||
if (day > N_WEEKDAYS - 1)
|
||||
if (day > GCAL_N_WEEKDAYS - 1)
|
||||
return FALSE;
|
||||
|
||||
no_work_days = GCAL_WEEK_DAY_SATURDAY | GCAL_WEEK_DAY_SUNDAY;
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
#include <libecal/libecal.h>
|
||||
#include <libgweather/gweather.h>
|
||||
|
||||
#define N_WEEKDAYS 7
|
||||
#define ALIGNED(x) (round (x) + 0.5)
|
||||
#define MINUTES_PER_DAY 1440
|
||||
#define MAX_MINUTES (N_WEEKDAYS * MINUTES_PER_DAY)
|
||||
#define GCAL_N_WEEKDAYS 7
|
||||
#define GCAL_ALIGNED(x) (round (x) + 0.5)
|
||||
#define GCAL_MINUTES_PER_DAY 1440
|
||||
#define GCAL_MAX_MINUTES (GCAL_N_WEEKDAYS * GCAL_MINUTES_PER_DAY)
|
||||
|
||||
#define GCAL_DEFAULT_APPLICATION GCAL_APPLICATION (g_application_get_default ())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user