From: Nick Mathewson Date: Fri, 17 Jul 2009 18:38:38 +0000 (+0000) Subject: Remove all trailing whitespace from end-of-line. X-Git-Tag: release-2.0.3-alpha~178 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d71b25b516332af4dec0fe29d44fea28c06ccd0;p=libevent Remove all trailing whitespace from end-of-line. svn:r1350 --- diff --git a/event-internal.h b/event-internal.h index cca5feb6..527ee2ce 100644 --- a/event-internal.h +++ b/event-internal.h @@ -12,7 +12,7 @@ * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. diff --git a/event.h b/event.h index 890961e6..b7d3b333 100644 --- a/event.h +++ b/event.h @@ -126,7 +126,7 @@ callbacks have been registered for a given URI. @section evrpc A framework for RPC servers and clients - + libevents provides a framework for creating RPC servers and clients. It takes care of marshaling and unmarshaling all data structures. diff --git a/event_rpcgen.py b/event_rpcgen.py index c401fab2..136d6a83 100755 --- a/event_rpcgen.py +++ b/event_rpcgen.py @@ -728,7 +728,7 @@ class EntryString(Entry): def CodeClear(self, structname): code = [ 'if (%s->%s_set == 1) {' % (structname, self.Name()), - ' free (%s->%s_data);' % (structname, self.Name()), + ' free(%s->%s_data);' % (structname, self.Name()), ' %s->%s_data = NULL;' % (structname, self.Name()), ' %s->%s_set = 0;' % (structname, self.Name()), '}' @@ -914,7 +914,7 @@ class EntryStruct(Entry): def CodeFree(self, name): code = ['if (%s->%s_data != NULL)' % (name, self._name), - ' %s_free(%s->%s_data); ' % ( + ' %s_free(%s->%s_data);' % ( self._refname, name, self._name)] return code @@ -1030,7 +1030,7 @@ class EntryVarBytes(Entry): def CodeFree(self, name): code = ['if (%s->%s_data != NULL)' % (name, self._name), - ' free (%s->%s_data); ' % (name, self._name)] + ' free(%s->%s_data);' % (name, self._name)] return code @@ -1479,7 +1479,7 @@ def GetNextStruct(file): continue if len(tokens[1]): - raise RpcGenError('Trailing garbage after struct on line %d' + raise RpcGenError('Trailing garbage after struct on line %d' % line_count) # We found the end of the struct @@ -1676,7 +1676,7 @@ class CommandLine: entry.PrintCode(impl_fp) impl_fp.close() -if __name__ == '__main__': +if __name__ == '__main__': try: CommandLine(sys.argv).run() sys.exit(0) diff --git a/evrpc-internal.h b/evrpc-internal.h index 79065ccb..b1431f03 100644 --- a/evrpc-internal.h +++ b/evrpc-internal.h @@ -60,7 +60,7 @@ struct _evrpc_hooks { /* hooks for processing outbound and inbound rpcs */ struct evrpc_hook_list in_hooks; struct evrpc_hook_list out_hooks; - + struct evrpc_pause_list pause_requests; }; @@ -142,7 +142,7 @@ struct evrpc_req_generic { /* the empty reply object that needs to be filled in */ void *reply; - /* + /* * the static structure for this rpc; that can be used to * automatically unmarshal and marshal the http buffers. */ diff --git a/evrpc.c b/evrpc.c index 9d6daa29..971465aa 100644 --- a/evrpc.c +++ b/evrpc.c @@ -1106,7 +1106,7 @@ evrpc_register_generic(struct evrpc_base *base, const char *name, int (*rpl_complete)(void *), void (*rpl_marshal)(struct evbuffer *, void *)) { - struct evrpc* rpc = + struct evrpc* rpc = evrpc_register_object(name, req_new, req_free, req_unmarshal, rpl_new, rpl_free, rpl_complete, rpl_marshal); if (rpc == NULL) diff --git a/http-internal.h b/http-internal.h index ab3d8039..b81f1985 100644 --- a/http-internal.h +++ b/http-internal.h @@ -63,7 +63,7 @@ struct evhttp_connection { struct bufferevent *bufev; struct event retry_ev; /* for retrying connects */ - + char *bind_address; /* address to use for binding the src */ u_short bind_port; /* local port for binding the src */ @@ -78,17 +78,17 @@ struct evhttp_connection { int timeout; /* timeout in seconds for events */ int retry_cnt; /* retry count */ int retry_max; /* maximum number of retries */ - + enum evhttp_connection_state state; /* for server connections, the http server they are connected with */ struct evhttp *http_server; TAILQ_HEAD(evcon_requestq, evhttp_request) requests; - + void (*cb)(struct evhttp_connection *, void *); void *cb_arg; - + void (*closecb)(struct evhttp_connection *, void *); void *closecb_arg; @@ -122,7 +122,7 @@ struct evhttp { TAILQ_HEAD(httpcbq, evhttp_cb) callbacks; struct evconq connections; - TAILQ_HEAD(vhostsq, evhttp) virtualhosts; + TAILQ_HEAD(vhostsq, evhttp) virtualhosts; /* NULL if this server is not a vhost */ char *vhost_pattern; diff --git a/include/event2/http.h b/include/event2/http.h index 6b175668..cf7b096f 100644 --- a/include/event2/http.h +++ b/include/event2/http.h @@ -120,8 +120,8 @@ int evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd); void evhttp_free(struct evhttp* http); /** - Set a callback for a specified URI - + Set a callback for a specified URI + @param http the http sever on which to set the callback @param path the path for which to invoke the callback @param cb the callback function that gets invoked on requesting path diff --git a/include/event2/rpc.h b/include/event2/rpc.h index 05b06ae4..5860bafc 100644 --- a/include/event2/rpc.h +++ b/include/event2/rpc.h @@ -68,7 +68,7 @@ extern "C" { /** Determines if the member has been set in the message - + @param msg the message to inspect @param member the member variable to test for presences @return 1 if it's present or 0 otherwise. @@ -245,7 +245,7 @@ struct evrpc_request_wrapper *evrpc_make_request_ctx( (void (*)(void *))rplystruct##_clear, \ (int (*)(void *, struct evbuffer *))rplystruct##_unmarshal); \ } - + /** Provides access to the HTTP request object underlying an RPC * * Access to the underlying http object; can be used to look at headers or @@ -261,18 +261,18 @@ struct evrpc_request_wrapper *evrpc_make_request_ctx( void evrpc_request_done(struct evrpc_req_generic *req); /** Creates the reply to an RPC request - * + * * EVRPC_REQUEST_DONE is used to answer a request; the reply is expected * to have been filled in. The request and reply pointers become invalid * after this call has finished. - * + * * @param rpc_req the rpc request structure provided to the server callback */ #define EVRPC_REQUEST_DONE(rpc_req) do { \ struct evrpc_req_generic *_req = (struct evrpc_req_generic *)(rpc_req); \ evrpc_request_done(_req); \ } while (0) - + struct evrpc_base; struct evhttp; @@ -287,7 +287,7 @@ struct evhttp; */ struct evrpc_base *evrpc_init(struct evhttp *server); -/** +/** * Frees the evrpc base * * For now, you are responsible for making sure that no rpcs are ongoing. @@ -385,7 +385,7 @@ struct evrpc_status; int evrpc_make_request(struct evrpc_request_wrapper *ctx); /** creates an rpc connection pool - * + * * a pool has a number of connections associated with it. * rpc requests are always made via a pool. * @@ -410,7 +410,7 @@ void evrpc_pool_free(struct evrpc_pool *pool); * @param pool the pool to which to add the connection * @param evcon the connection to add to the pool. */ -void evrpc_pool_add_connection(struct evrpc_pool *pool, +void evrpc_pool_add_connection(struct evrpc_pool *pool, struct evhttp_connection *evcon); /** @@ -538,7 +538,7 @@ void evrpc_hook_add_meta(void *ctx, const char *key, int evrpc_hook_find_meta(void *ctx, const char *key, void **data, size_t *data_size); -/** +/** * returns the connection object associated with the request * * @param ctx the context provided to the hook call @@ -564,7 +564,7 @@ int evrpc_send_request_generic(struct evrpc_pool *pool, /** Function for registering a generic RPC with the RPC base. - + Do not call this function directly, use EVRPC_REGISTER() instead. @see EVRPC_REGISTER() diff --git a/include/event2/rpc_struct.h b/include/event2/rpc_struct.h index 51d0e765..31411562 100644 --- a/include/event2/rpc_struct.h +++ b/include/event2/rpc_struct.h @@ -38,7 +38,7 @@ extern "C" { */ -/** +/** * provides information about the completed RPC request. */ struct evrpc_status { @@ -79,7 +79,7 @@ struct evrpc { /* verifies that the reply is valid */ int (*reply_complete)(void *); - + /* marshals the reply into a buffer */ void (*reply_marshal)(struct evbuffer*, void *); diff --git a/test/regress.c b/test/regress.c index caed3c15..0d26eb01 100644 --- a/test/regress.c +++ b/test/regress.c @@ -195,7 +195,7 @@ multiple_write_cb(int fd, short event, void *arg) } woff += len; - + if (woff >= sizeof(wbuf)) { shutdown(fd, SHUT_WR); if (usepersist) @@ -975,12 +975,12 @@ test_event_base_new(void *ptr) int towrite = strlen(TEST1)+1; int len = write(data->pair[0], TEST1, towrite); - if (len < 0) + if (len < 0) tt_abort_perror("initial write"); else if (len != towrite) tt_abort_printf(("initial write fell short (%d of %d bytes)", len, towrite)); - + if (shutdown(data->pair[0], SHUT_WR)) tt_abort_perror("initial write shutdown"); diff --git a/test/regress_http.c b/test/regress_http.c index daa03e94..adcb2b57 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -1362,7 +1362,7 @@ http_bad_header_test(void *ptr) static int validate_header( const struct evkeyvalq* headers, - const char *key, const char *value) + const char *key, const char *value) { const char *real_val = evhttp_find_header(headers, key); tt_assert(real_val != NULL); @@ -1377,7 +1377,7 @@ http_parse_query_test(void *ptr) struct evkeyvalq headers; TAILQ_INIT(&headers); - + evhttp_parse_query("http://www.test.com/?q=test", &headers); tt_want(validate_header(&headers, "q", "test") == 0); evhttp_clear_headers(&headers);