public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Various pages: Consistently use 'unsigned int'
@ 2020-12-30 21:41 Alejandro Colomar
  2020-12-30 22:34 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 5+ messages in thread
From: Alejandro Colomar @ 2020-12-30 21:41 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

$ find man? -type f \
  |xargs sed -i \
	-e 's/unsigned \*/unsigned int */g'
	-e 's/unsigned "/unsigned int "/g';

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/getcpu.2     | 4 ++--
 man2/io_setup.2   | 2 +-
 man2/mbind.2      | 2 +-
 man3/cfree.3      | 2 +-
 man3/des_crypt.3  | 8 ++++----
 man3/getrpcport.3 | 2 +-
 man3/random.3     | 4 ++--
 man3/xdr.3        | 2 +-
 8 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/man2/getcpu.2 b/man2/getcpu.2
index fc36b43b5..46e4d53ff 100644
--- a/man2/getcpu.2
+++ b/man2/getcpu.2
@@ -16,8 +16,8 @@ getcpu \- determine CPU and NUMA node on which the calling thread is running
 .nf
 .B #include <linux/getcpu.h>
 .PP
-.BI "int getcpu(unsigned *" cpu ", unsigned *" node \
-", struct getcpu_cache *" tcache );
+.BI "int getcpu(unsigned int *" cpu ", unsigned int *" node ,
+.BI "           struct getcpu_cache *" tcache );
 .fi
 .SH DESCRIPTION
 The
diff --git a/man2/io_setup.2 b/man2/io_setup.2
index e08d19bb8..bd52a5311 100644
--- a/man2/io_setup.2
+++ b/man2/io_setup.2
@@ -11,7 +11,7 @@ io_setup \- create an asynchronous I/O context
 .nf
 .BR "#include <linux/aio_abi.h>" "          /* Defines needed types */"
 .PP
-.BI "long io_setup(unsigned " nr_events ", aio_context_t *" ctx_idp );
+.BI "long io_setup(unsigned int " nr_events ", aio_context_t *" ctx_idp );
 .fi
 .PP
 .IR Note :
diff --git a/man2/mbind.2 b/man2/mbind.2
index bf66dfc6c..d98969e7f 100644
--- a/man2/mbind.2
+++ b/man2/mbind.2
@@ -41,7 +41,7 @@ mbind \- set memory policy for a memory range
 .PP
 .BI "long mbind(void *" addr ", unsigned long " len  ", int " mode ,
 .BI "           const unsigned long *" nodemask  ", unsigned long " maxnode ,
-.BI "           unsigned " flags );
+.BI "           unsigned int " flags );
 .PP
 Link with \fI\-lnuma\fP.
 .fi
diff --git a/man3/cfree.3 b/man3/cfree.3
index 2a09527a7..74223db71 100644
--- a/man3/cfree.3
+++ b/man3/cfree.3
@@ -36,7 +36,7 @@ cfree \- free allocated memory
 .BI "void cfree(void *" ptr );
 .PP
 /* In SCO OpenServer */
-.BI "void cfree(char *" ptr ", unsigned " num ", unsigned " size );
+.BI "void cfree(char *" ptr ", unsigned int " num ", unsigned int " size );
 .PP
 /* In Solaris watchmalloc.so.1 */
 .BI "void cfree(void *" ptr ", size_t " nelem ", size_t " elsize );
diff --git a/man3/des_crypt.3 b/man3/des_crypt.3
index 7f34c1585..66fe78337 100644
--- a/man3/des_crypt.3
+++ b/man3/des_crypt.3
@@ -21,11 +21,11 @@ DES encryption
 .\" .B #include <des_crypt.h>
 .B #include <rpc/des_crypt.h>
 .PP
-.BI "int ecb_crypt(char *" key ", char *" data ", unsigned " datalen ,
-.BI "              unsigned " mode );
+.BI "int ecb_crypt(char *" key ", char *" data ", unsigned int " datalen ,
+.BI "              unsigned int " mode );
 .PP
-.BI "int cbc_crypt(char *" key ", char *" data ", unsigned " datalen ,
-.BI "              unsigned " mode ", char *" ivec );
+.BI "int cbc_crypt(char *" key ", char *" data ", unsigned int " datalen ,
+.BI "              unsigned int " mode ", char *" ivec );
 .PP
 .BI "void des_setparity(char *" key );
 .PP
