This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v2 13/17] ansification: remove _EXFNPTR, _EXPARM


Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
---
 newlib/libc/iconv/lib/conv.h    | 28 ++++++++++++------------
 newlib/libc/iconv/lib/ucsconv.h | 48 ++++++++++++++++++++---------------------
 newlib/libc/include/_ansi.h     |  4 ----
 newlib/libc/include/rpc/xdr.h   | 26 +++++++++++-----------
 newlib/libc/include/sys/reent.h | 30 +++++++++++++-------------
 newlib/libc/search/bsearch.c    |  2 +-
 newlib/libc/stdio/fseeko.c      |  2 +-
 newlib/libc/stdio64/fseeko64.c  |  2 +-
 newlib/libc/stdlib/atexit.c     |  2 +-
 newlib/libc/stdlib/on_exit.c    |  2 +-
 newlib/libc/xdr/xdr_private.h   |  2 +-
 newlib/libc/xdr/xdr_rec.c       |  4 ++--
 newlib/libc/xdr/xdr_sizeof.c    |  6 +++---
 13 files changed, 77 insertions(+), 81 deletions(-)

diff --git a/newlib/libc/iconv/lib/conv.h b/newlib/libc/iconv/lib/conv.h
index 89da4b224..658ab9152 100644
--- a/newlib/libc/iconv/lib/conv.h
+++ b/newlib/libc/iconv/lib/conv.h
@@ -63,9 +63,9 @@ typedef struct
    *   Pointer to conversion-specific data if success. In case of error
    *   returns NULL and sets current thread's/process's errno.
    */
-  void *_EXFNPTR(open, (struct _reent *rptr,
+  void *(*open) (struct _reent *rptr,
                           const char *to,
-                          const char *from));
+                          const char *from);
   
   /*
    * close - close conversion.
@@ -81,8 +81,8 @@ typedef struct
    *   When successful, returns (size_t)0. In case of error, sets current
    *   thread's/process's errno and returns (size_t)-1 (same as iconv_open()).
    */
-  size_t _EXFNPTR(close, (struct _reent *rptr,
-                        void *data));
+  size_t (*close) (struct _reent *rptr,
+                        void *data);
   
   /* convert - perform encoding conversion.
    *
@@ -114,13 +114,13 @@ typedef struct
    *   Reversible conversions are not counted. In case of error, sets current
    *   thread's/process's errno and returns (size_t)-1 (same as iconv()).
    */
-  size_t _EXFNPTR(convert, (struct _reent *rptr,
+  size_t (*convert) (struct _reent *rptr,
                            void *data,
                            const unsigned char **inbuf,
                            size_t *inbytesleft,
                            unsigned char **outbuf,
                            size_t *outbytesleft,
-                           int flags));
+                           int flags);
   
   /*
    * get_state - get current shift state.
@@ -135,9 +135,9 @@ typedef struct
    *   If 'direction' is 0, "from" encoding is tested, else
    *   "to" encoding is tested.
    */
-  void _EXFNPTR(get_state, (void *data,
+  void (*get_state) (void *data,
                            mbstate_t *state,
-                           int direction));
+                           int direction);
 
   /*
    * set_state - set shift state.
@@ -154,9 +154,9 @@ typedef struct
    *   "to" encoding is set.
    *   Returns 0 if '*state' object has right format, -1 else.
    */
-  int _EXFNPTR(set_state, (void *data,
+  int (*set_state) (void *data,
                          mbstate_t *state,
-                         int direction));
+                         int direction);
   
   /*
    * get_mb_cur_max - get maximum character length in bytes.
@@ -170,8 +170,8 @@ typedef struct
    *   If 'direction' is 0, "from" encoding is tested, else
    *   "to" encoding is tested.
    */
