From da30df33502a68ef5295344249a13d4accecf83a Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Fri, 12 Jan 2018 21:19:20 -0800 Subject: [PATCH] Remove C99 code. --- kqueue.c | 4 ++-- monitor_kqueue.c | 14 +++++++------- select.c | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/kqueue.c b/kqueue.c index 354eb86..67b2c86 100644 --- a/kqueue.c +++ b/kqueue.c @@ -181,7 +181,7 @@ static int kqueue_process(u_long timer) { struct event *ev; - int events, n; + int events, n, i; struct timespec ts, *tp; n = (int) nchanges; @@ -214,7 +214,7 @@ kqueue_process(u_long timer) DPRINTF(E_FATAL, L_GENERAL, "kevent() returned no events. EXITING\n"); } - for (int i = 0; i < events; i++) { + for (i = 0; i < events; i++) { if (event_list[i].flags & EV_ERROR) { DPRINTF(E_ERROR, L_GENERAL, "kevent() error %d on %d filter:%d flags:0x%x\n", diff --git a/monitor_kqueue.c b/monitor_kqueue.c index ceb7f84..34026d5 100644 --- a/monitor_kqueue.c +++ b/monitor_kqueue.c @@ -56,7 +56,7 @@ dir_vnode_process(struct event *ev, u_int fflags) struct watch *wt; const char *path; char *sql, **result, tmp_path[PATH_MAX], *esc_name; - int rows, result_path_len; + int rows, result_path_len, i; DIR* d; struct dirent *entry; bool found_flag; @@ -86,7 +86,7 @@ dir_vnode_process(struct event *ev, u_int fflags) goto err1; } - for (int i = 1; i <= rows; i++) { + for (i = 1; i <= rows; i++) { DPRINTF(E_DEBUG, L_INOTIFY, "Indexed content: %s\n", result[i]); if (access(result[i], R_OK) == -1) @@ -116,7 +116,7 @@ dir_vnode_process(struct event *ev, u_int fflags) DPRINTF(E_DEBUG, L_INOTIFY, "Walking %s\n", tmp_path); found_flag = false; - for (int i = 1; i <= rows; i++) { + for (i = 1; i <= rows; i++) { if (strcmp(result[i], tmp_path) == 0) { found_flag = true; break; @@ -147,7 +147,7 @@ dir_vnode_process(struct event *ev, u_int fflags) goto err1; } - for (int i = 1; i <= rows; i++) { + for (i = 1; i <= rows; i++) { DPRINTF(E_DEBUG, L_INOTIFY, "Indexed content: %s\n", result[i]); if (access(result[i], R_OK) == -1) @@ -175,7 +175,7 @@ dir_vnode_process(struct event *ev, u_int fflags) } DPRINTF(E_DEBUG, L_INOTIFY, "Walking %s\n", tmp_path); found_flag = false; - for (int i = 1; i <= rows; i++) + for (i = 1; i <= rows; i++) if (strcmp(result[i], tmp_path) == 0) { found_flag = true; break; @@ -262,14 +262,14 @@ kqueue_monitor_start() { struct media_dir_s *media_path; char **result; - int rows; + int rows, i; DPRINTF(E_DEBUG, L_INOTIFY, "kqueue monitoring starting\n"); for (media_path = media_dirs; media_path != NULL; media_path = media_path->next) add_watch(0, media_path->path); sql_get_table(db, "SELECT PATH from DETAILS where MIME is NULL and PATH is not NULL", &result, &rows, NULL); - for (int i = 1; i <= rows; i++ ) + for (i = 1; i <= rows; i++ ) add_watch(0, result[i]); sqlite3_free_table(result); } diff --git a/select.c b/select.c index 16f7727..dce7311 100644 --- a/select.c +++ b/select.c @@ -146,11 +146,11 @@ select_process(u_long msec) { struct timeval tv, *tp; struct event *ev; - int ready; + int ready, i; /* Need to rescan for max_fd. */ if (max_fd == -1) - for (int i = 0; i < nevents; i++) { + for (i = 0; i < nevents; i++) { if (max_fd < events[i]->fd) max_fd = events[i]->fd; } @@ -173,7 +173,7 @@ select_process(u_long msec) if (ready == 0) return (0); - for (int i = 0; i < nevents; i++) { + for (i = 0; i < nevents; i++) { ev = events[i]; switch (ev->rdwr) {