diff --git a/man3/getrpcport.3 b/man3/getrpcport.3
index 2eba5d30a..d5753d39b 100644
--- a/man3/getrpcport.3
+++ b/man3/getrpcport.3
@@ -13,7 +13,7 @@ getrpcport \- get RPC port number
 .B "#include <rpc/rpc.h>"
 .PP
 .BI "int getrpcport(const char *" host ", unsigned long " prognum ,
-.BI "               unsigned long " versnum ", unsigned " proto );
+.BI "               unsigned long " versnum ", unsigned int " proto );
 .fi
 .SH DESCRIPTION
 .BR getrpcport ()
diff --git a/man3/random.3 b/man3/random.3
index 33d15316b..9ea6fce3f 100644
--- a/man3/random.3
+++ b/man3/random.3
@@ -39,9 +39,9 @@ random, srandom, initstate, setstate \- random number generator
 .PP
 .B long random(void);
 .PP
-.BI "void srandom(unsigned " seed );
+.BI "void srandom(unsigned int " seed );
 .PP
-.BI "char *initstate(unsigned " seed ", char *" state ", size_t " n );
+.BI "char *initstate(unsigned int " seed ", char *" state ", size_t " n );
 .PP
 .BI "char *setstate(char *" state );
 .fi
diff --git a/man3/xdr.3 b/man3/xdr.3
index 713827567..978a50660 100644
--- a/man3/xdr.3
+++ b/man3/xdr.3
@@ -433,7 +433,7 @@ C characters and their external representations.
 This routine returns one if it succeeds, zero otherwise.
 .PP
 .nf
-.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned *" up );
+.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned int *" up );
 .fi
 .IP
 A filter primitive that translates between C
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Various pages: Consistently use 'unsigned int'
  2020-12-30 21:41 [PATCH] Various pages: Consistently use 'unsigned int' Alejandro Colomar
@ 2020-12-30 22:34 ` Michael Kerrisk (man-pages)
  2020-12-30 23:24   ` Alejandro Colomar (man-pages)
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-12-30 22:34 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

Hi Alex,

On Wed, 30 Dec 2020 at 22:42, Alejandro Colomar <alx.manpages@gmail.com> wrote:
>
> $ find man? -type f \
>   |xargs sed -i \
>         -e 's/unsigned \*/unsigned int */g'
>         -e 's/unsigned "/unsigned int "/g';

The patch is fine in my opinion, but the commit message needs work.
Something like:

1. Most pages use 'unsigned int'; make them all do so.
2. Explicit 'unsigned int' is clearer than 'unsigned'.

Thanks,

Michael