-  int _EXFNPTR(get_mb_cur_max, (void *data,
-                              int direction));
+  int (*get_mb_cur_max) (void *data,
+                              int direction);
   
   /*
    * is_stateful - is encoding stateful or stateless.
@@ -185,8 +185,8 @@ typedef struct
    *   If 'direction' is 0, "from" encoding is tested, else
    *   "to" encoding is tested.
    */
-  int _EXFNPTR(is_stateful, (void *data,
-                           int direction));
+  int (*is_stateful) (void *data,
+                           int direction);
   
 } iconv_conversion_handlers_t;
 
diff --git a/newlib/libc/iconv/lib/ucsconv.h b/newlib/libc/iconv/lib/ucsconv.h
index 391daed35..2c3d8c647 100644
--- a/newlib/libc/iconv/lib/ucsconv.h
+++ b/newlib/libc/iconv/lib/ucsconv.h
@@ -68,8 +68,8 @@ typedef struct
    *   Returns CES-specific data pointer if success. In case of error returns
    *   NULL and sets current thread's/process's errno.
    */
-  void *_EXFNPTR(init, (struct _reent *rptr,
-                          const char *encoding));
+  void *(*init) (struct _reent *rptr,
+                          const char *encoding);
 
   /*
    * close - close CES converter.
@@ -84,8 +84,8 @@ typedef struct
    *   Returns (size_t)0 if success. In case of error returns (size_t)-1 and
    *   sets current thread's/process's errno.
    */
-  size_t _EXFNPTR(close, (struct _reent *rptr,
-                        void *data));
+  size_t (*close) (struct _reent *rptr,
+                        void *data);
 
   /*
    * get_mb_cur_max - get maximum character length in bytes.
@@ -96,7 +96,7 @@ typedef struct
    * DESCRIPTION:
    *   Returns encoding's maximum character length.
    */
-  int _EXFNPTR(get_mb_cur_max, (void *data));
+  int (*get_mb_cur_max) (void *data);
   
   /*
    * get_state - get current shift state.
@@ -108,8 +108,8 @@ typedef struct
    * DESCRIPTION:
    *   Returns encoding's current shift sequence.
    */
-  void _EXFNPTR(get_state, (void *data,
-                           mbstate_t *state));
+  void (*get_state) (void *data,
+                           mbstate_t *state);
 
   /*
    * set_state - set shift state.
@@ -123,8 +123,8 @@ typedef struct
    *   object is zero-object - reset current shift state.
    *   Returns 0 if '*state' object has right format, -1 else.
    */
-  int _EXFNPTR(set_state, (void *data,
-                         mbstate_t *state));
+  int (*set_state) (void *data,
+                         mbstate_t *state);
 
   /*
    * is_stateful - is encoding stateful state.
@@ -135,7 +135,7 @@ typedef struct
    * DESCRIPTION:
    *   Returns 0 if encoding is stateless, else returns 1.
    */
-  int _EXFNPTR(is_stateful, (void *data));
+  int (*is_stateful) (void *data);
   
   /*
    * convert_to_ucs - convert character to UCS.
@@ -155,9 +155,9 @@ typedef struct
    *   returns ICONV_CES_INVALID_CHARACTER. If invalid or incomplete bytes
    *   sequence was met, returns ICONV_CES_BAD_SEQUENCE.
    */
-  ucs4_t _EXFNPTR(convert_to_ucs, (void *data,
+  ucs4_t (*convert_to_ucs) (void *data,
                                  const unsigned char **inbuf,
-                                 size_t *inbytesleft));
+                                 size_t *inbytesleft);
 } iconv_to_ucs_ces_handlers_t;
 
 
