diff options
author | Ivan Zhakov <ivan@apache.org> | 2022-11-20 07:14:38 +0000 |
---|---|---|
committer | Ivan Zhakov <ivan@apache.org> | 2022-11-20 07:14:38 +0000 |
commit | 4f9b76b6f2acc4030ce9ef164322514c5d0e761b (patch) | |
tree | 9b993b3753affcbf164056826f9d568d8760b3a1 /util-misc | |
parent | 961caf5f46055483fa72ab02f5e8baa16c209e2f (diff) | |
download | apr-4f9b76b6f2acc4030ce9ef164322514c5d0e761b.tar.gz |
Remove trailing whitespaces in *.c.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'util-misc')
-rw-r--r-- | util-misc/apr_date.c | 58 | ||||
-rw-r--r-- | util-misc/apr_queue.c | 18 | ||||
-rw-r--r-- | util-misc/apr_reslist.c | 2 | ||||
-rw-r--r-- | util-misc/apr_rmm.c | 22 | ||||
-rw-r--r-- | util-misc/apr_thread_pool.c | 12 |
5 files changed, 56 insertions, 56 deletions
diff --git a/util-misc/apr_date.c b/util-misc/apr_date.c index e28e967fb..92933b7f2 100644 --- a/util-misc/apr_date.c +++ b/util-misc/apr_date.c @@ -17,12 +17,12 @@ /* * apr_date.c: date parsing utility routines * These routines are (hopefully) platform independent. - * + * * 27 Oct 1996 Roy Fielding * Extracted (with many modifications) from mod_proxy.c and * tested with over 50,000 randomly chosen valid date strings * and several hundred variations of invalid date strings. - * + * */ #include "apr.h" @@ -49,7 +49,7 @@ * & - hex digit * # - digit * ~ - digit or space - * * - swallow remaining characters + * * - swallow remaining characters * <x> - exact match for any other character */ APR_DECLARE(int) apr_date_checkmask(const char *data, const char *mask) @@ -102,11 +102,11 @@ APR_DECLARE(int) apr_date_checkmask(const char *data, const char *mask) * Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 * Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format * - * and returns the apr_time_t number of microseconds since 1 Jan 1970 GMT, + * and returns the apr_time_t number of microseconds since 1 Jan 1970 GMT, * or APR_DATE_BAD if this would be out of range or if the date is invalid. * * The restricted HTTP syntax is - * + * * HTTP-date = rfc1123-date | rfc850-date | asctime-date * * rfc1123-date = wkday "," SP date1 SP time SP "GMT" @@ -163,7 +163,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_http(const char *date) while (*date && apr_isspace(*date)) /* Find first non-whitespace char */ ++date; - if (*date == '\0') + if (*date == '\0') return APR_DATE_BAD; if ((date = strchr(date, ' ')) == NULL) /* Find space after weekday */ @@ -186,7 +186,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_http(const char *date) monstr = date + 3; timstr = date + 12; } - else if (apr_date_checkmask(date, "##-@$$-## ##:##:## *")) { + else if (apr_date_checkmask(date, "##-@$$-## ##:##:## *")) { /* RFC 850 format */ ds.tm_year = ((date[7] - '0') * 10) + (date[8] - '0'); if (ds.tm_year < 70) @@ -200,7 +200,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_http(const char *date) else if (apr_date_checkmask(date, "@$$ ~# ##:##:## ####*")) { /* asctime format */ ds.tm_year = ((date[16] - '0') * 10 + (date[17] - '0') - 19) * 100; - if (ds.tm_year < 0) + if (ds.tm_year < 0) return APR_DATE_BAD; ds.tm_year += ((date[18] - '0') * 10) + (date[19] - '0'); @@ -238,7 +238,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_http(const char *date) ds.tm_min = ((timstr[3] - '0') * 10) + (timstr[4] - '0'); ds.tm_sec = ((timstr[6] - '0') * 10) + (timstr[7] - '0'); - if ((ds.tm_hour > 23) || (ds.tm_min > 59) || (ds.tm_sec > 61)) + if ((ds.tm_hour > 23) || (ds.tm_min > 59) || (ds.tm_sec > 61)) return APR_DATE_BAD; mint = (monstr[0] << 16) | (monstr[1] << 8) | monstr[2]; @@ -254,7 +254,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_http(const char *date) /* February gets special check for leapyear */ if ((mon == 1) && - ((ds.tm_mday > 29) || + ((ds.tm_mday > 29) || ((ds.tm_mday == 29) && ((ds.tm_year & 3) || (((ds.tm_year % 100) == 0) @@ -263,26 +263,26 @@ APR_DECLARE(apr_time_t) apr_date_parse_http(const char *date) ds.tm_mon = mon; - /* ap_mplode_time uses tm_usec and tm_gmtoff fields, but they haven't - * been set yet. + /* ap_mplode_time uses tm_usec and tm_gmtoff fields, but they haven't + * been set yet. * It should be safe to just zero out these values. * tm_usec is the number of microseconds into the second. HTTP only * cares about second granularity. * tm_gmtoff is the number of seconds off of GMT the time is. By * definition all times going through this function are in GMT, so this - * is zero. + * is zero. */ ds.tm_usec = 0; ds.tm_gmtoff = 0; - if (apr_time_exp_get(&result, &ds) != APR_SUCCESS) + if (apr_time_exp_get(&result, &ds) != APR_SUCCESS) return APR_DATE_BAD; - + return result; } /* * Parses a string resembling an RFC 822 date. This is meant to be - * leinent in its parsing of dates. Hence, this will parse a wider + * leinent in its parsing of dates. Hence, this will parse a wider * range of dates than apr_date_parse_http. * * The prominent mailer (or poster, if mailer is unknown) that has @@ -294,10 +294,10 @@ APR_DECLARE(apr_time_t) apr_date_parse_http(const char *date) * Sun, 6 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 * Sun, 06 Nov 94 08:49:37 GMT ; RFC 822 * Sun, 6 Nov 94 08:49:37 GMT ; RFC 822 - * Sun, 06 Nov 94 08:49 GMT ; Unknown [drtr@ast.cam.ac.uk] + * Sun, 06 Nov 94 08:49 GMT ; Unknown [drtr@ast.cam.ac.uk] * Sun, 6 Nov 94 08:49 GMT ; Unknown [drtr@ast.cam.ac.uk] * Sun, 06 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85] - * Sun, 6 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85] + * Sun, 6 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85] * Mon, 7 Jan 2002 07:21:22 GMT ; Unknown [Postfix] * Sun, 06-Nov-1994 08:49:37 GMT ; RFC 850 with four digit years * @@ -340,7 +340,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date) while (*date && apr_isspace(*date)) /* Find first non-whitespace char */ ++date; - if (*date == '\0') + if (*date == '\0') return APR_DATE_BAD; if ((date = strchr(date, ' ')) == NULL) /* Find space after weekday */ @@ -382,7 +382,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date) else if (apr_date_checkmask(date, "@$$ ~# ##:##:## ####*")) { /* asctime format */ ds.tm_year = ((date[16] - '0') * 10 + (date[17] - '0') - 19) * 100; - if (ds.tm_year < 0) + if (ds.tm_year < 0) return APR_DATE_BAD; ds.tm_year += ((date[18] - '0') * 10) + (date[19] - '0'); @@ -433,7 +433,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date) gmtstr = date + 19; TIMEPARSE_STD(ds, timstr); - } + } else if (apr_date_checkmask(date, " # @$$ ## ##:##:## *")) { /* This is the old RFC 1123 date format - many many years ago, people * used two-digit years. Oh, how foolish. @@ -451,7 +451,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date) gmtstr = date + 19; TIMEPARSE_STD(ds, timstr); - } + } else if (apr_date_checkmask(date, "# @$$ ## ##:##:## *")) { /* This is the old RFC 1123 date format - many many years ago, people * used two-digit years. Oh, how foolish. @@ -469,7 +469,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date) gmtstr = date + 18; TIMEPARSE_STD(ds, timstr); - } + } else if (apr_date_checkmask(date, "## @$$ ## ##:## *")) { /* Loser format. This is quite bogus. */ ds.tm_year = ((date[7] - '0') * 10) + (date[8] - '0'); @@ -484,7 +484,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date) gmtstr = NULL; TIMEPARSE(ds, timstr[0],timstr[1], timstr[3],timstr[4], '0','0'); - } + } else if (apr_date_checkmask(date, "# @$$ ## ##:## *")) { /* Loser format. This is quite bogus. */ ds.tm_year = ((date[6] - '0') * 10) + (date[7] - '0'); @@ -530,7 +530,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date) TIMEPARSE(ds, '0',timstr[1], timstr[3],timstr[4], timstr[6],timstr[7]); } - else if (apr_date_checkmask(date, " # @$$ #### ##:##:## *")) { + else if (apr_date_checkmask(date, " # @$$ #### ##:##:## *")) { /* RFC 1123 format with a space instead of a leading zero. */ ds.tm_year = ((date[7] - '0') * 10 + (date[8] - '0') - 19) * 100; @@ -571,7 +571,7 @@ APR_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date) if (ds.tm_mday <= 0 || ds.tm_mday > 31) return APR_DATE_BAD; - if ((ds.tm_hour > 23) || (ds.tm_min > 59) || (ds.tm_sec > 61)) + if ((ds.tm_hour > 23) || (ds.tm_min > 59) || (ds.tm_sec > 61)) return APR_DATE_BAD; mint = (monstr[0] << 16) | (monstr[1] << 8) | monstr[2]; @@ -623,15 +623,15 @@ APR_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date) } } - /* apr_time_exp_get uses tm_usec field, but it hasn't been set yet. + /* apr_time_exp_get uses tm_usec field, but it hasn't been set yet. * It should be safe to just zero out this value. * tm_usec is the number of microseconds into the second. HTTP only * cares about second granularity. */ ds.tm_usec = 0; - if (apr_time_exp_gmt_get(&result, &ds) != APR_SUCCESS) + if (apr_time_exp_gmt_get(&result, &ds) != APR_SUCCESS) return APR_DATE_BAD; - + return result; } diff --git a/util-misc/apr_queue.c b/util-misc/apr_queue.c index dbc879b35..3eaec06b2 100644 --- a/util-misc/apr_queue.c +++ b/util-misc/apr_queue.c @@ -34,7 +34,7 @@ #include "apr_queue.h" #if APR_HAS_THREADS -/* +/* * define this to get debug messages * #define QUEUE_DEBUG @@ -56,14 +56,14 @@ struct apr_queue_t { #ifdef QUEUE_DEBUG static void Q_DBG(char*msg, apr_queue_t *q) { - fprintf(stderr, "%ld\t#%d in %d out %d\t%s\n", + fprintf(stderr, "%ld\t#%d in %d out %d\t%s\n", apr_os_thread_current(), q->nelts, q->in, q->out, msg ); } #else -#define Q_DBG(x,y) +#define Q_DBG(x,y) #endif /** @@ -82,7 +82,7 @@ static void Q_DBG(char*msg, apr_queue_t *q) { * Callback routine that is called to destroy this * apr_queue_t when its pool is destroyed. */ -static apr_status_t queue_destroy(void *data) +static apr_status_t queue_destroy(void *data) { apr_queue_t *queue = data; @@ -98,8 +98,8 @@ static apr_status_t queue_destroy(void *data) /** * Initialize the apr_queue_t. */ -APR_DECLARE(apr_status_t) apr_queue_create(apr_queue_t **q, - unsigned int queue_capacity, +APR_DECLARE(apr_status_t) apr_queue_create(apr_queue_t **q, + unsigned int queue_capacity, apr_pool_t *a) { apr_status_t rv; @@ -302,7 +302,7 @@ static apr_status_t queue_pop(apr_queue_t *queue, void **data, return APR_EINTR; } } - } + } *data = queue->data[queue->out]; queue->nelts--; @@ -342,7 +342,7 @@ APR_DECLARE(apr_status_t) apr_queue_timedpop(apr_queue_t *queue, void **data, APR_DECLARE(apr_status_t) apr_queue_interrupt_all(apr_queue_t *queue) { apr_status_t rv; - Q_DBG("intr all", queue); + Q_DBG("intr all", queue); if ((rv = apr_thread_mutex_lock(queue->one_big_mutex)) != APR_SUCCESS) { return rv; } @@ -365,7 +365,7 @@ APR_DECLARE(apr_status_t) apr_queue_term(apr_queue_t *queue) } /* we must hold one_big_mutex when setting this... otherwise, - * we could end up setting it and waking everybody up just after a + * we could end up setting it and waking everybody up just after a * would-be popper checks it but right before they block */ queue->terminated = 1; diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index 7e87be828..81f846edf 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -392,7 +392,7 @@ static apr_status_t reslist_acquire(apr_reslist_t *reslist, while (reslist->ntotal >= reslist->hmax && reslist->nidle <= 0) { #if APR_HAS_THREADS if (reslist->timeout) { - if ((rv = apr_thread_cond_timedwait(reslist->avail, + if ((rv = apr_thread_cond_timedwait(reslist->avail, reslist->listlock, reslist->timeout)) != APR_SUCCESS) { apr_thread_mutex_unlock(reslist->listlock); return rv; diff --git a/util-misc/apr_rmm.c b/util-misc/apr_rmm.c index 91e30885f..a9c0c7cbb 100644 --- a/util-misc/apr_rmm.c +++ b/util-misc/apr_rmm.c @@ -73,7 +73,7 @@ struct apr_rmm_t { apr_anylock_t lock; }; -static apr_rmm_off_t find_block_by_offset(apr_rmm_t *rmm, apr_rmm_off_t next, +static apr_rmm_off_t find_block_by_offset(apr_rmm_t *rmm, apr_rmm_off_t next, apr_rmm_off_t find, int includes) { apr_rmm_off_t prev = 0; @@ -107,7 +107,7 @@ static apr_rmm_off_t find_block_of_size(apr_rmm_t *rmm, apr_size_t size) return next; if (blk->size >= size) { - /* XXX: sub optimal algorithm + /* XXX: sub optimal algorithm * We need the most thorough best-fit logic, since we can * never grow our rmm, we are SOL when we hit the wall. */ @@ -141,7 +141,7 @@ static apr_rmm_off_t find_block_of_size(apr_rmm_t *rmm, apr_size_t size) } static void move_block(apr_rmm_t *rmm, apr_rmm_off_t this, int free) -{ +{ struct rmm_block_t *blk = (rmm_block_t*)((char*)rmm->base + this); /* close the gap */ @@ -210,14 +210,14 @@ static void move_block(apr_rmm_t *rmm, apr_rmm_off_t this, int free) } } -APR_DECLARE(apr_status_t) apr_rmm_init(apr_rmm_t **rmm, apr_anylock_t *lock, +APR_DECLARE(apr_status_t) apr_rmm_init(apr_rmm_t **rmm, apr_anylock_t *lock, void *base, apr_size_t size, apr_pool_t *p) { apr_status_t rv; rmm_block_t *blk; apr_anylock_t nulllock; - + if (!lock) { nulllock.type = apr_anylock_none; nulllock.lock.pm = NULL; @@ -298,7 +298,7 @@ APR_DECLARE(apr_status_t) apr_rmm_attach(apr_rmm_t **rmm, apr_anylock_t *lock, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_rmm_detach(apr_rmm_t *rmm) +APR_DECLARE(apr_status_t) apr_rmm_detach(apr_rmm_t *rmm) { /* A noop until we introduce locked/refcounts */ return APR_SUCCESS; @@ -308,7 +308,7 @@ APR_DECLARE(apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm, apr_size_t reqsize) { apr_size_t size; apr_rmm_off_t this; - + size = APR_ALIGN_DEFAULT(reqsize) + RMM_BLOCK_SIZE; if (size < reqsize) { return 0; @@ -331,7 +331,7 @@ APR_DECLARE(apr_rmm_off_t) apr_rmm_calloc(apr_rmm_t *rmm, apr_size_t reqsize) { apr_size_t size; apr_rmm_off_t this; - + size = APR_ALIGN_DEFAULT(reqsize) + RMM_BLOCK_SIZE; if (size < reqsize) { return 0; @@ -427,11 +427,11 @@ APR_DECLARE(apr_status_t) apr_rmm_free(apr_rmm_t *rmm, apr_rmm_off_t this) /* Ok, it remained [apparently] sane, so unlink it */ move_block(rmm, this, 1); - + return APR_ANYLOCK_UNLOCK(&rmm->lock); } -APR_DECLARE(void *) apr_rmm_addr_get(apr_rmm_t *rmm, apr_rmm_off_t entity) +APR_DECLARE(void *) apr_rmm_addr_get(apr_rmm_t *rmm, apr_rmm_off_t entity) { /* debug-sanity checking here would be good */ @@ -448,7 +448,7 @@ APR_DECLARE(apr_rmm_off_t) apr_rmm_offset_get(apr_rmm_t *rmm, void* entity) return ((char*)entity - (char*)rmm->base); } -APR_DECLARE(apr_size_t) apr_rmm_overhead_get(int n) +APR_DECLARE(apr_size_t) apr_rmm_overhead_get(int n) { /* overhead per block is at most APR_ALIGN_DEFAULT(1) wasted bytes * for alignment overhead, plus the size of the rmm_block_t diff --git a/util-misc/apr_thread_pool.c b/util-misc/apr_thread_pool.c index b4f903c76..d0d1247f3 100644 --- a/util-misc/apr_thread_pool.c +++ b/util-misc/apr_thread_pool.c @@ -339,7 +339,7 @@ static void *APR_THREAD_FUNC thread_pool_func(apr_thread_t * t, void *param) ++me->idle_cnt; APR_RING_INSERT_TAIL(me->idle_thds, elt, apr_thread_list_elt, link); - /* + /* * If there is a scheduled task, always scheduled to perform that task. * Since there is no guarantee that current idle threads are scheduled * for next scheduled task. @@ -432,8 +432,8 @@ APR_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t ** me, return rv; apr_pool_pre_cleanup_register(tp->pool, tp, thread_pool_cleanup); - /* Grab the mutex as apr_thread_create() and thread_pool_func() will - * allocate from (*me)->pool. This is dangerous if there are multiple + /* Grab the mutex as apr_thread_create() and thread_pool_func() will + * allocate from (*me)->pool. This is dangerous if there are multiple * initial threads to create. */ apr_thread_mutex_lock(tp->lock); @@ -498,8 +498,8 @@ static apr_thread_pool_task_t *task_new(apr_thread_pool_t * me, } /* - * Test it the task is the only one within the priority segment. - * If it is not, return the first element with same or lower priority. + * Test it the task is the only one within the priority segment. + * If it is not, return the first element with same or lower priority. * Otherwise, add the task into the queue and return NULL. * * NOTE: This function is not thread safe by itself. Caller should hold the lock @@ -978,7 +978,7 @@ APR_DECLARE(apr_size_t) apr_thread_pool_thread_max_set(apr_thread_pool_t *me, n = i; /* stop all idle threads */ } stop_idle_threads(me, i - n); - + return n; } |