>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/getcpu.2     | 4 ++--
>  man2/io_setup.2   | 2 +-
>  man2/mbind.2      | 2 +-
>  man3/cfree.3      | 2 +-
>  man3/des_crypt.3  | 8 ++++----
>  man3/getrpcport.3 | 2 +-
>  man3/random.3     | 4 ++--
>  man3/xdr.3        | 2 +-
>  8 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/man2/getcpu.2 b/man2/getcpu.2
> index fc36b43b5..46e4d53ff 100644
> --- a/man2/getcpu.2
> +++ b/man2/getcpu.2
> @@ -16,8 +16,8 @@ getcpu \- determine CPU and NUMA node on which the calling thread is running
>  .nf
>  .B #include <linux/getcpu.h>
>  .PP
> -.BI "int getcpu(unsigned *" cpu ", unsigned *" node \
> -", struct getcpu_cache *" tcache );
> +.BI "int getcpu(unsigned int *" cpu ", unsigned int *" node ,
> +.BI "           struct getcpu_cache *" tcache );
>  .fi
>  .SH DESCRIPTION
>  The
> diff --git a/man2/io_setup.2 b/man2/io_setup.2
> index e08d19bb8..bd52a5311 100644
> --- a/man2/io_setup.2
> +++ b/man2/io_setup.2
> @@ -11,7 +11,7 @@ io_setup \- create an asynchronous I/O context
>  .nf
>  .BR "#include <linux/aio_abi.h>" "          /* Defines needed types */"
>  .PP
> -.BI "long io_setup(unsigned " nr_events ", aio_context_t *" ctx_idp );
> +.BI "long io_setup(unsigned int " nr_events ", aio_context_t *" ctx_idp );
>  .fi
>  .PP
>  .IR Note :
> diff --git a/man2/mbind.2 b/man2/mbind.2
> index bf66dfc6c..d98969e7f 100644
> --- a/man2/mbind.2
> +++ b/man2/mbind.2
> @@ -41,7 +41,7 @@ mbind \- set memory policy for a memory range
>  .PP
>  .BI "long mbind(void *" addr ", unsigned long " len  ", int " mode ,
>  .BI "           const unsigned long *" nodemask  ", unsigned long " maxnode ,
> -.BI "           unsigned " flags );
> +.BI "           unsigned int " flags );
>  .PP
>  Link with \fI\-lnuma\fP.
>  .fi
> diff --git a/man3/cfree.3 b/man3/cfree.3
> index 2a09527a7..74223db71 100644
> --- a/man3/cfree.3
> +++ b/man3/cfree.3
> @@ -36,7 +36,7 @@ cfree \- free allocated memory
>  .BI "void cfree(void *" ptr );
>  .PP
>  /* In SCO OpenServer */
> -.BI "void cfree(char *" ptr ", unsigned " num ", unsigned " size );
> +.BI "void cfree(char *" ptr ", unsigned int " num ", unsigned int " size );
>  .PP
>  /* In Solaris watchmalloc.so.1 */
>  .BI "void cfree(void *" ptr ", size_t " nelem ", size_t " elsize );
> diff --git a/man3/des_crypt.3 b/man3/des_crypt.3
> index 7f34c1585..66fe78337 100644
> --- a/man3/des_crypt.3
> +++ b/man3/des_crypt.3
> @@ -21,11 +21,11 @@ DES encryption
>  .\" .B #include <des_crypt.h>
>  .B #include <rpc/des_crypt.h>
>  .PP
> -.BI "int ecb_crypt(char *" key ", char *" data ", unsigned " datalen ,
> -.BI "              unsigned " mode );
> +.BI "int ecb_crypt(char *" key ", char *" data ", unsigned int " datalen ,
> +.BI "              unsigned int " mode );
>  .PP
> -.BI "int cbc_crypt(char *" key ", char *" data ", unsigned " datalen ,
> -.BI "              unsigned " mode ", char *" ivec );
> +.BI "int cbc_crypt(char *" key ", char *" data ", unsigned int " datalen ,
> +.BI "              unsigned int " mode ", char *" ivec );
>  .PP
>  .BI "void des_setparity(char *" key );
>  .PP
> diff --git a/man3/getrpcport.3 b/man3/getrpcport.3
> index 2eba5d30a..d5753d39b 100644
> --- a/man3/getrpcport.3
> +++ b/man3/getrpcport.3
> @@ -13,7 +13,7 @@ getrpcport \- get RPC port number
>  .B "#include <rpc/rpc.h>"
>  .PP
>  .BI "int getrpcport(const char *" host ", unsigned long " prognum ,
> -.BI "               unsigned long " versnum ", unsigned " proto );
> +.BI "               unsigned long " versnum ", unsigned int " proto );
>  .fi
>  .SH DESCRIPTION
>  .BR getrpcport ()
> diff --git a/man3/random.3 b/man3/random.3
> index 33d15316b..9ea6fce3f 100644
> --- a/man3/random.3
> +++ b/man3/random.3
> @@ -39,9 +39,9 @@ random, srandom, initstate, setstate \- random number generator
>  .PP
>  .B long random(void);
>  .PP
> -.BI "void srandom(unsigned " seed );
> +.BI "void srandom(unsigned int " seed );
>  .PP
> -.BI "char *initstate(unsigned " seed ", char *" state ", size_t " n );
> +.BI "char *initstate(unsigned int " seed ", char *" state ", size_t " n );
>  .PP
>  .BI "char *setstate(char *" state );
>  .fi
> diff --git a/man3/xdr.3 b/man3/xdr.3
> index 713827567..978a50660 100644
> --- a/man3/xdr.3
> +++ b/man3/xdr.3
> @@ -433,7 +433,7 @@ C characters and their external representations.
>  This routine returns one if it succeeds, zero otherwise.
>  .PP
>  .nf
> -.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned *" up );
> +.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned int *" up );
>  .fi
>  .IP
>  A filter primitive that translates between C
> --
> 2.29.2
>


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Various pages: Consistently use 'unsigned int'
  2020-12-30 22:34 ` Michael Kerrisk (man-pages)
@ 2020-12-30 23:24   ` Alejandro Colomar (man-pages)
  0 siblings, 0 replies; 5+ messages in thread
