[asterisk-commits] mvanbaak: trunk r212343 - /trunk/res/res_calendar.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Aug 15 06:36:23 CDT 2009
Author: mvanbaak
Date: Sat Aug 15 06:36:19 2009
New Revision: 212343
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=212343
Log:
cast time_t type variables to long where needed.
This makes res_calendar.c compile on OpenBSD and the same
cast is used in a lot of other places where time_t type vars are used.
(closes issue #15656)
Reported by: mvanbaak
Patches:
2009081100-rescalendarcompilefix.diff.txt uploaded by mvanbaak (license 7)
Modified:
trunk/res/res_calendar.c
Modified: trunk/res/res_calendar.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/res/res_calendar.c?view=diff&rev=212343&r1=212342&r2=212343
==============================================================================
--- trunk/res/res_calendar.c (original)
+++ trunk/res/res_calendar.c Sat Aug 15 06:36:19 2009
@@ -637,8 +637,8 @@
}
snprintf(busystate, sizeof(busystate), "%d", event->busy_state);
- snprintf(start, sizeof(start), "%lu", event->start);
- snprintf(end, sizeof(end), "%lu", event->end);
+ snprintf(start, sizeof(start), "%lu", (long) event->start);
+ snprintf(end, sizeof(end), "%lu", (long) event->end);
chan->nativeformats = AST_FORMAT_SLINEAR;
@@ -762,7 +762,7 @@
ast_mutex_lock(&refreshlock);
AST_SCHED_REPLACE(old_event->notify_sched, sched, alarm_notify_sched, calendar_event_notify, old_event);
ast_mutex_unlock(&refreshlock);
- ast_debug(3, "Calendar alarm event notification scheduled to happen in %ld ms\n", alarm_notify_sched);
+ ast_debug(3, "Calendar alarm event notification scheduled to happen in %ld ms\n", (long) alarm_notify_sched);
}
}
@@ -777,7 +777,7 @@
ast_mutex_lock(&refreshlock);
AST_SCHED_REPLACE(old_event->bs_start_sched, sched, devstate_sched_start, calendar_devstate_change, old_event);
ast_mutex_unlock(&refreshlock);
- ast_debug(3, "Calendar bs_start event notification scheduled to happen in %ld ms\n", devstate_sched_start);
+ ast_debug(3, "Calendar bs_start event notification scheduled to happen in %ld ms\n", (long) devstate_sched_start);
}
if (!cmp_event || old_event->end != event->end) {
@@ -786,7 +786,7 @@
ast_mutex_lock(&refreshlock);
AST_SCHED_REPLACE(old_event->bs_end_sched, sched, devstate_sched_end, calendar_devstate_change, old_event);
ast_mutex_unlock(&refreshlock);
- ast_debug(3, "Calendar bs_end event notification scheduled to happen in %ld ms\n", devstate_sched_end);
+ ast_debug(3, "Calendar bs_end event notification scheduled to happen in %ld ms\n", (long) devstate_sched_end);
}
if (changed) {
@@ -1040,7 +1040,7 @@
i = ao2_iterator_init(cal->events, 0);
while ((event = ao2_iterator_next(&i))) {
if (!(start > event->end || end < event->start)) {
- ast_debug(10, "%s (%ld - %ld) overlapped with (%ld - %ld)\n", event->summary, event->start, event->end, start, end);
+ ast_debug(10, "%s (%ld - %ld) overlapped with (%ld - %ld)\n", event->summary, (long) event->start, (long) event->end, (long) start, (long) end);
if (add_event_to_list(events, event, start, end) < 0) {
event = ast_calendar_unref_event(event);
return -1;
@@ -1152,9 +1152,9 @@
} else if (!strcasecmp(args.field, "uid")) {
ast_copy_string(buf, entry->event->uid, len);
} else if (!strcasecmp(args.field, "start")) {
- snprintf(buf, len, "%ld", entry->event->start);
+ snprintf(buf, len, "%ld", (long) entry->event->start);
} else if (!strcasecmp(args.field, "end")) {
- snprintf(buf, len, "%ld", entry->event->end);
+ snprintf(buf, len, "%ld", (long) entry->event->end);
} else if (!strcasecmp(args.field, "busystate")) {
snprintf(buf, len, "%d", entry->event->busy_state);
} else if (!strcasecmp(args.field, "attendees")) {
More information about the asterisk-commits
mailing list