Remove C99 code.

This commit is contained in:
Gleb Smirnoff 2018-01-12 21:19:20 -08:00 committed by Justin Maggard
parent 7428b8dede
commit da30df3350
3 changed files with 12 additions and 12 deletions

View File

@ -181,7 +181,7 @@ static int
kqueue_process(u_long timer) kqueue_process(u_long timer)
{ {
struct event *ev; struct event *ev;
int events, n; int events, n, i;
struct timespec ts, *tp; struct timespec ts, *tp;
n = (int) nchanges; n = (int) nchanges;
@ -214,7 +214,7 @@ kqueue_process(u_long timer)
DPRINTF(E_FATAL, L_GENERAL, "kevent() returned no events. EXITING\n"); 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) { if (event_list[i].flags & EV_ERROR) {
DPRINTF(E_ERROR, L_GENERAL, DPRINTF(E_ERROR, L_GENERAL,
"kevent() error %d on %d filter:%d flags:0x%x\n", "kevent() error %d on %d filter:%d flags:0x%x\n",

View File

@ -56,7 +56,7 @@ dir_vnode_process(struct event *ev, u_int fflags)
struct watch *wt; struct watch *wt;
const char *path; const char *path;
char *sql, **result, tmp_path[PATH_MAX], *esc_name; char *sql, **result, tmp_path[PATH_MAX], *esc_name;
int rows, result_path_len; int rows, result_path_len, i;
DIR* d; DIR* d;
struct dirent *entry; struct dirent *entry;
bool found_flag; bool found_flag;
@ -86,7 +86,7 @@ dir_vnode_process(struct event *ev, u_int fflags)
goto err1; goto err1;
} }
for (int i = 1; i <= rows; i++) { for (i = 1; i <= rows; i++) {
DPRINTF(E_DEBUG, L_INOTIFY, DPRINTF(E_DEBUG, L_INOTIFY,
"Indexed content: %s\n", result[i]); "Indexed content: %s\n", result[i]);
if (access(result[i], R_OK) == -1) 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); DPRINTF(E_DEBUG, L_INOTIFY, "Walking %s\n", tmp_path);
found_flag = false; found_flag = false;
for (int i = 1; i <= rows; i++) { for (i = 1; i <= rows; i++) {
if (strcmp(result[i], tmp_path) == 0) { if (strcmp(result[i], tmp_path) == 0) {
found_flag = true; found_flag = true;
break; break;
@ -147,7 +147,7 @@ dir_vnode_process(struct event *ev, u_int fflags)
goto err1; goto err1;
} }
for (int i = 1; i <= rows; i++) { for (i = 1; i <= rows; i++) {
DPRINTF(E_DEBUG, L_INOTIFY, DPRINTF(E_DEBUG, L_INOTIFY,
"Indexed content: %s\n", result[i]); "Indexed content: %s\n", result[i]);
if (access(result[i], R_OK) == -1) 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); DPRINTF(E_DEBUG, L_INOTIFY, "Walking %s\n", tmp_path);
found_flag = false; found_flag = false;
for (int i = 1; i <= rows; i++) for (i = 1; i <= rows; i++)
if (strcmp(result[i], tmp_path) == 0) { if (strcmp(result[i], tmp_path) == 0) {
found_flag = true; found_flag = true;
break; break;
@ -262,14 +262,14 @@ kqueue_monitor_start()
{ {
struct media_dir_s *media_path; struct media_dir_s *media_path;
char **result; char **result;
int rows; int rows, i;
DPRINTF(E_DEBUG, L_INOTIFY, "kqueue monitoring starting\n"); DPRINTF(E_DEBUG, L_INOTIFY, "kqueue monitoring starting\n");
for (media_path = media_dirs; media_path != NULL; for (media_path = media_dirs; media_path != NULL;
media_path = media_path->next) media_path = media_path->next)
add_watch(0, media_path->path); 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); 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]); add_watch(0, result[i]);
sqlite3_free_table(result); sqlite3_free_table(result);
} }

View File

@ -146,11 +146,11 @@ select_process(u_long msec)
{ {
struct timeval tv, *tp; struct timeval tv, *tp;
struct event *ev; struct event *ev;
int ready; int ready, i;
/* Need to rescan for max_fd. */ /* Need to rescan for max_fd. */
if (max_fd == -1) if (max_fd == -1)
for (int i = 0; i < nevents; i++) { for (i = 0; i < nevents; i++) {
if (max_fd < events[i]->fd) if (max_fd < events[i]->fd)
max_fd = events[i]->fd; max_fd = events[i]->fd;
} }
@ -173,7 +173,7 @@ select_process(u_long msec)
if (ready == 0) if (ready == 0)
return (0); return (0);
for (int i = 0; i < nevents; i++) { for (i = 0; i < nevents; i++) {
ev = events[i]; ev = events[i];
switch (ev->rdwr) { switch (ev->rdwr) {