This commit is contained in:
Kovid Goyal 2019-01-31 20:57:21 +05:30
parent 41906cf7db
commit 3aaa69b36c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 3 additions and 3 deletions

View File

@ -1065,7 +1065,7 @@ mark_monitored_pids(pid_t pid, int status) {
reaped_pids[reaped_pids_count].status = status;
reaped_pids[reaped_pids_count++].pid = pid;
}
remove_from_array(monitored_pids, (size_t)i, monitored_pids_count);
remove_i_from_array(monitored_pids, (size_t)i, monitored_pids_count);
}
}
children_mutex(unlock);

View File

@ -257,7 +257,7 @@ typedef struct {FONTS_DATA_HEAD} *FONTS_DATA_HANDLE;
(base)->capacity = _newcap; \
}
#define remove_from_array(array, i, count) { \
#define remove_i_from_array(array, i, count) { \
count--; \
if (i < count) { \
memmove(array + i, array + i + 1, sizeof(array[0]) * (count - 1)); \

View File

@ -45,7 +45,7 @@ remove_timer(EventLoopData *eld, id_type timer_id) {
for (nfds_t i = 0; i < eld->timers_count; i++) {
if (eld->timers[i].id == timer_id) {
if (eld->timers[i].cleanup) eld->timers[i].cleanup(timer_id, eld->timers[i].callback_data);
remove_from_array(eld->timers, i, eld->timers_count);
remove_i_from_array(eld->timers, i, eld->timers_count);
update_timers(eld);
break;
}