From 4c5fbc15834cb077723f43129ea7c0f9d20150d4 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Tue, 19 Jul 2005 13:44:42 +0000 Subject: formatting fixes (bug #4739) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6158 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- io.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/io.c b/io.c index bfb86224f..9fd4e6d8a 100755 --- a/io.c +++ b/io.c @@ -66,7 +66,6 @@ struct io_context { int needshrink; }; - struct io_context *io_context_create(void) { /* Create an I/O context */ @@ -82,14 +81,15 @@ struct io_context *io_context_create(void) free(tmp); tmp = NULL; } else { - memset(tmp->fds, 0, (GROW_SHRINK_SIZE/2) * sizeof(struct pollfd)); - tmp->ior = malloc((GROW_SHRINK_SIZE/2) * sizeof(struct io_rec)); + memset(tmp->fds, 0, (GROW_SHRINK_SIZE / 2) * sizeof(struct pollfd)); + tmp->ior = malloc((GROW_SHRINK_SIZE / 2) * sizeof(struct io_rec)); if (!tmp->ior) { free(tmp->fds); free(tmp); tmp = NULL; - } else - memset(tmp->ior, 0, (GROW_SHRINK_SIZE/2) * sizeof(struct io_rec)); + } else { + memset(tmp->ior, 0, (GROW_SHRINK_SIZE / 2) * sizeof(struct io_rec)); + } } } return tmp; @@ -130,7 +130,6 @@ static int io_grow(struct io_context *ioc) ioc->maxfdcnt -= GROW_SHRINK_SIZE; return -1; } - } else { /* * Out of memory. We return to the old size, and return a failure @@ -190,7 +189,8 @@ int *ast_io_change(struct io_context *ioc, int *id, int fd, ast_io_cb callback, if (data) ioc->ior[*id].data = data; return id; - } else return NULL; + } + return NULL; } static int io_shrink(struct io_context *ioc) @@ -202,7 +202,7 @@ static int io_shrink(struct io_context *ioc) * the entry we are removing, then decrease the size of the * arrays by one. */ - for (getfrom=0;getfromfdcnt;getfrom++) { + for (getfrom = 0; getfrom < ioc->fdcnt; getfrom++) { if (ioc->ior[getfrom].id) { /* In use, save it */ if (getfrom != putto) { @@ -227,7 +227,7 @@ int ast_io_remove(struct io_context *ioc, int *_id) ast_log(LOG_WARNING, "Asked to remove NULL?\n"); return -1; } - for (x=0;xfdcnt;x++) { + for (x = 0; x < ioc->fdcnt; x++) { if (ioc->ior[x].id == _id) { /* Free the int immediately and set to NULL so we know it's unused now */ free(ioc->ior[x].id); @@ -262,7 +262,7 @@ int ast_io_wait(struct io_context *ioc, int howlong) * At least one event */ origcnt = ioc->fdcnt; - for(x=0;xfds[x].revents && ioc->ior[x].id) { @@ -294,7 +294,7 @@ void ast_io_dump(struct io_context *ioc) ast_log(LOG_DEBUG, "================================================\n"); ast_log(LOG_DEBUG, "| ID FD Callback Data Events |\n"); ast_log(LOG_DEBUG, "+------+------+-----------+-----------+--------+\n"); - for (x=0;xfdcnt;x++) { + for (x = 0; x < ioc->fdcnt; x++) { ast_log(LOG_DEBUG, "| %.4d | %.4d | %p | %p | %.6x |\n", *ioc->ior[x].id, ioc->fds[x].fd, -- cgit v1.2.3