From: Alejandro Colomar (man-pages) @ 2020-12-30 23:24 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man



On 12/30/20 11:34 PM, Michael Kerrisk (man-pages) wrote:
> Hi Alex,
> 
> On Wed, 30 Dec 2020 at 22:42, Alejandro Colomar <alx.manpages@gmail.com> wrote:
>>
>> $ find man? -type f \
>>   |xargs sed -i \
>>         -e 's/unsigned \*/unsigned int */g'
>>         -e 's/unsigned "/unsigned int "/g';
> 
> The patch is fine in my opinion, but the commit message needs work.
> Something like:
> 
> 1. Most pages use 'unsigned int'; make them all do so.
> 2. Explicit 'unsigned int' is clearer than 'unsigned'.
> 

Agree.
I wasn't convinced by my commit msg,
but didn't come up with a good one (:
I'll fix it tomorrow.

Cheers,

Alex

> Thanks,
> 
> Michael
> 
>>
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>> ---
>>  man2/getcpu.2     | 4 ++--
>>  man2/io_setup.2   | 2 +-
>>  man2/mbind.2      | 2 +-
>>  man3/cfree.3      | 2 +-
>>  man3/des_crypt.3  | 8 ++++----
>>  man3/getrpcport.3 | 2 +-
>>  man3/random.3     | 4 ++--
>>  man3/xdr.3        | 2 +-
>>  8 files changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/man2/getcpu.2 b/man2/getcpu.2
>> index fc36b43b5..46e4d53ff 100644
>> --- a/man2/getcpu.2
>> +++ b/man2/getcpu.2
>> @@ -16,8 +16,8 @@ getcpu \- determine CPU and NUMA node on which the calling thread is running
>>  .nf
>>  .B #include <linux/getcpu.h>
>>  .PP
>> -.BI "int getcpu(unsigned *" cpu ", unsigned *" node \
>> -", struct getcpu_cache *" tcache );
>> +.BI "int getcpu(unsigned int *" cpu ", unsigned int *" node ,
>> +.BI "           struct getcpu_cache *" tcache );
>>  .fi
>>  .SH DESCRIPTION
>>  The
>> diff --git a/man2/io_setup.2 b/man2/io_setup.2
>> index e08d19bb8..bd52a5311 100644
>> --- a/man2/io_setup.2
>> +++ b/man2/io_setup.2
>> @@ -11,7 +11,7 @@ io_setup \- create an asynchronous I/O context
>>  .nf
>>  .BR "#include <linux/aio_abi.h>" "          /* Defines needed types */"
>>  .PP
>> -.BI "long io_setup(unsigned " nr_events ", aio_context_t *" ctx_idp );
>> +.BI "long io_setup(unsigned int " nr_events ", aio_context_t *" ctx_idp );
>>  .fi
>>  .PP
>>  .IR Note :
>> diff --git a/man2/mbind.2 b/man2/mbind.2
>> index bf66dfc6c..d98969e7f 100644
>> --- a/man2/mbind.2
>> +++ b/man2/mbind.2
>> @@ -41,7 +41,7 @@ mbind \- set memory policy for a memory range
>>  .PP
>>  .BI "long mbind(void *" addr ", unsigned long " len  ", int " mode ,
>>  .BI "           const unsigned long *" nodemask  ", unsigned long " maxnode ,
>> -.BI "           unsigned " flags );
>> +.BI "           unsigned int " flags );
>>  .PP
>>  Link with \fI\-lnuma\fP.
>>  .fi
>> diff --git a/man3/cfree.3 b/man3/cfree.3
>> index 2a09527a7..74223db71 100644
>> --- a/man3/cfree.3
>> +++ b/man3/cfree.3
>> @@ -36,7 +36,7 @@ cfree \- free allocated memory
>>  .BI "void cfree(void *" ptr );
>>  .PP
>>  /* In SCO OpenServer */
>> -.BI "void cfree(char *" ptr ", unsigned " num ", unsigned " size );
>> +.BI "void cfree(char *" ptr ", unsigned int " num ", unsigned int " size );
>>  .PP
>>  /* In Solaris watchmalloc.so.1 */
>>  .BI "void cfree(void *" ptr ", size_t " nelem ", size_t " elsize );
>> diff --git a/man3/des_crypt.3 b/man3/des_crypt.3
>> index 7f34c1585..66fe78337 100644
>> --- a/man3/des_crypt.3
>> +++ b/man3/des_crypt.3
>> @@ -21,11 +21,11 @@ DES encryption
>>  .\" .B #include <des_crypt.h>
>>  .B #include <rpc/des_crypt.h>
>>  .PP
>> -.BI "int ecb_crypt(char *" key ", char *" data ", unsigned " datalen ,
>> -.BI "              unsigned " mode );
>> +.BI "int ecb_crypt(char *" key ", char *" data ", unsigned int " datalen ,
>> +.BI "              unsigned int " mode );
>>  .PP
>> -.BI "int cbc_crypt(char *" key ", char *" data ", unsigned " datalen ,
>> -.BI "              unsigned " mode ", char *" ivec );
>> +.BI "int cbc_crypt(char *" key ", char *" data ", unsigned int " datalen ,
>> +.BI "              unsigned int " mode ", char *" ivec );
>>  .PP
>>  .BI "void des_setparity(char *" key );
>>  .PP
>> diff --git a/man3/getrpcport.3 b/man3/getrpcport.3
>> index 2eba5d30a..d5753d39b 100644
>> --- a/man3/getrpcport.3
>> +++ b/man3/getrpcport.3
>> @@ -13,7 +13,7 @@ getrpcport \- get RPC port number
>>  .B "#include <rpc/rpc.h>"
>>  .PP
>>  .BI "int getrpcport(const char *" host ", unsigned long " prognum ,
>> -.BI "               unsigned long " versnum ", unsigned " proto );
>> +.BI "               unsigned long " versnum ", unsigned int " proto );
>>  .fi
>>  .SH DESCRIPTION
>>  .BR getrpcport ()
>> diff --git a/man3/random.3 b/man3/random.3
>> index 33d15316b..9ea6fce3f 100644
>> --- a/man3/random.3
>> +++ b/man3/random.3
>> @@ -39,9 +39,9 @@ random, srandom, initstate, setstate \- random number generator
>>  .PP
>>  .B long random(void);
>>  .PP
>> -.BI "void srandom(unsigned " seed );
>> +.BI "void srandom(unsigned int " seed );
>>  .PP
>> -.BI "char *initstate(unsigned " seed ", char *" state ", size_t " n );
>> +.BI "char *initstate(unsigned int " seed ", char *" state ", size_t " n );
>>  .PP
>>  .BI "char *setstate(char *" state );
>>  .fi
>> diff --git a/man3/xdr.3 b/man3/xdr.3
>> index 713827567..978a50660 100644
>> --- a/man3/xdr.3
>> +++ b/man3/xdr.3
>> @@ -433,7 +433,7 @@ C characters and their external representations.
>>  This routine returns one if it succeeds, zero otherwise.
>>  .PP
>>  .nf
>> -.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned *" up );
>> +.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned int *" up );
>>  .fi
>>  .IP
>>  A filter primitive that translates between C
>> --
>> 2.29.2
>>
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Various pages: Consistently use 'unsigned int'
  2020-12-31  8:58 [PATCH] copy_file_range.2: SYNOPSIS: Fix prototype parameter types Michael Kerrisk (man-pages)
