G/Morning,
Herewith an svn diff that implements line-by-line initialization of
three structures (no idea if there's a technical term for it) in place
of the list method now used, e.g struct x = { , , , }.
I acknowledge upfront that 'my' somewhat dated compiler cannot handle
the list method, whereas the method portrayed in the diff is totally
acceptable to it.
However, I find the 'list' method less easier to 'read' as the struct
elements are not 'visible', and one has to locate the struct definition
itself to see what is being set to what. The method as illustrated by
the patch is clearer (to my mind) and not affected by the order of the
elements within the primary structure.
Lastly I noticed at least one case recently where my diff 'simplified'
because a struct was changed to the _suggested_ method, with the primary
struct being created by a memset(); perhaps that's a similar change
needed in these cases also?
Regards,
Norm
Index: h2_mplx.c
===================================================================
--- h2_mplx.c (revision 1697659)
+++ h2_mplx.c (working copy)
@@ -436,7 +436,12 @@
}
status = apr_thread_mutex_lock(m->lock);
if (APR_SUCCESS == status) {
- update_ctx ctx = { cb, cb_ctx, 0 };
+
+ update_ctx ctx;
+ ctx.cb = cb;
+ ctx.cb_ctx = cb_ctx;
+ ctx.streams_updated = 0;
+
status = APR_EAGAIN;
h2_io_set_iter(m->stream_ios, update_window, &ctx);
Index: h2_session.c
===================================================================
--- h2_session.c (revision 1697659)
+++ h2_session.c (working copy)
@@ -852,7 +852,11 @@
AP_DEBUG_ASSERT(session);
if (!h2_stream_set_is_empty(session->streams)
&& session->mplx && !session->aborted) {
- resume_ctx ctx = { session, 0 };
+
+ resume_ctx ctx;
+ ctx.session = session;
+ ctx.resume_count = 0;
+
/* Resume all streams where we have data in the out queue and
* which had been suspended before. */
h2_stream_set_iter(session->streams, resume_on_data, &ctx);
Index: h2_response.c
===================================================================
--- h2_response.c (revision 1697659)
+++ h2_response.c (working copy)
@@ -202,7 +202,14 @@
{
size_t n;
h2_ngheader *h;
- nvctx_t ctx = { NULL, 1, strlen(status) + 1, 0, NULL, pool };
+
+ nvctx_t ctx;
+ ctx.nv = NULL;
+ ctx.nvlen = 1;
+ ctx.nvstrlen = strlen(status) + 1;
+ ctx.offset = 0;
+ ctx.strbuf = NULL;
+ ctx.pool = pool;
apr_table_do(count_header, &ctx, header, NULL);