From 009df872f730972ec53a70652959c7b47c7ece8b Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sat, 22 Dec 2007 16:26:51 +0000 Subject: [PATCH] Format casts so that there is a non-breaking space after the type, and remove unnecessary parentheses around the casted value. Thus, for example, the following: .IR "(size_t) (\-1)" . becomes: .IR "(size_t)\ \-1" . --- man2/getsid.2 | 2 +- man2/mmap.2 | 2 +- man2/mremap.2 | 2 +- man2/shmop.2 | 2 +- man3/clock.3 | 2 +- man3/ctime.3 | 2 +- man3/iconv.3 | 10 +++++----- man3/iconv_open.3 | 2 +- man3/mbrlen.3 | 8 ++++---- man3/mbrtowc.3 | 6 +++--- man3/mbsnrtowcs.3 | 4 ++-- man3/mbsrtowcs.3 | 4 ++-- man3/mbstowcs.3 | 4 ++-- man3/wcrtomb.3 | 2 +- man3/wcsnrtombs.3 | 4 ++-- man3/wcsrtombs.3 | 4 ++-- man3/wcstombs.3 | 4 ++-- 17 files changed, 32 insertions(+), 32 deletions(-) diff --git a/man2/getsid.2 b/man2/getsid.2 index 1d00fe24b..4e252fd0e 100644 --- a/man2/getsid.2 +++ b/man2/getsid.2 @@ -47,7 +47,7 @@ returns the session ID of the process with process ID session leader.) .SH RETURN VALUE On success, a session ID is returned. -On error, \fI(pid_t) \-1\fP will be returned, and +On error, \fI(pid_t)\ \-1\fP will be returned, and .I errno is set appropriately. .SH ERRORS diff --git a/man2/mmap.2 b/man2/mmap.2 index da5c07cb0..9d97c91f1 100644 --- a/man2/mmap.2 +++ b/man2/mmap.2 @@ -327,7 +327,7 @@ returns a pointer to the mapped area. On error, the value .B MAP_FAILED (that is, -.IR "(void *) \-1" ) +.IR "(void\ *)\ \-1" ) is returned, and .I errno is set appropriately. diff --git a/man2/mremap.2 b/man2/mremap.2 index c74ab9a08..9f40ed20c 100644 --- a/man2/mremap.2 +++ b/man2/mremap.2 @@ -125,7 +125,7 @@ On success returns a pointer to the new virtual memory area. On error, the value .B MAP_FAILED -(that is, \fI(void *) \-1\fP) is returned, +(that is, \fI(void\ *)\ \-1\fP) is returned, and \fIerrno\fP is set appropriately. .SH ERRORS .TP diff --git a/man2/shmop.2 b/man2/shmop.2 index 03c3eb6a0..6a0676e64 100644 --- a/man2/shmop.2 +++ b/man2/shmop.2 @@ -170,7 +170,7 @@ all attached shared memory segments are detached from the process. On success .BR shmat () returns the address of the attached shared memory segment; on error -.I (void *) \-1 +.I (void\ *)\ \-1 is returned, and .I errno is set to indicate the cause of the error. diff --git a/man3/clock.3 b/man3/clock.3 index b8f6685eb..88f37edaf 100644 --- a/man3/clock.3 +++ b/man3/clock.3 @@ -44,7 +44,7 @@ to get the number of seconds used, divide by .BR CLOCKS_PER_SEC . If the processor time used is not available or its value cannot be represented, the function returns the value -.IR (clock_t)\-1 . +.IR (clock_t)\ \-1 . .SH "CONFORMING TO" C89, C99, POSIX.1-2001. POSIX requires that diff --git a/man3/ctime.3 b/man3/ctime.3 index 19d8c768c..f437e75be 100644 --- a/man3/ctime.3 +++ b/man3/ctime.3 @@ -232,7 +232,7 @@ If the specified broken-down time cannot be represented as calendar time (seconds since the Epoch), .BR mktime () returns a value of -.I (time_t)(\-1) +.I (time_t)\ \-1 and does not alter the \fItm_wday\fP and \fItm_yday\fP members of the broken-down time structure. .SH "RETURN VALUE" diff --git a/man3/iconv.3 b/man3/iconv.3 index ac71f061d..1f844191f 100644 --- a/man3/iconv.3 +++ b/man3/iconv.3 @@ -49,7 +49,7 @@ The conversion can stop for four reasons: 1. An invalid multibyte sequence is encountered in the input. In this case it sets \fIerrno\fP to \fBEILSEQ\fP and returns -.IR (size_t)(\-1) . +.IR (size_t)\ \-1 . \fI*inbuf\fP is left pointing to the beginning of the invalid multibyte sequence. .PP @@ -64,13 +64,13 @@ non-reversible conversions performed during this call. input byte sequence terminates after it. In this case it sets \fIerrno\fP to \fBEINVAL\fP and returns -.IR (size_t)(\-1) . +.IR (size_t)\ \-1 . \fI*inbuf\fP is left pointing to the beginning of the incomplete multibyte sequence. .PP 4. The output buffer has no more room for the next converted character. In this case it sets \fIerrno\fP to \fBE2BIG\fP and returns -.IR (size_t)(\-1) . +.IR (size_t)\ \-1 . .PP A different case is when \fIinbuf\fP is NULL or \fI*inbuf\fP is NULL, but \fIoutbuf\fP is not NULL and \fI*outbuf\fP is not NULL. @@ -81,7 +81,7 @@ initial state and store a corresponding shift sequence at \fI*outbuf\fP. At most \fI*outbytesleft\fP bytes, starting at \fI*outbuf\fP, will be written. If the output buffer has no more room for this reset sequence, it sets \fIerrno\fP to \fBE2BIG\fP and returns -.IR (size_t)(\-1) . +.IR (size_t)\ \-1 . Otherwise it increments \fI*outbuf\fP and decrements \fI*outbytesleft\fP by the number of bytes written. @@ -97,7 +97,7 @@ The function returns the number of characters converted in a non-reversible way during this call; reversible conversions are not counted. In case of error, it sets \fIerrno\fP and returns -.IR (size_t)(\-1) . +.IR (size_t)\ \-1 . .SH ERRORS The following errors can occur, among others: .TP diff --git a/man3/iconv_open.3 b/man3/iconv_open.3 index 761f157ac..ec7421dea 100644 --- a/man3/iconv_open.3 +++ b/man3/iconv_open.3 @@ -72,7 +72,7 @@ The function returns a freshly allocated conversion descriptor. In case of error, it sets \fIerrno\fP and returns -.IR (iconv_t)(\-1) . +.IR (iconv_t)\ \-1 . .SH ERRORS The following error can occur, among others: .TP diff --git a/man3/mbrlen.3 b/man3/mbrlen.3 index 243fbdf4b..f73f96e25 100644 --- a/man3/mbrlen.3 +++ b/man3/mbrlen.3 @@ -35,7 +35,7 @@ shift state \fI*ps\fP to the initial state and returns 0. If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte character, .BR mbrlen () -returns \fI(size_t)(\-2)\fP. +returns \fI(size_t)\ \-2\fP. This can happen even if \fIn\fP >= \fIMB_CUR_MAX\fP, if the multibyte string contains redundant shift sequences. @@ -44,7 +44,7 @@ If the multibyte string starting at \fIs\fP contains an invalid multibyte sequence before the next complete character, .BR mbrlen () returns -\fI(size_t) \-1\fP and sets \fIerrno\fP to \fBEILSEQ\fP. +\fI(size_t)\ \-1\fP and sets \fIerrno\fP to \fBEILSEQ\fP. In this case, the effects on \fI*ps\fP are undefined. .PP @@ -59,10 +59,10 @@ parsed from the multibyte sequence starting at \fIs\fP, if a non-null wide character was recognized. It returns 0, if a null wide character was recognized. It returns -.I "(size_t) \-1" +.I "(size_t)\ \-1" and sets \fIerrno\fP to \fBEILSEQ\fP, if an invalid multibyte sequence was encountered. -It returns \fI(size_t)(\-2)\fP if it couldn't parse a complete multibyte +It returns \fI(size_t)\ \-2\fP if it couldn't parse a complete multibyte character, meaning that \fIn\fP should be increased. .SH "CONFORMING TO" C99 diff --git a/man3/mbrtowc.3 b/man3/mbrtowc.3 index 7ac378d79..df98cc157 100644 --- a/man3/mbrtowc.3 +++ b/man3/mbrtowc.3 @@ -40,7 +40,7 @@ state \fI*ps\fP to the initial state and returns 0. If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte character, .BR mbrtowc () -returns \fI(size_t)(\-2)\fP. +returns \fI(size_t)\ \-2\fP. This can happen even if \fIn\fP >= \fIMB_CUR_MAX\fP, if the multibyte string contains redundant shift sequences. @@ -91,10 +91,10 @@ multibyte sequence starting at \fIs\fP, if a non-L'\\0' wide character was recognized. It returns 0, if a L'\\0' wide character was recognized. It returns -.I (size_t)(\-1) +.I (size_t)\ \-1 and sets \fIerrno\fP to \fBEILSEQ\fP, if an invalid multibyte sequence was encountered. -It returns \fI(size_t)(\-2)\fP if it couldn't parse a complete multibyte +It returns \fI(size_t)\ \-2\fP if it couldn't parse a complete multibyte character, meaning that \fIn\fP should be increased. .SH "CONFORMING TO" C99 diff --git a/man3/mbsnrtowcs.3 b/man3/mbsnrtowcs.3 index 4e6dbea3f..c0dda1427 100644 --- a/man3/mbsnrtowcs.3 +++ b/man3/mbsnrtowcs.3 @@ -50,7 +50,7 @@ conversion can stop for three reasons: 1. An invalid multibyte sequence has been encountered. In this case \fI*src\fP is left pointing to the invalid multibyte sequence, -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned, and \fIerrno\fP is set to \fBEILSEQ\fP. .PP @@ -85,7 +85,7 @@ that make up the converted part of the wide-character string, not including the terminating null wide character. If an invalid multibyte sequence was encountered, -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned, and \fIerrno\fP set to \fBEILSEQ\fP. .SH "CONFORMING TO" This function is a GNU extension. diff --git a/man3/mbsrtowcs.3 b/man3/mbsrtowcs.3 index 7bc3297e6..b9e212fba 100644 --- a/man3/mbsrtowcs.3 +++ b/man3/mbsrtowcs.3 @@ -40,7 +40,7 @@ The conversion can stop for three reasons: 1. An invalid multibyte sequence has been encountered. In this case \fI*src\fP is left pointing to the invalid multibyte sequence, -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned, and \fIerrno\fP is set to \fBEILSEQ\fP. .PP @@ -79,7 +79,7 @@ up the converted part of the wide-character string, not including the terminating null wide character. If an invalid multibyte sequence was encountered, -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned, and \fIerrno\fP set to \fBEILSEQ\fP. .SH "CONFORMING TO" C99 diff --git a/man3/mbstowcs.3 b/man3/mbstowcs.3 index f3e42ce37..2f0244682 100644 --- a/man3/mbstowcs.3 +++ b/man3/mbstowcs.3 @@ -33,7 +33,7 @@ The conversion can stop for three reasons: .PP 1. An invalid multibyte sequence has been encountered. In this case -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned. .PP 2. \fIn\fP non-L'\\0' wide characters have been stored at \fIdest\fP. @@ -63,7 +63,7 @@ up the converted part of the wide-character string, not including the terminating null wide character. If an invalid multibyte sequence was encountered, -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned. .SH "CONFORMING TO" C99 diff --git a/man3/wcrtomb.3 b/man3/wcrtomb.3 index 065ae109b..b4865b640 100644 --- a/man3/wcrtomb.3 +++ b/man3/wcrtomb.3 @@ -67,7 +67,7 @@ bytes that have been or would have been written to the byte array at \fIs\fP. If \fIwc\fP can not be represented as a multibyte sequence (according to the current locale), -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned, and \fIerrno\fP set to \fBEILSEQ\fP. .SH "CONFORMING TO" C99. diff --git a/man3/wcsnrtombs.3 b/man3/wcsnrtombs.3 index 387996625..c4c287de9 100644 --- a/man3/wcsnrtombs.3 +++ b/man3/wcsnrtombs.3 @@ -53,7 +53,7 @@ The conversion can stop for three reasons: multibyte sequence (according to the current locale). In this case \fI*src\fP is left pointing to the invalid wide character, -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned, and \fIerrno\fP is set to \fBEILSEQ\fP. .PP @@ -91,7 +91,7 @@ converted part of multibyte sequence, not including the terminating null byte. If a wide character was encountered which could not be converted, -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned, and \fIerrno\fP set to \fBEILSEQ\fP. .SH "CONFORMING TO" This function is a GNU extension. diff --git a/man3/wcsrtombs.3 b/man3/wcsrtombs.3 index e8c610191..0b73308d1 100644 --- a/man3/wcsrtombs.3 +++ b/man3/wcsrtombs.3 @@ -44,7 +44,7 @@ The conversion can stop for three reasons: multibyte sequence (according to the current locale). In this case \fI*src\fP is left pointing to the invalid wide character, -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned, and .I errno @@ -83,7 +83,7 @@ converted part of multibyte sequence, not including the terminating null byte. If a wide character was encountered which could not be converted, -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned, and .I errno set to \fBEILSEQ\fP. diff --git a/man3/wcstombs.3 b/man3/wcstombs.3 index 650bd7bd2..2dfdd5ea8 100644 --- a/man3/wcstombs.3 +++ b/man3/wcstombs.3 @@ -34,7 +34,7 @@ The conversion can stop for three reasons: 1. A wide character has been encountered that can not be represented as a multibyte sequence (according to the current locale). In this case -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned. .PP 2. The length limit forces a stop. @@ -63,7 +63,7 @@ function returns the number of bytes that make up the converted part of multibyte sequence, not including the terminating null byte. If a wide character was encountered which could not be converted, -.I (size_t)(\-1) +.I (size_t)\ \-1 is returned. .SH "CONFORMING TO" C99.