Re: [PATCH] Remove support for pre-C89

2009-11-13 Thread Dmitry V. Levin
On Fri, Nov 06, 2009 at 08:48:55PM +0300, Dmitry V. Levin wrote:
 On Wed, Oct 28, 2009 at 02:45:26PM +0300, Dmitry V. Levin wrote:
  On Tue, Oct 27, 2009 at 04:59:24PM +0100, Andreas Schwab wrote:
  [..]
   * defs.h: Remove references to __STDC__ and P macros.
   * strace.c: Likewise.
  
  I'm OK for removing this junk, but please be consistent and use the same
  formatting style.
 
 I mean smth like this:

I'll push it if there are no objections.


-- 
ldv


pgpBJbFp10rfh.pgp
Description: PGP signature
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH] Remove support for pre-C89

2009-10-28 Thread Dmitry V. Levin
On Tue, Oct 27, 2009 at 04:59:24PM +0100, Andreas Schwab wrote:
[..]
 * defs.h: Remove references to __STDC__ and P macros.
 * strace.c: Likewise.

I'm OK for removing this junk, but please be consistent and use the same
formatting style.  For example,

[...]
 @@ -158,15 +158,11 @@
  #include asm/ptrace.h
  #undef __KERNEL__
  #endif
 -#ifdef __STDC__
  #ifdef LINUX
  extern long ptrace(int, int, char *, long);
  #else /* !LINUX */
  extern int ptrace(int, int, char *, int, ...);
  #endif /* !LINUX */
 -#else /* !__STDC__ */
 -extern int ptrace();
 -#endif /* !__STDC__ */
  #endif /* !LINUXSPARC */
  #endif /* !SVR4 */

if we didn't put space after function names here,

[...]
 -extern int set_personality P((int personality));
 -extern const char *xlookup P((const struct xlat *, int));
 -extern struct tcb *alloc_tcb P((int, int));
 -extern struct tcb *pid2tcb P((int));
 -extern void droptcb P((struct tcb *));
 -extern void expand_tcbtab P((void));
 +extern int set_personality (int personality);
 +extern const char *xlookup (const struct xlat *, int);
 +extern struct tcb *alloc_tcb (int, int);
 +extern struct tcb *pid2tcb (int);
 +extern void droptcb (struct tcb *);
 +extern void expand_tcbtab (void);

why we put them here?


-- 
ldv


pgpQ2LoyvAgKd.pgp
Description: PGP signature
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[PATCH] Remove support for pre-C89

2009-10-27 Thread Andreas Schwab
From 4af0b4866c0caeeb7b40126e9579d04b14afd5f2 Mon Sep 17 00:00:00 2001
From: Andreas Schwab sch...@redhat.com
Date: Tue, 27 Oct 2009 16:56:43 +0100
Subject: [PATCH] Remove support for pre-C89

* defs.h: Remove references to __STDC__ and P macros.
* strace.c: Likewise.
---
 defs.h   |  186 +-
 strace.c |   36 +++-
 2 files changed, 96 insertions(+), 126 deletions(-)

diff --git a/defs.h b/defs.h
index 5bcaa07..6376e79 100644
--- a/defs.h
+++ b/defs.h
@@ -158,15 +158,11 @@
 #include asm/ptrace.h
 #undef __KERNEL__
 #endif
-#ifdef __STDC__
 #ifdef LINUX
 extern long ptrace(int, int, char *, long);
 #else /* !LINUX */
 extern int ptrace(int, int, char *, int, ...);
 #endif /* !LINUX */
-#else /* !__STDC__ */
-extern int ptrace();
-#endif /* !__STDC__ */
 #endif /* !LINUXSPARC */
 #endif /* !SVR4 */
 
@@ -469,112 +465,106 @@ extern unsigned int nprocs, tcbtabsize;
 extern int max_strlen;
 extern struct tcb *tcp_last;
 
-#ifdef __STDC__
-#define P(args) args
-#else
-#define P(args) ()
-#endif
-
 enum bitness_t { BITNESS_CURRENT = 0, BITNESS_32 };
 
