[systemd-devel] [systemd-commits] .gitignore Makefile.am src/timedate
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Fri Mar 14 18:44:40 PDT 2014
On Thu, Mar 13, 2014 at 04:39:37PM -0700, Kay Sievers wrote:
> .gitignore | 1
> Makefile.am | 27 +
> src/timedate/test-timedate-sntp.c | 107 ++++++
> src/timedate/timedate-sntp.c | 652 ++++++++++++++++++++++++++++++++++++++
> src/timedate/timedate-sntp.h | 33 +
> 5 files changed, 817 insertions(+), 3 deletions(-)
>
> New commits:
> commit bcdbbd7ee1b7dc6ec19261c957ed11e5e1ed1aaf
> Author: Kay Sievers <kay at vrfy.org>
> Date: Mon Mar 10 22:15:56 2014 +0100
>
> timedated: add SNTP client/query hookup (unused for now)
Interesting :)
> +static int log2i(int a) {
> + int exp = 0;
> +
> + assert(a > 0);
> +
> + while (a > 0) {
> + a >>= 1;
> + exp++;
> + }
> +
> + return exp;
> +}
>
> +static double log2d(int a) {
> + if (a < 0)
> + return 1.0 / (1UL << - a);
> + return 1UL << a;
> +}
I pushed a replacement for those two which uses builtins.
Zbyszek
More information about the systemd-devel
mailing list