@ 2020-12-31 13:01 ` Alejandro Colomar
  2021-01-02  7:33   ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 5+ messages in thread
From: Alejandro Colomar @ 2020-12-31 13:01 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Most pages use 'unsigned int' (and the kernel too).
Make them all do so.

$ find man? -type f \
  |xargs sed -i \
	-e 's/unsigned \*/unsigned int */g'
	-e 's/unsigned "/unsigned int "/g';

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/getcpu.2     | 4 ++--
 man2/io_setup.2   | 2 +-
 man2/mbind.2      | 2 +-
 man3/cfree.3      | 2 +-
 man3/des_crypt.3  | 8 ++++----
 man3/getrpcport.3 | 2 +-
 man3/random.3     | 4 ++--
 man3/xdr.3        | 2 +-
 8 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/man2/getcpu.2 b/man2/getcpu.2
index fc36b43b5..46e4d53ff 100644
--- a/man2/getcpu.2
+++ b/man2/getcpu.2
@@ -16,8 +16,8 @@ getcpu \- determine CPU and NUMA node on which the calling thread is running
 .nf
 .B #include <linux/getcpu.h>
 .PP
-.BI "int getcpu(unsigned *" cpu ", unsigned *" node \
-", struct getcpu_cache *" tcache );
+.BI "int getcpu(unsigned int *" cpu ", unsigned int *" node ,
+.BI "           struct getcpu_cache *" tcache );
 .fi
 .SH DESCRIPTION
 The
diff --git a/man2/io_setup.2 b/man2/io_setup.2
index e08d19bb8..bd52a5311 100644
--- a/man2/io_setup.2
+++ b/man2/io_setup.2
@@ -11,7 +11,7 @@ io_setup \- create an asynchronous I/O context
 .nf
 .BR "#include <linux/aio_abi.h>" "          /* Defines needed types */"
 .PP
-.BI "long io_setup(unsigned " nr_events ", aio_context_t *" ctx_idp );
+.BI "long io_setup(unsigned int " nr_events ", aio_context_t *" ctx_idp );
 .fi
 .PP
 .IR Note :
diff --git a/man2/mbind.2 b/man2/mbind.2
index bf66dfc6c..d98969e7f 100644
--- a/man2/mbind.2
+++ b/man2/mbind.2
@@ -41,7 +41,7 @@ mbind \- set memory policy for a memory range
 .PP
 .BI "long mbind(void *" addr ", unsigned long " len  ", int " mode ,
 .BI "           const unsigned long *" nodemask  ", unsigned long " maxnode ,
-.BI "           unsigned " flags );
+.BI "           unsigned int " flags );
 .PP
 Link with \fI\-lnuma\fP.
 .fi
diff --git a/man3/cfree.3 b/man3/cfree.3
index 2a09527a7..74223db71 100644
--- a/man3/cfree.3
+++ b/man3/cfree.3
@@ -36,7 +36,7 @@ cfree \- free allocated memory
 .BI "void cfree(void *" ptr );
 .PP
 /* In SCO OpenServer */
-.BI "void cfree(char *" ptr ", unsigned " num ", unsigned " size );
+.BI "void cfree(char *" ptr ", unsigned int " num ", unsigned int " size );
 .PP
 /* In Solaris watchmalloc.so.1 */
 .BI "void cfree(void *" ptr ", size_t " nelem ", size_t " elsize );
diff --git a/man3/des_crypt.3 b/man3/des_crypt.3
index 7f34c1585..66fe78337 100644
--- a/man3/des_crypt.3
+++ b/man3/des_crypt.3
@@ -21,11 +21,11 @@ DES encryption
 .\" .B #include <des_crypt.h>
 .B #include <rpc/des_crypt.h>
 .PP
-.BI "int ecb_crypt(char *" key ", char *" data ", unsigned " datalen ,
-.BI "              unsigned " mode );
+.BI "int ecb_crypt(char *" key ", char *" data ", unsigned int " datalen ,
+.BI "              unsigned int " mode );
 .PP
-.BI "int cbc_crypt(char *" key ", char *" data ", unsigned " datalen ,
-.BI "              unsigned " mode ", char *" ivec );
+.BI "int cbc_crypt(char *" key ", char *" data ", unsigned int " datalen ,
+.BI "              unsigned int " mode ", char *" ivec );
 .PP
 .BI "void des_setparity(char *" key );
 .PP
diff --git a/man3/getrpcport.3 b/man3/getrpcport.3
index 2eba5d30a..d5753d39b 100644
--- a/man3/getrpcport.3
+++ b/man3/getrpcport.3
@@ -13,7 +13,7 @@ getrpcport \- get RPC port number
 .B "#include <rpc/rpc.h>"
 .PP
 .BI "int getrpcport(const char *" host ", unsigned long " prognum ,
-.BI "               unsigned long " versnum ", unsigned " proto );
+.BI "               unsigned long " versnum ", unsigned int " proto );
 .fi
 .SH DESCRIPTION
 .BR getrpcport ()
diff --git a/man3/random.3 b/man3/random.3
index d1b8e1981..c9066e446 100644
--- a/man3/random.3
+++ b/man3/random.3
@@ -39,9 +39,9 @@ random, srandom, initstate, setstate \- random number generator
 .PP
 .B long random(void);
 .PP
-.BI "void srandom(unsigned " seed );
+.BI "void srandom(unsigned int " seed );
 .PP
-.BI "char *initstate(unsigned " seed ", char *" state ", size_t " n );
+.BI "char *initstate(unsigned int " seed ", char *" state ", size_t " n );
 .PP
 .BI "char *setstate(char *" state );
 .fi
diff --git a/man3/xdr.3 b/man3/xdr.3
index 713827567..978a50660 100644
--- a/man3/xdr.3
+++ b/man3/xdr.3
@@ -433,7 +433,7 @@ C characters and their external representations.
 This routine returns one if it succeeds, zero otherwise.
 .PP
 .nf
-.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned *" up );
+.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned int *" up );
 .fi
 .IP
 A filter primitive that translates between C
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Various pages: Consistently use 'unsigned int'
  2020-12-31 13:01 ` [PATCH] Various pages: Consistently use 'unsigned int' Alejandro Colomar
