public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] math.h: Use reserved names for function parameters
@ 2021-06-25 17:19 Jonathan Wakely
  2021-06-25 20:49 ` Jeff Johnston
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2021-06-25 17:19 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

Similar to 4c49accf8997da21be19be0396b2a88f33b9f949 and
615cf4bdce0de86e57bdc27e008a35dd713e483f this avoids the use of
non-reserved names as function parameters. For this function the
parameter names do actually provide useful information, because
without the names it's not clear which parameter is the numerator and
which the denominator.  So rather than just remove the names, this
prefixes them with double-underscores.



[-- Attachment #2: newlib-math-patch.txt --]
[-- Type: text/plain, Size: 831 bytes --]

commit ed36860c6d98925f645c96e122e9e603b5963d17
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jun 25 18:15:25 2021 +0100

    math.h: Use reserved names for function parameters

diff --git a/newlib/libc/include/inttypes.h b/newlib/libc/include/inttypes.h
index 570ed0481..417ff224c 100644
--- a/newlib/libc/include/inttypes.h
+++ b/newlib/libc/include/inttypes.h
@@ -321,7 +321,7 @@ extern "C" {
 #endif
 
 extern intmax_t  imaxabs(intmax_t);
-extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denomer);
+extern imaxdiv_t imaxdiv(intmax_t __numer, intmax_t __denomer);
 extern intmax_t  strtoimax(const char *__restrict, char **__restrict, int);
 extern intmax_t  _strtoimax_r(struct _reent *, const char *__restrict, char **__restrict, int);
 extern uintmax_t strtoumax(const char *__restrict, char **__restrict, int);

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

* Re: [PATCH] math.h: Use reserved names for function parameters
  2021-06-25 17:19 [PATCH] math.h: Use reserved names for function parameters Jonathan Wakely
@ 2021-06-25 20:49 ` Jeff Johnston
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Johnston @ 2021-06-25 20:49 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Newlib

Patch merged.

-- Jeff J.

On Fri, Jun 25, 2021 at 1:21 PM Jonathan Wakely <jwakely@redhat.com> wrote:

> Similar to 4c49accf8997da21be19be0396b2a88f33b9f949 and
> 615cf4bdce0de86e57bdc27e008a35dd713e483f this avoids the use of
> non-reserved names as function parameters. For this function the
> parameter names do actually provide useful information, because
> without the names it's not clear which parameter is the numerator and
> which the denominator.  So rather than just remove the names, this
> prefixes them with double-underscores.
>
>
>

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

end of thread, other threads:[~2021-06-25 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 17:19 [PATCH] math.h: Use reserved names for function parameters Jonathan Wakely
2021-06-25 20:49 ` Jeff Johnston

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 read-only IMAP folder(s) and NNTP newsgroup(s).