[RFA-v2] Fix ARI warning about function call in first column

Pierre Muller
2011-03-14T16:03:39Z

> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé : lundi 14 mars 2011 15:49
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA] Fix ARI warning about function call in first column
>
> >>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
> writes:
>
> Pierre> This second patch fixes:
> >> gdb/hppa-tdep.h:244: code: function call in first column: Function
> name in
> Pierre> first column should be restricted to function implementation
> Pierre> gdb/hppa-tdep.h:244:hppa_init_objfile_priv_data (struct objfile
> *objfile);
> Pierre> and other occurrences of same new warning.
>
> This is ok. Thanks for doing this.

As Eli had some concerns about that part,
I tried to change my patch so that it does add new
function declarations split in between return type and
function name.

Eli, this still leaves us with two
cases for which we either have
TYPE
NAME (PARAMS);
or
TYPE NAME (PARAMS);
with a single line that exceeds 80 columns.

I didn't really understand your comment about
automatic indenting by emacs because I never used emacs :(
As the 37 already existing cases suggest,
this couldn't have worked correctly even before my patch, no?

If you really prefer and others also agree,
I can submit a variant with single lines...

Pierre

2011-03-14 Pierre Muller <muller@ics.u-strasbg.fr>

Fix ARI warning about function names in first column.
Put prototype declaration on same line as return type.
* objc-exp.y: Ditto.
* p-exp.y: Ditto.
For long function names, indent prototype declarations to avoid
function name in first column.
* hppa-tdep.h: Ditto.
* inferior.h: Ditto.
* solib-pa64.c: Ditto.
* varobj.c: Ditto.
* varobj.h: Ditto.
* python/py-stopevent.h: Ditto.

Index: hppa-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.h,v
retrieving revision 1.41
diff -u -p -r1.41 hppa-tdep.h
--- hppa-tdep.h 9 Jan 2011 03:08:55 -0000 1.41
+++ hppa-tdep.h 14 Mar 2011 15:57:30 -0000
@@ -241,7 +241,7 @@ extern struct minimal_symbol *
enum unwind_stub_types stub_type);

extern struct hppa_objfile_private *
-hppa_init_objfile_priv_data (struct objfile *objfile);
+ hppa_init_objfile_priv_data (struct objfile *objfile);

extern int hppa_in_solib_call_trampoline (struct gdbarch *gdbarch,
CORE_ADDR pc, char *name);
Index: inferior.h
===================================================================
RCS file: /cvs/src/src/gdb/inferior.h,v
retrieving revision 1.152
diff -u -p -r1.152 inferior.h
--- inferior.h 26 Feb 2011 02:07:08 -0000 1.152
+++ inferior.h 14 Mar 2011 15:57:30 -0000
@@ -367,7 +367,7 @@ void displaced_step_dump_bytes (struct u
const gdb_byte *buf, size_t len);

struct displaced_step_closure*
-get_displaced_step_closure_by_addr (CORE_ADDR addr);
+ get_displaced_step_closure_by_addr (CORE_ADDR addr);

/* Possible values for gdbarch_call_dummy_location. */
#define ON_STACK 1
Index: objc-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/objc-exp.y,v
retrieving revision 1.42
diff -u -p -r1.42 objc-exp.y
--- objc-exp.y 14 Mar 2011 15:43:50 -0000 1.42
+++ objc-exp.y 14 Mar 2011 15:57:30 -0000
@@ -107,14 +107,11 @@
#define YYDEBUG 0 /* Default to no yydebug support.
*/
#endif

-int
-yyparse (void);
+int yyparse (void);

-static int
-yylex (void);
+static int yylex (void);

-void
-yyerror (char *);
+void yyerror (char *);

%}

@@ -150,8 +147,7 @@ yyerror (char *);

%{
/* YYSTYPE gets defined by %union. */
-static int
-parse_number (char *, int, int, YYSTYPE *);
+static int parse_number (char *, int, int, YYSTYPE *);
%}

%type <voidval> exp exp1 type_exp start variable qualified_name lcurly
Index: p-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/p-exp.y,v
retrieving revision 1.55
diff -u -p -r1.55 p-exp.y
--- p-exp.y 14 Mar 2011 15:43:50 -0000 1.55
+++ p-exp.y 14 Mar 2011 15:57:30 -0000
@@ -117,8 +117,7 @@ int yyparse (void);

static int yylex (void);

-void
-yyerror (char *);
+void yyerror (char *);

static char * uptok (char *, int);
%}
@@ -154,8 +153,7 @@ static char * uptok (char *, int);

%{
/* YYSTYPE gets defined by %union */
-static int
-parse_number (char *, int, int, YYSTYPE *);
+static int parse_number (char *, int, int, YYSTYPE *);

static struct type *current_type;
static struct internalvar *intvar;
Index: solib-pa64.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-pa64.c,v
retrieving revision 1.29
diff -u -p -r1.29 solib-pa64.c
--- solib-pa64.c 11 Jan 2011 21:53:24 -0000 1.29
+++ solib-pa64.c 14 Mar 2011 15:57:30 -0000
@@ -76,8 +76,8 @@ dld_cache_t;

static dld_cache_t dld_cache;

-static int
-read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p);
+static int read_dynamic_info (asection *dyninfo_sect,
+ dld_cache_t *dld_cache_p);

static void
pa64_relocate_section_addresses (struct so_list *so,
Index: varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/varobj.c,v
retrieving revision 1.172
diff -u -p -r1.172 varobj.c
--- varobj.c 5 Mar 2011 22:02:47 -0000 1.172
+++ varobj.c 14 Mar 2011 15:57:31 -0000
@@ -296,8 +296,9 @@ static int is_root_p (struct varobj *var

#if HAVE_PYTHON

-static struct varobj *
-varobj_add_child (struct varobj *var, const char *name, struct value
*value);
+static struct varobj * varobj_add_child (struct varobj *var,
+ const char *name,
+ struct value *value);

#endif /* HAVE_PYTHON */

Index: varobj.h
===================================================================
RCS file: /cvs/src/src/gdb/varobj.h,v
retrieving revision 1.27
diff -u -p -r1.27 varobj.h
--- varobj.h 12 Jan 2011 01:23:29 -0000 1.27
+++ varobj.h 14 Mar 2011 15:57:31 -0000
@@ -167,8 +167,8 @@ extern int varobj_editable_p (struct var

extern int varobj_floating_p (struct varobj *var);

-extern void
-varobj_set_visualizer (struct varobj *var, const char *visualizer);
+extern void varobj_set_visualizer (struct varobj *var,
+ const char *visualizer);

extern void varobj_enable_pretty_printing (void);

Index: python/py-stopevent.h
===================================================================
RCS file: /cvs/src/src/gdb/python/py-stopevent.h,v
retrieving revision 1.1
diff -u -p -r1.1 py-stopevent.h
--- python/py-stopevent.h 5 Feb 2011 05:27:23 -0000 1.1
+++ python/py-stopevent.h 14 Mar 2011 15:57:31 -0000
@@ -28,10 +28,8 @@ extern void stop_evpy_dealloc (PyObject
extern int emit_stop_event (struct bpstats *bs,
enum target_signal stop_signal);

-extern PyObject *
-create_breakpoint_event_object (PyObject *breakpoint);
+extern PyObject * create_breakpoint_event_object (PyObject *breakpoint);

-extern PyObject *
-create_signal_event_object (enum target_signal stop_signal);
+extern PyObject * create_signal_event_object (enum target_signal
stop_signal);

#endif /* GDB_PY_STOPEVENT_H */