@ 2021-01-02  7:33   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-01-02  7:33 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 12/31/20 2:01 PM, Alejandro Colomar wrote:
> Most pages use 'unsigned int' (and the kernel too).
> Make them all do so.
> 
> $ find man? -type f \
>   |xargs sed -i \
> 	-e 's/unsigned \*/unsigned int */g'
> 	-e 's/unsigned "/unsigned int "/g';
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Good work. Patch applied (manually, because I shot myself in 
the foot with the other recent work in SYNOPSIS).

Cheers,

Michael

> ---
>  man2/getcpu.2     | 4 ++--
>  man2/io_setup.2   | 2 +-
>  man2/mbind.2      | 2 +-
>  man3/cfree.3      | 2 +-
>  man3/des_crypt.3  | 8 ++++----
>  man3/getrpcport.3 | 2 +-
>  man3/random.3     | 4 ++--
>  man3/xdr.3        | 2 +-
>  8 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/man2/getcpu.2 b/man2/getcpu.2
> index fc36b43b5..46e4d53ff 100644
> --- a/man2/getcpu.2
> +++ b/man2/getcpu.2
> @@ -16,8 +16,8 @@ getcpu \- determine CPU and NUMA node on which the calling thread is running
>  .nf
>  .B #include <linux/getcpu.h>
>  .PP
> -.BI "int getcpu(unsigned *" cpu ", unsigned *" node \
> -", struct getcpu_cache *" tcache );
> +.BI "int getcpu(unsigned int *" cpu ", unsigned int *" node ,
> +.BI "           struct getcpu_cache *" tcache );
>  .fi
>  .SH DESCRIPTION
>  The
> diff --git a/man2/io_setup.2 b/man2/io_setup.2
> index e08d19bb8..bd52a5311 100644
> --- a/man2/io_setup.2
> +++ b/man2/io_setup.2
> @@ -11,7 +11,7 @@ io_setup \- create an asynchronous I/O context
>  .nf
>  .BR "#include <linux/aio_abi.h>" "          /* Defines needed types */"
>  .PP
> -.BI "long io_setup(unsigned " nr_events ", aio_context_t *" ctx_idp );
> +.BI "long io_setup(unsigned int " nr_events ", aio_context_t *" ctx_idp );
>  .fi
>  .PP
>  .IR Note :
> diff --git a/man2/mbind.2 b/man2/mbind.2
> index bf66dfc6c..d98969e7f 100644
> --- a/man2/mbind.2
> +++ b/man2/mbind.2
> @@ -41,7 +41,7 @@ mbind \- set memory policy for a memory range
>  .PP
>  .BI "long mbind(void *" addr ", unsigned long " len  ", int " mode ,
>  .BI "           const unsigned long *" nodemask  ", unsigned long " maxnode ,
> -.BI "           unsigned " flags );
> +.BI "           unsigned int " flags );
>  .PP
>  Link with \fI\-lnuma\fP.
>  .fi
> diff --git a/man3/cfree.3 b/man3/cfree.3
> index 2a09527a7..74223db71 100644
> --- a/man3/cfree.3
> +++ b/man3/cfree.3
> @@ -36,7 +36,7 @@ cfree \- free allocated memory
>  .BI "void cfree(void *" ptr );
>  .PP
>  /* In SCO OpenServer */
> -.BI "void cfree(char *" ptr ", unsigned " num ", unsigned " size );
> +.BI "void cfree(char *" ptr ", unsigned int " num ", unsigned int " size );
>  .PP
>  /* In Solaris watchmalloc.so.1 */
>  .BI "void cfree(void *" ptr ", size_t " nelem ", size_t " elsize );
> diff --git a/man3/des_crypt.3 b/man3/des_crypt.3
> index 7f34c1585..66fe78337 100644
> --- a/man3/des_crypt.3
> +++ b/man3/des_crypt.3
> @@ -21,11 +21,11 @@ DES encryption
>  .\" .B #include <des_crypt.h>
>  .B #include <rpc/des_crypt.h>
>  .PP
> -.BI "int ecb_crypt(char *" key ", char *" data ", unsigned " datalen ,
> -.BI "              unsigned " mode );
> +.BI "int ecb_crypt(char *" key ", char *" data ", unsigned int " datalen ,
> +.BI "              unsigned int " mode );
>  .PP
> -.BI "int cbc_crypt(char *" key ", char *" data ", unsigned " datalen ,
> -.BI "              unsigned " mode ", char *" ivec );
> +.BI "int cbc_crypt(char *" key ", char *" data ", unsigned int " datalen ,
> +.BI "              unsigned int " mode ", char *" ivec );
>  .PP
>  .BI "void des_setparity(char *" key );
>  .PP
> diff --git a/man3/getrpcport.3 b/man3/getrpcport.3
> index 2eba5d30a..d5753d39b 100644
> --- a/man3/getrpcport.3
> +++ b/man3/getrpcport.3
> @@ -13,7 +13,7 @@ getrpcport \- get RPC port number
>  .B "#include <rpc/rpc.h>"
>  .PP
>  .BI "int getrpcport(const char *" host ", unsigned long " prognum ,
> -.BI "               unsigned long " versnum ", unsigned " proto );
> +.BI "               unsigned long " versnum ", unsigned int " proto );
>  .fi
>  .SH DESCRIPTION
>  .BR getrpcport ()
> diff --git a/man3/random.3 b/man3/random.3
> index d1b8e1981..c9066e446 100644
> --- a/man3/random.3
> +++ b/man3/random.3
> @@ -39,9 +39,9 @@ random, srandom, initstate, setstate \- random number generator
>  .PP
>  .B long random(void);
>  .PP
> -.BI "void srandom(unsigned " seed );
> +.BI "void srandom(unsigned int " seed );
>  .PP
> -.BI "char *initstate(unsigned " seed ", char *" state ", size_t " n );
> +.BI "char *initstate(unsigned int " seed ", char *" state ", size_t " n );
>  .PP
>  .BI "char *setstate(char *" state );
>  .fi
> diff --git a/man3/xdr.3 b/man3/xdr.3
> index 713827567..978a50660 100644
> --- a/man3/xdr.3
> +++ b/man3/xdr.3
> @@ -433,7 +433,7 @@ C characters and their external representations.
>  This routine returns one if it succeeds, zero otherwise.
>  .PP
>  .nf
> -.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned *" up );
> +.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned int *" up );
>  .fi
>  .IP
>  A filter primitive that translates between C
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-02  7:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-30 21:41 [PATCH] Various pages: Consistently use 'unsigned int' Alejandro Colomar
2020-12-30 22:34 ` Michael Kerrisk (man-pages)
2020-12-30 23:24   ` Alejandro Colomar (man-pages)
  -- strict thread matches above, loose matches on Subject: below --
2020-12-31  8:58 [PATCH] copy_file_range.2: SYNOPSIS: Fix prototype parameter types Michael Kerrisk (man-pages)
2020-12-31 13:01 ` [PATCH] Various pages: Consistently use 'unsigned int' Alejandro Colomar
2021-01-02  7:33   ` Michael Kerrisk (man-pages)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox