mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtcm: prevent to use NULL
as a Tick type
Tick (aka time_t) shall be an integer type, not a pointer. Change to use `0` instead of `NULL`.
This commit is contained in:
parent
4316bb797d
commit
16eb6092b0
5 changed files with 14 additions and 14 deletions
|
@ -81,12 +81,12 @@ ClosestTick(
|
||||||
real_start_time,
|
real_start_time,
|
||||||
target_time = _target_time;
|
target_time = _target_time;
|
||||||
|
|
||||||
if (!re) return (Tick)NULL;
|
if (!re) return (Tick)0;
|
||||||
|
|
||||||
FillInRepeatEvent(start_time, re);
|
FillInRepeatEvent(start_time, re);
|
||||||
|
|
||||||
if (!(*res = InitRepeatEventState(re)))
|
if (!(*res = InitRepeatEventState(re)))
|
||||||
return (Tick)NULL;
|
return (Tick)0;
|
||||||
|
|
||||||
if (target_time < start_time)
|
if (target_time < start_time)
|
||||||
target_time = start_time;
|
target_time = start_time;
|
||||||
|
@ -131,7 +131,7 @@ ClosestTick(
|
||||||
(re->re_end_date && re->re_end_date < closest_tick)) {
|
(re->re_end_date && re->re_end_date < closest_tick)) {
|
||||||
free (*res);
|
free (*res);
|
||||||
*res = NULL;
|
*res = NULL;
|
||||||
return (Tick)NULL;
|
return (Tick)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -351,7 +351,7 @@ DoWeek(
|
||||||
/* Make sure the start time is on the first real event slot. */
|
/* Make sure the start time is on the first real event slot. */
|
||||||
if (_target_time) {
|
if (_target_time) {
|
||||||
if (!(unused = InitRepeatEventState(re)))
|
if (!(unused = InitRepeatEventState(re)))
|
||||||
return (Tick)NULL;
|
return (Tick)0;
|
||||||
start_time = DoWeek(0, _start_time, re, unused);
|
start_time = DoWeek(0, _start_time, re, unused);
|
||||||
free(unused);
|
free(unused);
|
||||||
if (_target_time < start_time)
|
if (_target_time < start_time)
|
||||||
|
@ -676,7 +676,7 @@ DoYearByMonth(
|
||||||
/* Make sure the start time is on the first real event slot. */
|
/* Make sure the start time is on the first real event slot. */
|
||||||
if (_target_time) {
|
if (_target_time) {
|
||||||
if (!(unused = InitRepeatEventState(re)))
|
if (!(unused = InitRepeatEventState(re)))
|
||||||
return (Tick)NULL;
|
return (Tick)0;
|
||||||
start_time = DoYearByMonth(0, _start_time, re, unused);
|
start_time = DoYearByMonth(0, _start_time, re, unused);
|
||||||
free(unused);
|
free(unused);
|
||||||
if (_target_time < start_time)
|
if (_target_time < start_time)
|
||||||
|
@ -780,7 +780,7 @@ DoYearByDay(
|
||||||
/* Make sure the start time is on the first real event slot. */
|
/* Make sure the start time is on the first real event slot. */
|
||||||
if (_target_time) {
|
if (_target_time) {
|
||||||
if (!(unused = InitRepeatEventState(re)))
|
if (!(unused = InitRepeatEventState(re)))
|
||||||
return (Tick)NULL;
|
return (Tick)0;
|
||||||
start_time = DoYearByDay(0, _start_time, re, unused);
|
start_time = DoYearByDay(0, _start_time, re, unused);
|
||||||
free(unused);
|
free(unused);
|
||||||
if (_target_time < start_time)
|
if (_target_time < start_time)
|
||||||
|
|
|
@ -63,7 +63,7 @@ LastTick(
|
||||||
{
|
{
|
||||||
Tick last_time;
|
Tick last_time;
|
||||||
|
|
||||||
if (!re) return (Tick)NULL;
|
if (!re) return (Tick)0;
|
||||||
|
|
||||||
if (re->re_duration == RE_INFINITY) return EOT;
|
if (re->re_duration == RE_INFINITY) return EOT;
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ DoMinute(
|
||||||
const Tick start_time,
|
const Tick start_time,
|
||||||
const RepeatEvent *re)
|
const RepeatEvent *re)
|
||||||
{
|
{
|
||||||
return (Tick)NULL;
|
return (Tick)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Tick
|
static Tick
|
||||||
|
@ -404,7 +404,7 @@ DoYearByMonth(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* No months have a day that can be used */
|
/* No months have a day that can be used */
|
||||||
return ((Tick)NULL);
|
return (Tick)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
last_time2 = mktime(start_tm);
|
last_time2 = mktime(start_tm);
|
||||||
|
|
|
@ -79,7 +79,7 @@ NextTick(
|
||||||
{
|
{
|
||||||
Tick next_time;
|
Tick next_time;
|
||||||
|
|
||||||
if (!re) return (Tick)NULL;
|
if (!re) return (Tick)0;
|
||||||
|
|
||||||
FillInRepeatEvent(start_time, re);
|
FillInRepeatEvent(start_time, re);
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ DoMinute(
|
||||||
const RepeatEvent *re,
|
const RepeatEvent *re,
|
||||||
RepeatEventState *res)
|
RepeatEventState *res)
|
||||||
{
|
{
|
||||||
return (Tick)NULL;
|
return (Tick)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Tick
|
static Tick
|
||||||
|
|
|
@ -92,7 +92,7 @@ PrevTick(
|
||||||
Tick next_time;
|
Tick next_time;
|
||||||
Tick _start_time;
|
Tick _start_time;
|
||||||
|
|
||||||
if (!re) return (Tick)NULL;
|
if (!re) return (Tick)0;
|
||||||
|
|
||||||
if (!start_time)
|
if (!start_time)
|
||||||
FillInRepeatEvent(cur_time, re);
|
FillInRepeatEvent(cur_time, re);
|
||||||
|
@ -148,7 +148,7 @@ DoMinute(
|
||||||
const RepeatEvent *re,
|
const RepeatEvent *re,
|
||||||
RepeatEventState *res)
|
RepeatEventState *res)
|
||||||
{
|
{
|
||||||
return (Tick)NULL;
|
return (Tick)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Tick
|
static Tick
|
||||||
|
|
|
@ -230,7 +230,7 @@ WeekNumberToDay(
|
||||||
* month.
|
* month.
|
||||||
*/
|
*/
|
||||||
if (date_tm->tm_mon != initial_month_number)
|
if (date_tm->tm_mon != initial_month_number)
|
||||||
return ((Tick)NULL);
|
return (Tick)0;
|
||||||
|
|
||||||
return (_date);
|
return (_date);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue