public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] newlib: Remove superfluous CHECK_STD_INIT() macro
Date: Tue,  5 Apr 2022 07:17:12 +0000 (GMT)	[thread overview]
Message-ID: <20220405071712.91E863858C55@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=bd95aa4d335bb27edb8a3b8335eb28f7c73d4187

commit bd95aa4d335bb27edb8a3b8335eb28f7c73d4187
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Thu Mar 31 08:43:49 2022 +0200

    newlib: Remove superfluous CHECK_STD_INIT() macro
    
    This macro is unused or expands to nothing.

Diff:
---
 newlib/libc/machine/spu/c99ppe.h  | 1 -
 newlib/libc/machine/spu/getchar.c | 2 --
 newlib/libc/machine/spu/gets.c    | 2 --
 newlib/libc/machine/spu/perror.c  | 2 --
 newlib/libc/machine/spu/putchar.c | 2 --
 newlib/libc/machine/spu/puts.c    | 2 --
 newlib/libc/machine/spu/vprintf.c | 2 --
 newlib/libc/machine/spu/vscanf.c  | 2 --
 newlib/libc/stdio/local.h         | 9 ---------
 9 files changed, 24 deletions(-)

diff --git a/newlib/libc/machine/spu/c99ppe.h b/newlib/libc/machine/spu/c99ppe.h
index 12a2cb3fb..263cf7fe0 100644
--- a/newlib/libc/machine/spu/c99ppe.h
+++ b/newlib/libc/machine/spu/c99ppe.h
@@ -105,6 +105,5 @@ FILE  *__sfp (struct _reent *);
 
 #define CHECK_INIT(ptr) \
   do { if ((ptr) && !(ptr)->__cleanup) __sinit (ptr); } while (0)
-#define CHECK_STD_INIT(ptr) /* currently, do nothing */
 #define CHECK_STR_INIT(ptr) /* currently, do nothing */
 #endif /* __ASSEMBLER__ */
diff --git a/newlib/libc/machine/spu/getchar.c b/newlib/libc/machine/spu/getchar.c
index 68247eff1..b166bba67 100644
--- a/newlib/libc/machine/spu/getchar.c
+++ b/newlib/libc/machine/spu/getchar.c
@@ -43,8 +43,6 @@ getchar ()
 {
   int ret;
 
-  CHECK_STD_INIT(_REENT);
-
   return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_GETCHAR, &ret);
 }
 #endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/gets.c b/newlib/libc/machine/spu/gets.c
index 2ac05db3b..1047c5fde 100644
--- a/newlib/libc/machine/spu/gets.c
+++ b/newlib/libc/machine/spu/gets.c
@@ -40,8 +40,6 @@ char *
 gets (buf)
      char *buf;
 {
-  CHECK_STD_INIT(_REENT);
-
   /* The return value gets written over buf
    */
   return (char*) __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_GETS, &buf);
diff --git a/newlib/libc/machine/spu/perror.c b/newlib/libc/machine/spu/perror.c
index eae1419a1..ec073b2f3 100644
--- a/newlib/libc/machine/spu/perror.c
+++ b/newlib/libc/machine/spu/perror.c
@@ -19,8 +19,6 @@ perror (const char *s)
 {
   c99_perror_t arg;
 
-  CHECK_STD_INIT(_REENT);
-
   arg.str = s;
   arg.arg_errno = errno;
   __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PERROR, &arg);
diff --git a/newlib/libc/machine/spu/putchar.c b/newlib/libc/machine/spu/putchar.c
index 67eb59976..7da00e0d7 100644
--- a/newlib/libc/machine/spu/putchar.c
+++ b/newlib/libc/machine/spu/putchar.c
@@ -10,8 +10,6 @@ int
 putchar (c)
      int c;
 {
-  CHECK_STD_INIT(_REENT);
-
   /* c gets overwritten before return */
 
   return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTCHAR, &c);
diff --git a/newlib/libc/machine/spu/puts.c b/newlib/libc/machine/spu/puts.c
index 27bd2bd52..2f0506793 100644
--- a/newlib/libc/machine/spu/puts.c
+++ b/newlib/libc/machine/spu/puts.c
@@ -7,8 +7,6 @@
 int
 puts (char const * s)
 {
-  CHECK_STD_INIT(_REENT);
-
   /* The return value gets written over s
    */
   return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTS, &s);
diff --git a/newlib/libc/machine/spu/vprintf.c b/newlib/libc/machine/spu/vprintf.c
index de98c0a33..d2ebc4eda 100644
--- a/newlib/libc/machine/spu/vprintf.c
+++ b/newlib/libc/machine/spu/vprintf.c
@@ -24,8 +24,6 @@ vprintf (const char *fmt,
 {
   c99_vprintf_t args;
 
-  CHECK_STD_INIT(_REENT);
-
   args.fmt = fmt;
   va_copy(args.ap,ap);
 
diff --git a/newlib/libc/machine/spu/vscanf.c b/newlib/libc/machine/spu/vscanf.c
index e2d324ed7..c246d57c3 100644
--- a/newlib/libc/machine/spu/vscanf.c
+++ b/newlib/libc/machine/spu/vscanf.c
@@ -56,8 +56,6 @@ vscanf (const char *fmt,
 {
   c99_vscanf_t args;
 
-  CHECK_STD_INIT(_REENT);
-
   args.fmt = (char*) fmt;
   va_copy(args.ap,ap);
 
diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h
index 50818db0e..30c534dcd 100644
--- a/newlib/libc/stdio/local.h
+++ b/newlib/libc/stdio/local.h
@@ -220,15 +220,6 @@ extern _READ_WRITE_RETURN_TYPE __swrite64 (struct _reent *, void *,
   while (0)
 #endif /* !_REENT_SMALL || _REENT_GLOBAL_STDIO_STREAMS */
 
-#define CHECK_STD_INIT(ptr) \
-  do								\
-    {								\
-      struct _reent *_check_init_ptr = (ptr);			\
-      if ((_check_init_ptr) && !(_check_init_ptr)->__cleanup)	\
-	__sinit (_check_init_ptr);				\
-    }								\
-  while (0)
-
 /* Return true and set errno and stream error flag iff the given FILE
    cannot be written now.  */


                 reply	other threads:[~2022-04-05  7:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220405071712.91E863858C55@sourceware.org \
    --to=sh@sourceware.org \
    --cc=newlib-cvs@sourceware.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 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).