@@ -172,26 +172,26 @@ typedef struct
 typedef struct
 {
   /* Same as in iconv_to_ucs_ces_handlers_t */
-  void *_EXFNPTR(init, (struct _reent *rptr,
-                          const char *encoding));
+  void *(*init) (struct _reent *rptr,
+                          const char *encoding);
 
   /* Same as in iconv_to_ucs_ces_handlers_t */
-  size_t _EXFNPTR(close, (struct _reent *rptr,
-                        void *data));
+  size_t (*close) (struct _reent *rptr,
+                        void *data);
 
   /* Same as in iconv_to_ucs_ces_handlers_t */
-  int _EXFNPTR(get_mb_cur_max, (void *data));
+  int (*get_mb_cur_max) (void *data);
 
   /* Same as in iconv_to_ucs_ces_handlers_t */
-  void _EXFNPTR(get_state, (void *data,
-                           mbstate_t *state));
+  void (*get_state) (void *data,
+                           mbstate_t *state);
 
   /* Same as in iconv_to_ucs_ces_handlers_t */
-  int _EXFNPTR(set_state, (void *data,
-                         mbstate_t *state));
+  int (*set_state) (void *data,
+                         mbstate_t *state);
 
   /* Same as in iconv_to_ucs_ces_handlers_t */
-  int _EXFNPTR(is_stateful, (void *data));
+  int (*is_stateful) (void *data);
   
   /*
    * convert_from_ucs - convert UCS character to destination encoding.
@@ -215,10 +215,10 @@ typedef struct
    *   If there is no corresponding character in destination encoding, returns
    *   ICONV_CES_INVALID_CHARACTER.
    */
-  size_t _EXFNPTR(convert_from_ucs, (void *data,
+  size_t (*convert_from_ucs) (void *data,
                                    ucs4_t in,
                                    unsigned char **outbuf,
-                                   size_t *outbytesleft));
+                                   size_t *outbytesleft);
 } iconv_from_ucs_ces_handlers_t;
 
 
diff --git a/newlib/libc/include/_ansi.h b/newlib/libc/include/_ansi.h
index 951617520..3e2490088 100644
--- a/newlib/libc/include/_ansi.h
+++ b/newlib/libc/include/_ansi.h
@@ -50,13 +50,9 @@
 #ifdef __CYGWIN__
 #define	_EXFUN_NOTHROW(name, proto)	__cdecl name proto _NOTHROW
 #define	_EXFUN(name, proto)		__cdecl name proto
-#define	_EXPARM(name, proto)		(* __cdecl name) proto
-#define	_EXFNPTR(name, proto)		(__cdecl * name) proto
 #else
 #define	_EXFUN_NOTHROW(name, proto)	name proto _NOTHROW
 #define	_EXFUN(name, proto)		name proto
-#define _EXPARM(name, proto)		(* name) proto
-#define _EXFNPTR(name, proto)		(* name) proto
 #endif
 #ifndef _LONG_DOUBLE
 #define _LONG_DOUBLE long double