-extern int set_personality P((int personality));
-extern const char *xlookup P((const struct xlat *, int));
-extern struct tcb *alloc_tcb P((int, int));
-extern struct tcb *pid2tcb P((int));
-extern void droptcb P((struct tcb *));
-extern void expand_tcbtab P((void));
+extern int set_personality (int personality);
+extern const char *xlookup (const struct xlat *, int);
+extern struct tcb *alloc_tcb (int, int);
+extern struct tcb *pid2tcb (int);
+extern void droptcb (struct tcb *);
+extern void expand_tcbtab (void);
 
 #define alloctcb(pid)  alloc_tcb((pid), 1)
 
-extern void set_sortby P((char *));
-extern void set_overhead P((int));
-extern void qualify P((char *));
-extern int get_scno P((struct tcb *));
-extern long known_scno P((struct tcb *));
-extern long do_ptrace P((int request, struct tcb *tcp, void *addr, void 
*data));
-extern int ptrace_restart P((int request, struct tcb *tcp, int sig));
-extern int trace_syscall P((struct tcb *));
-extern int count_syscall P((struct tcb *, struct timeval *));
-extern void printxval P((const struct xlat *, int, const char *));
-extern int printargs P((struct tcb *));
-extern int addflags P((const struct xlat *, int));
-extern int printflags P((const struct xlat *, int, const char *));
-extern const char *sprintflags P((const char *, const struct xlat *, int));
-extern int umoven P((struct tcb *, long, int, char *));
-extern int umovestr P((struct tcb *, long, int, char *));
-extern int upeek P((struct tcb *, long, long *));
-extern void dumpiov P((struct tcb *, int, long));
-extern void dumpstr P((struct tcb *, long, int));
-extern void printstr P((struct tcb *, long, int));
-extern void printnum P((struct tcb *, long, char *));
-extern void printnum_int P((struct tcb *, long, char *));
-extern void printpath P((struct tcb *, long));
-extern void printpathn P((struct tcb *, long, int));
-extern void printtv_bitness P((struct tcb *, long, enum bitness_t, int));
-extern void sprinttv P((struct tcb *, long, enum bitness_t, char *));
-extern void print_timespec P((struct tcb *, long));
-extern void sprint_timespec P((char *, struct tcb *, long));
+extern void set_sortby (char *);
+extern void set_overhead (int);
+extern void qualify (char *);
+extern int get_scno (struct tcb *);
+extern long known_scno (struct tcb *);
+extern long do_ptrace (int request, struct tcb *tcp, void *addr, void *data);
+extern int ptrace_restart (int request, struct tcb *tcp, int sig);
+extern int trace_syscall (struct tcb *);
+extern int count_syscall (struct tcb *, struct timeval *);
+extern void printxval (const struct xlat *, int, const char *);
+extern int printargs (struct tcb *);
+extern int addflags (const struct xlat *, int);
+extern int printflags (const struct xlat *, int, const char *);
+extern const char *sprintflags (const char *, const struct xlat *, int);
+extern int umoven (struct tcb *, long, int, char *);
+extern int umovestr (struct tcb *, long, int, char *);
+extern int upeek (struct tcb *, long, long *);
+extern void dumpiov (struct tcb *, int, long);
+extern void dumpstr (struct tcb *, long, int);
+extern void printstr (struct tcb *, long, int);
+extern void printnum (struct tcb *, long, char *);
+extern void printnum_int (struct tcb *, long, char *);
+extern void printpath (struct tcb *, long);
+extern void printpathn (struct tcb *, long, int);
+extern void printtv_bitness (struct tcb *, long, enum bitness_t, int);
+extern void sprinttv (struct tcb *, long, enum bitness_t, char *);
+extern void print_timespec (struct tcb *, long);
+extern void sprint_timespec (char *, struct tcb *, long);
 #ifdef HAVE_SIGINFO_T
-extern void printsiginfo P((siginfo_t *, int));
-#endif
-extern void printsock P((struct tcb *, long, int));
-extern void print_sock_optmgmt P((struct tcb *, long, int));
-extern void printrusage P((struct tcb *, long));
-extern void printuid P