All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Young <sean@mess.org>
To: Hans Petter Selasky <hps@selasky.org>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH] [MEDIA] Use standard integer types
Date: Tue, 21 Jul 2020 18:07:43 +0100	[thread overview]
Message-ID: <20200721170743.GA9984@gofer.mess.org> (raw)
In-Reply-To: <12e18aad-76af-885f-babe-c25cc1863cdd@selasky.org>

On Tue, Jul 21, 2020 at 12:53:42PM +0200, Hans Petter Selasky wrote:
> Fixes compilation under FreeBSD.

Thanks, applied.

Sean

> 
> Signed-off-by: Hans Petter Selasky <hps@selasky.org>
> ---
>  utils/common/keymap.h     | 10 ++++++----
>  utils/keytable/keytable.c | 24 ++++++++++++------------
>  2 files changed, 18 insertions(+), 16 deletions(-)
> 
> diff --git a/utils/common/keymap.h b/utils/common/keymap.h
> index 99833827..dc198bc1 100644
> --- a/utils/common/keymap.h
> +++ b/utils/common/keymap.h
> @@ -2,6 +2,8 @@
>  #ifndef __KEYMAP_H
>  #define __KEYMAP_H
> 
> +#include <stdint.h>
> +
>  struct keymap {
>  	struct keymap *next;
>  	char *name;
> @@ -20,16 +22,16 @@ struct protocol_param {
> 
>  struct scancode_entry {
>  	struct scancode_entry *next;
> -	u_int64_t scancode;
> +	uint64_t scancode;
>  	char *keycode;
>  };
> 
>  struct raw_entry {
>  	struct raw_entry *next;
> -	u_int64_t scancode;
> -	u_int32_t raw_length;
> +	uint64_t scancode;
> +	uint32_t raw_length;
>  	char *keycode;
> -	u_int32_t raw[1];
> +	uint32_t raw[1];
>  };
> 
>  void free_keymap(struct keymap *map);
> diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
> index 3df5fcf2..cb91f1f0 100644
> --- a/utils/keytable/keytable.c
> +++ b/utils/keytable/keytable.c
> @@ -55,11 +55,11 @@
> 
>  struct input_keymap_entry_v2 {
>  #define KEYMAP_BY_INDEX	(1 << 0)
> -	u_int8_t  flags;
> -	u_int8_t  len;
> -	u_int16_t index;
> -	u_int32_t keycode;
> -	u_int8_t  scancode[32];
> +	uint8_t  flags;
> +	uint8_t  len;
> +	uint16_t index;
> +	uint32_t keycode;
> +	uint8_t  scancode[32];
>  };
> 
>  #ifndef input_event_sec
> @@ -82,7 +82,7 @@ struct input_keymap_entry_v2 {
>  struct keytable_entry {
>  	// 64 bit int which can printed with %llx
>  	unsigned long long scancode;
> -	u_int32_t keycode;
> +	uint32_t keycode;
>  	struct keytable_entry *next;
>  };
> 
> @@ -1376,7 +1376,7 @@ static int get_input_protocol_version(int fd)
>  static void clear_table(int fd)
>  {
>  	int i, j;
> -	u_int32_t codes[2];
> +	uint32_t codes[2];
>  	struct input_keymap_entry_v2 entry;
> 
>  	/* Clears old table */
> @@ -1463,7 +1463,7 @@ static void display_proto(struct rc_device *rc_dev)
>  }
> 
> 
> -static char *get_event_name(struct parse_event *event, u_int16_t code)
> +static char *get_event_name(struct parse_event *event, uint16_t code)
>  {
>  	struct parse_event *p;
> 
> @@ -1647,14 +1647,14 @@ static void display_table_v2(struct rc_device
> *rc_dev, int fd)
>  		if (ioctl(fd, EVIOCGKEYCODE_V2, &entry) == -1)
>  			break;
> 
> -		if (entry.len == sizeof(u_int32_t)) {
> -			u_int32_t temp;
> +		if (entry.len == sizeof(uint32_t)) {
> +			uint32_t temp;
> 
>  			memcpy(&temp, entry.scancode, sizeof(temp));
> 
>  			scancode = temp;
> -		} else if (entry.len == sizeof(u_int64_t)) {
> -			u_int64_t temp;
> +		} else if (entry.len == sizeof(uint64_t)) {
> +			uint64_t temp;
> 
>  			memcpy(&temp, entry.scancode, sizeof(temp));
> 
> -- 
> 2.27.0

      reply	other threads:[~2020-07-21 17:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 18:10 [PATCH] [MEDIA] Use standard integer types Hans Petter Selasky
2020-07-21  7:57 ` Sean Young
2020-07-21 10:46   ` Hans Petter Selasky
2020-07-21 10:53     ` Hans Petter Selasky
2020-07-21 17:07       ` Sean Young [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=20200721170743.GA9984@gofer.mess.org \
    --to=sean@mess.org \
    --cc=hps@selasky.org \
    --cc=linux-media@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.