diff --git a/newlib/libc/include/rpc/xdr.h b/newlib/libc/include/rpc/xdr.h
index 40ddc1cdd..bda8e9926 100644
--- a/newlib/libc/include/rpc/xdr.h
+++ b/newlib/libc/include/rpc/xdr.h
@@ -111,34 +111,34 @@ typedef struct __rpc_xdr
   const struct xdr_ops
   {
     /* get a long from underlying stream */
-    bool_t _EXFNPTR (x_getlong, (struct __rpc_xdr *, long *));
+    bool_t (*x_getlong) (struct __rpc_xdr *, long *);
 
     /* put a long to " */
-    bool_t _EXFNPTR (x_putlong, (struct __rpc_xdr *, const long *));
+    bool_t (*x_putlong) (struct __rpc_xdr *, const long *);
 
     /* get some bytes from " */
-    bool_t _EXFNPTR (x_getbytes, (struct __rpc_xdr *, char *, u_int));
+    bool_t (*x_getbytes) (struct __rpc_xdr *, char *, u_int);
 
     /* put some bytes to " */
-    bool_t _EXFNPTR (x_putbytes, (struct __rpc_xdr *, const char *, u_int));
+    bool_t (*x_putbytes) (struct __rpc_xdr *, const char *, u_int);
 
     /* returns bytes off from beginning */
-    u_int _EXFNPTR (x_getpostn, (struct __rpc_xdr *));
+    u_int (*x_getpostn) (struct __rpc_xdr *);
 
     /* lets you reposition the stream */
-    bool_t _EXFNPTR (x_setpostn, (struct __rpc_xdr *, u_int));
+    bool_t (*x_setpostn) (struct __rpc_xdr *, u_int);
 
     /* buf quick ptr to buffered data */
-    int32_t * _EXFNPTR (x_inline, (struct __rpc_xdr *, u_int));
+    int32_t * (*x_inline) (struct __rpc_xdr *, u_int);
 
     /* free privates of this xdr_stream */
-    void _EXFNPTR (x_destroy, (struct __rpc_xdr *));
+    void (*x_destroy) (struct __rpc_xdr *);
 
     /* get an int32 from this xdr_stream */
-    bool_t _EXFNPTR (x_getint32, (struct __rpc_xdr *, int32_t *));
+    bool_t (*x_getint32) (struct __rpc_xdr *, int32_t *);
 
     /* put an int32 to the underlying stream */
-    bool_t _EXFNPTR (x_putint32, (struct __rpc_xdr *, const int32_t *));
+    bool_t (*x_putint32) (struct __rpc_xdr *, const int32_t *);
 
   } *x_ops;
   char *x_public;               /* users' data */
@@ -156,7 +156,7 @@ typedef struct __rpc_xdr
  * allocate dynamic storage of the appropriate size and return it.
  * bool_t (*xdrproc_t)(XDR *, some_type *)
  */
-typedef bool_t _EXFNPTR(xdrproc_t, (XDR *, ...));
+typedef bool_t (*xdrproc_t) (XDR *, ...);
 
 /*
  * Operations defined on a XDR handle
@@ -366,8 +366,8 @@ extern void _EXFUN (xdrstdio_create, (XDR *, FILE *, enum xdr_op));
 
 /* XDR pseudo records for tcp */
 extern void _EXFUN (xdrrec_create, (XDR *, u_int, u_int, void *,
-                                    int _EXPARM (, (void *, void *, int)),
-                                    int _EXPARM (, (void *, void *, int))));
+                                    int (*) (void *, void *, int),
+                                    int (*) (void *, void *, int)));
 
 /* make end of xdr record */
 extern bool_t _EXFUN (xdrrec_endofrecord, (XDR *, bool_t));
diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index cfb79edd3..54fdf96f1 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -194,13 +194,13 @@ struct __sFILE {
   /* operations */
   void *	_cookie;	/* cookie passed to io functions */
 
-  _READ_WRITE_RETURN_TYPE _EXFNPTR(_read, (struct _reent *, void *,
-					   char *, _READ_WRITE_BUFSIZE_TYPE));
-  _READ_WRITE_RETURN_TYPE _EXFNPTR(_write, (struct _reent *, void *,
+  _READ_WRITE_RETURN_TYPE (*_read) (struct _reent *, void *,
+					   char *, _READ_WRITE_BUFSIZE_TYPE);
+  _READ_WRITE_RETURN_TYPE (*_write) (struct _reent *, void *,
 					    const char *,
-					    _READ_WRITE_BUFSIZE_TYPE));
-  _fpos_t _EXFNPTR(_seek, (struct _reent *, void *, _fpos_t, int));
-  int _EXFNPTR(_close, (struct _reent *, void *));
+					    _READ_WRITE_BUFSIZE_TYPE);
+  _fpos_t (*_seek) (struct _reent *, void *, _fpos_t, int);
+  int (*_close) (struct _reent *, void *);
 
   /* separate buffer for long sequences of ungetc() */
   struct __sbuf _ub;	/* ungetc buffer */
@@ -250,13 +250,13 @@ struct __sFILE64 {
   /* operations */
   void *	_cookie;	/* cookie passed to io functions */
 
-  _READ_WRITE_RETURN_TYPE _EXFNPTR(_read, (struct _reent *, void *,
-					   char *, _READ_WRITE_BUFSIZE_TYPE));
-  _READ_WRITE_RETURN_TYPE _EXFNPTR(_write, (struct _reent *, void *,
+  _READ_WRITE_RETURN_TYPE (*_read) (struct _reent *, void *,
+					   char *, _READ_WRITE_BUFSIZE_TYPE);
+  _READ_WRITE_RETURN_TYPE (*_write) (struct _reent *, void *,
 					    const char *,
-					    _READ_WRITE_BUFSIZE_TYPE));
-  _fpos_t _EXFNPTR(_seek, (struct _reent *, void *, _fpos_t, int));
-  int _EXFNPTR(_close, (struct _reent *, void *));
+					    _READ_WRITE_BUFSIZE_TYPE);
+  _fpos_t (*_seek) (struct _reent *, void *, _fpos_t, int);
+  int (*_close) (struct _reent *, void *);
 
   /* separate buffer for long sequences of ungetc() */
   struct __sbuf _ub;	/* ungetc buffer */
@@ -275,7 +275,7 @@ struct __sFILE64 {
   int   _flags2;        /* for future use */
 
   _off64_t _offset;     /* current lseek offset */
-  _fpos64_t _EXFNPTR(_seek64, (struct _reent *, void *, _fpos64_t, int));
+  _fpos64_t (*_seek64) (struct _reent *, void *, _fpos64_t, int);
 
 #ifndef __SINGLE_THREAD__
   _flock_t _lock;	/* for thread-safety locking */
@@ -391,7 +391,7 @@ struct _reent
 
   struct _mprec *_mp;
 
-  void _EXFNPTR(__cleanup, (struct _reent *));
+  void (*__cleanup) (struct _reent *);
 
   int _gamma_signgam;
 
@@ -584,7 +584,7 @@ struct _reent
 
   int __sdidinit;		/* 1 means stdio has been init'd */
 
-  void _EXFNPTR(__cleanup, (struct _reent *));
+  void (*__cleanup) (struct _reent *);
 
   /* used by mprec routines */
   struct _Bigint *_result;
diff --git a/newlib/libc/search/bsearch.c b/newlib/libc/search/bsearch.c
index 2f1dc9d77..29b787425 100644
--- a/newlib/libc/search/bsearch.c
+++ b/newlib/libc/search/bsearch.c
@@ -60,7 +60,7 @@ bsearch (const void *key,
 	const void *base,
 	size_t nmemb,
 	size_t size,
-	int _EXFNPTR(compar, (const void *, const void *)))
+	int (*compar) (const void *, const void *))
 {
   void *current;
   size_t lower = 0;
diff --git a/newlib/libc/stdio/fseeko.c b/newlib/libc/stdio/fseeko.c
index 7ca86161c..3e0f9e90b 100644
--- a/newlib/libc/stdio/fseeko.c
+++ b/newlib/libc/stdio/fseeko.c
@@ -98,7 +98,7 @@ _fseeko_r (struct _reent *ptr,
        _off_t offset,
        int whence)
 {
-  _fpos_t _EXFNPTR(seekfn, (struct _reent *, void *, _fpos_t, int));
+  _fpos_t (*seekfn) (struct _reent *, void *, _fpos_t, int);
   _fpos_t target;
   _fpos_t curoff = 0;
   size_t n;
diff --git a/newlib/libc/stdio64/fseeko64.c b/newlib/libc/stdio64/fseeko64.c
index 085855d4b..0672086a3 100644
--- a/newlib/libc/stdio64/fseeko64.c
+++ b/newlib/libc/stdio64/fseeko64.c
@@ -90,7 +90,7 @@ _fseeko64_r (struct _reent *ptr,
      _off64_t offset,
      int whence)
 {
-  _fpos64_t _EXFNPTR(seekfn, (struct _reent *, void *, _fpos64_t, int));
+  _fpos64_t (*seekfn) (struct _reent *, void *, _fpos64_t, int);
   _fpos64_t target, curoff;
   size_t n;
 
diff --git a/newlib/libc/stdlib/atexit.c b/newlib/libc/stdlib/atexit.c
index 1d300bd0f..63617f821 100644
--- a/newlib/libc/stdlib/atexit.c
+++ b/newlib/libc/stdlib/atexit.c
@@ -53,7 +53,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
  */
 
 int
-atexit (void _EXFNPTR(fn, (void)))
+atexit (void (*fn) (void))
 {
   return __register_exitproc (__et_atexit, fn, NULL, NULL);
 }
diff --git a/newlib/libc/stdlib/on_exit.c b/newlib/libc/stdlib/on_exit.c
index ce6bac68e..2eaf03564 100644
--- a/newlib/libc/stdlib/on_exit.c
+++ b/newlib/libc/stdlib/on_exit.c
@@ -66,7 +66,7 @@ const void * const __on_exit_dummy = &__on_exit_args;
  */
 
 int
-on_exit (void _EXFNPTR(fn, (int, void *)),
+on_exit (void (*fn) (int, void *),
         void *arg)
 {
   return __register_exitproc (__et_onexit, (void (*)(void)) fn, arg, NULL);
diff --git a/newlib/libc/xdr/xdr_private.h b/newlib/libc/xdr/xdr_private.h
index 2b4581866..3b071d668 100644
--- a/newlib/libc/xdr/xdr_private.h
+++ b/newlib/libc/xdr/xdr_private.h
@@ -41,7 +41,7 @@
 extern "C" {
 #endif
 
-typedef void _EXFNPTR (xdr_vprintf_t, (const char *, va_list));
+typedef void (*xdr_vprintf_t) (const char *, va_list);
 
 xdr_vprintf_t _EXFUN (xdr_set_vprintf, (xdr_vprintf_t));
 
diff --git a/newlib/libc/xdr/xdr_rec.c b/newlib/libc/xdr/xdr_rec.c
index f46a9a3fa..9051d522f 100644
--- a/newlib/libc/xdr/xdr_rec.c
+++ b/newlib/libc/xdr/xdr_rec.c
@@ -173,8 +173,8 @@ xdrrec_create (XDR * xdrs,
 	u_int sendsize,
 	u_int recvsize,
 	void *tcp_handle,
-        int _EXPARM (readit, (void *, void *, int)),
-        int _EXPARM (writeit, (void *, void *, int)))
+        int (*readit) (void *, void *, int),
+        int (*writeit) (void *, void *, int))
 {
   RECSTREAM *rstrm;
   /* Although sendsize and recvsize are u_int, we require
diff --git a/newlib/libc/xdr/xdr_sizeof.c b/newlib/libc/xdr/xdr_sizeof.c
index bf02cf5e7..e086d30e7 100644
--- a/newlib/libc/xdr/xdr_sizeof.c
+++ b/newlib/libc/xdr/xdr_sizeof.c
@@ -142,9 +142,9 @@ xdr_sizeof (xdrproc_t func,
   struct xdr_ops ops;
   bool_t stat;
   /* to stop ANSI-C compiler from complaining */
-  typedef bool_t _EXFNPTR (dummyfunc1, (XDR *, long *));
-  typedef bool_t _EXFNPTR (dummyfunc2, (XDR *, caddr_t, u_int));
-  typedef bool_t _EXFNPTR (dummyfunc3, (XDR *, int32_t *));
+  typedef bool_t (*dummyfunc1) (XDR *, long *);
+  typedef bool_t (*dummyfunc2) (XDR *, caddr_t, u_int);
+  typedef bool_t (*dummyfunc3) (XDR *, int32_t *);
 
   ops.x_putlong = x_putlong;
   ops.x_putbytes = x_putbytes;
-- 
2.15.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]