Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jul 2016 19:47:15 -0500
From:      Benjamin Kaduk <bjkfbsd@gmail.com>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Konstantin Belousov <kostikbel@gmail.com>,  "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>,  "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,  "src-committers@freebsd.org" <src-committers@freebsd.org>
Subject:   Re: svn commit: r302252 - head/sys/kern
Message-ID:  <CAJ5_RoA-d8YGeFHEiGziOU6VutfuX6cHh%2BJ4YGYPcLhVv77B3w@mail.gmail.com>
In-Reply-To: <20160702153817.O1458@besplex.bde.org>
References:  <201606281643.u5SGhNsi061606@repo.freebsd.org> <20160629175917.O968@besplex.bde.org> <20160629145443.GG38613@kib.kiev.ua> <20160629153233.GI38613@kib.kiev.ua> <20160630040123.F791@besplex.bde.org> <20160629211953.GK38613@kib.kiev.ua> <20160701005401.Q1084@besplex.bde.org> <20160630180106.GU38613@kib.kiev.ua> <20160701031549.GV38613@kib.kiev.ua> <20160701185743.Q1600@besplex.bde.org> <20160701142516.GW38613@kib.kiev.ua> <20160702153817.O1458@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jul 2, 2016 at 3:04 AM, Bruce Evans <brde@optusnet.com.au> wrote:

> +       .th_counter = &dummy_timecounter,
>> +       .th_scale = (uint64_t)-1 / 1000000,
>> +       .th_offset = {1, 0},
>>
>
> Is there a syntax for avoiding the explicit 0 in a nested initializer?
> Something like th_offset.tv_sec = 1.


C99 does not require complete initializers (though my habit of running with
clang -Weverything does).  Just .th_offset = {1} should give the desired
result here.  I did not think that .th_offset.tv_sec was valid, though, so
when not-the-initial element is nonzero some zeros would still be needed.

-Ben



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ5_RoA-d8YGeFHEiGziOU6VutfuX6cHh%2BJ4YGYPcLhVv77B3w>