linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Kent Gibson <warthog618@gmail.com>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [libgpiod][PATCH] core: examples: fix warning for u64 formatting on 32bit
Date: Fri, 30 Jun 2023 14:16:21 +0200	[thread overview]
Message-ID: <CAMRc=Mce6u+vUGPfGO73e8992X2m-ukfa633nmFX3dc95aQHzQ@mail.gmail.com> (raw)
In-Reply-To: <20230630090858.37485-1-warthog618@gmail.com>

On Fri, Jun 30, 2023 at 11:09 AM Kent Gibson <warthog618@gmail.com> wrote:
>
> The watch_line_info example prints the u64 timestamps using "%ld" which
> produces a warning for 32bit.  Replace it with PRIu64.
>
> Signed-off-by: Kent Gibson <warthog618@gmail.com>
> ---
>  examples/watch_line_info.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/examples/watch_line_info.c b/examples/watch_line_info.c
> index 1879a62..9df3121 100644
> --- a/examples/watch_line_info.c
> +++ b/examples/watch_line_info.c
> @@ -5,6 +5,7 @@
>
>  #include <errno.h>
>  #include <gpiod.h>
> +#include <inttypes.h>
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
> @@ -63,7 +64,7 @@ int main(void)
>
>                 info = gpiod_info_event_get_line_info(event);
>                 timestamp_ns = gpiod_info_event_get_timestamp_ns(event);
> -               printf("line %3d: %-9s %ld.%ld\n",
> +               printf("line %3d: %-9s %" PRIu64 ".%" PRIu64 "\n",
>                        gpiod_line_info_get_offset(info), event_type(event),
>                        timestamp_ns / 1000000000, timestamp_ns % 1000000000);
>
> --
> 2.41.0
>

Applied, thanks!

Bart

      reply	other threads:[~2023-06-30 12:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30  9:08 [libgpiod][PATCH] core: examples: fix warning for u64 formatting on 32bit Kent Gibson
2023-06-30 12:16 ` Bartosz Golaszewski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMRc=Mce6u+vUGPfGO73e8992X2m-ukfa633nmFX3dc95aQHzQ@mail.gmail.com' \
    --to=brgl@bgdev.pl \
    --cc=linux-gpio@vger.kernel.org \
    --cc=warthog618@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).