This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [ARI] Remove all editCase warnings
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Pedro Alves'" <pedro at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 5 May 2010 18:09:32 +0200
- Subject: RE: [ARI] Remove all editCase warnings
- References: <005b01caebe1$2183b890$648b29b0$@muller@ics-cnrs.unistra.fr> <201005050044.28991.pedro@codesourcery.com> <000901caec31$d109e640$731db2c0$@muller@ics-cnrs.unistra.fr> <201005051611.09790.pedro@codesourcery.com>
After the feedback I got,
here is a second version of this ARI patch.
Only three functions are lowercase, the
other ones get an ugly /* ARI: editCase function */
comment.
I have to split some function declarations
into more lines to avoid getting above the 80 char
line length limit.
Is this OK?
Pierre Muller
as ARI maintainer
2010-05-05 Pierre Muller <muller@ics.u-strasbg.fr>
ARI: Fix editCase function rule warnings.
* ada-lang.c (ada_remove_Xbn_suffix): Add ARI comment for editCase.
* addrmap.c (splay_compare_CORE_ADDR_ptr): Rename to...
(splay_compare_core_addr_ptr): ...this.
(addrmap_create_mutable): Adapt to name change above.
* hppa-tdep.c (hppa_extract_5R_store): Add ARI comment for editCase.
* ia64-tdep.c (slotN_contents): Add ARI comment for editCase.
(replace_slotN_contents): Likewise.
* procfs.c (proc_get_LDT_entry): Rename to...
(proc_get_ldt_entry): ...this.
(procfs_find_LDT_entry): Rename to...
(procfs_find_ldt_entry): ...this.
* remote.c (set_remote_protocol_Z_packet_cmd): Add ARI comment for
editCase.
(show_remote_protocol_Z_packet_cmd): Likewise.
(store_register_using_P): Likewise.
(store_register_using_G): Likewise.
(watchpoint_to_Z_packet): Likewise.
* sol-thread.c (ps_lgetLDT): Add ARI comment for editCase.
* windows-nat.c (bad_DebugActiveProcessStop): Add ARI comment for
editCase.
(bad_DebugBreakProcess): Likewise.
(bad_DebugSetProcessKillOnExit): Likewise.
(bad_EnumProcessModules): Likewise.
(bad_GetModuleFileNameExW): Likewise.
(bad_GetModuleFileNameExA): Likewise.
(bad_GetModuleInformation): Likewise.
(bad_OpenProcessToken): Likewise.
Index: src/gdb/ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.258
diff -u -p -r1.258 ada-lang.c
--- src/gdb/ada-lang.c 2 May 2010 21:14:59 -0000 1.258
+++ src/gdb/ada-lang.c 5 May 2010 15:42:06 -0000
@@ -855,7 +855,8 @@ ada_remove_po_subprogram_suffix (const c
/* Remove trailing X[bn]* suffixes (indicating names in package bodies).
*/
static void
-ada_remove_Xbn_suffix (const char *encoded, int *len)
+ada_remove_Xbn_suffix ( /* ARI: editCase function */
+ const char *encoded, int *len)
{
int i = *len - 1;
Index: src/gdb/addrmap.c
===================================================================
RCS file: /cvs/src/src/gdb/addrmap.c,v
retrieving revision 1.7
diff -u -p -r1.7 addrmap.c
--- src/gdb/addrmap.c 1 Jan 2010 07:31:29 -0000 1.7
+++ src/gdb/addrmap.c 5 May 2010 15:42:06 -0000
@@ -491,7 +491,7 @@ splay_obstack_free (void *obj, void *clo
/* Compare keys as CORE_ADDR * values. */
static int
-splay_compare_CORE_ADDR_ptr (splay_tree_key ak, splay_tree_key bk)
+splay_compare_core_addr_ptr (splay_tree_key ak, splay_tree_key bk)
{
CORE_ADDR a = * (CORE_ADDR *) ak;
CORE_ADDR b = * (CORE_ADDR *) bk;
@@ -519,7 +519,7 @@ addrmap_create_mutable (struct obstack *
free list has to be initialized before we create the tree. */
map->free_nodes = NULL;
- map->tree = splay_tree_new_with_allocator (splay_compare_CORE_ADDR_ptr,
+ map->tree = splay_tree_new_with_allocator (splay_compare_core_addr_ptr,
NULL, /* no delete key */
NULL, /* no delete value */
splay_obstack_alloc,
Index: src/gdb/hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.273
diff -u -p -r1.273 hppa-tdep.c
--- src/gdb/hppa-tdep.c 19 Jan 2010 09:39:12 -0000 1.273
+++ src/gdb/hppa-tdep.c 5 May 2010 15:42:07 -0000
@@ -115,7 +115,7 @@ hppa_extract_5r_store (unsigned word)
/* extract the immediate field from a {sr}sm instruction */
unsigned
-hppa_extract_5R_store (unsigned word)
+hppa_extract_5R_store (unsigned word) /* ARI: editCase function */
{
return (word >> 16 & MASK_5);
}
Index: src/gdb/ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.205
diff -u -p -r1.205 ia64-tdep.c
--- src/gdb/ia64-tdep.c 1 Jan 2010 07:31:36 -0000 1.205
+++ src/gdb/ia64-tdep.c 5 May 2010 15:42:08 -0000
@@ -447,7 +447,7 @@ replace_bit_field (char *bundle, long lo
and instruction bundle */
static long long
-slotN_contents (char *bundle, int slotnum)
+slotN_contents (char *bundle, int slotnum) /* ARI: editCase function */
{
return extract_bit_field (bundle, 5+41*slotnum, 41);
}
@@ -455,7 +455,8 @@ slotN_contents (char *bundle, int slotnu
/* Store an instruction in an instruction bundle */
static void
-replace_slotN_contents (char *bundle, long long instr, int slotnum)
+replace_slotN_contents (char *bundle, /* ARI: editCase function */
+ long long instr, int slotnum)
{
replace_bit_field (bundle, instr, 5+41*slotnum, 41);
}
Index: src/gdb/procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.131
diff -u -p -r1.131 procfs.c
--- src/gdb/procfs.c 20 Apr 2010 22:36:35 -0000 1.131
+++ src/gdb/procfs.c 5 May 2010 15:42:09 -0000
@@ -2974,7 +2974,7 @@ proc_set_watchpoint (procinfo *pi, CORE_
#include <sys/sysi86.h>
/*
- * Function: proc_get_LDT_entry
+ * Function: proc_get_ldt_entry
*
* Inputs:
* procinfo *pi;
@@ -2987,7 +2987,7 @@ proc_set_watchpoint (procinfo *pi, CORE_
*/
struct ssd *
-proc_get_LDT_entry (procinfo *pi, int key)
+proc_get_ldt_entry (procinfo *pi, int key)
{
static struct ssd *ldt_entry = NULL;
#ifdef NEW_PROC_API
@@ -3004,7 +3004,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
sprintf (pathname, "/proc/%d/ldt", pi->pid);
if ((fd = open_with_retry (pathname, O_RDONLY)) < 0)
{
- proc_warn (pi, "proc_get_LDT_entry (open)", __LINE__);
+ proc_warn (pi, "proc_get_ldt_entry (open)", __LINE__);
return NULL;
}
/* Make sure it gets closed again! */
@@ -3031,7 +3031,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
/* Get the number of LDT entries. */
if (ioctl (pi->ctl_fd, PIOCNLDT, &nldt) < 0)
{
- proc_warn (pi, "proc_get_LDT_entry (PIOCNLDT)", __LINE__);
+ proc_warn (pi, "proc_get_ldt_entry (PIOCNLDT)", __LINE__);
return NULL;
}
@@ -3047,7 +3047,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
/* Read the whole table in one gulp. */
if (ioctl (pi->ctl_fd, PIOCLDT, ldt_entry) < 0)
{
- proc_warn (pi, "proc_get_LDT_entry (PIOCLDT)", __LINE__);
+ proc_warn (pi, "proc_get_ldt_entry (PIOCLDT)", __LINE__);
return NULL;
}
@@ -3062,7 +3062,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
}
/*
- * Function: procfs_find_LDT_entry
+ * Function: procfs_find_ldt_entry
*
* Input:
* ptid_t ptid; // The GDB-style pid-plus-LWP.
@@ -3072,7 +3072,7 @@ proc_get_LDT_entry (procinfo *pi, int ke
*/
struct ssd *
-procfs_find_LDT_entry (ptid_t ptid)
+procfs_find_ldt_entry (ptid_t ptid)
{
gdb_gregset_t *gregs;
int key;
@@ -3081,14 +3081,14 @@ procfs_find_LDT_entry (ptid_t ptid)
/* Find procinfo for the lwp. */
if ((pi = find_procinfo (PIDGET (ptid), TIDGET (ptid))) == NULL)
{
- warning (_("procfs_find_LDT_entry: could not find procinfo for
%d:%ld."),
+ warning (_("procfs_find_ldt_entry: could not find procinfo for
%d:%ld."),
PIDGET (ptid), TIDGET (ptid));
return NULL;
}
/* get its general registers. */
if ((gregs = proc_get_gregs (pi)) == NULL)
{
- warning (_("procfs_find_LDT_entry: could not read gregs for
%d:%ld."),
+ warning (_("procfs_find_ldt_entry: could not read gregs for
%d:%ld."),
PIDGET (ptid), TIDGET (ptid));
return NULL;
}
@@ -3096,7 +3096,7 @@ procfs_find_LDT_entry (ptid_t ptid)
key = (*gregs)[GS] & 0xffff;
/* Find the matching entry and return it. */
- return proc_get_LDT_entry (pi, key);
+ return proc_get_ldt_entry (pi, key);
}
#endif
Index: src/gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.405
diff -u -p -r1.405 remote.c
--- src/gdb/remote.c 5 May 2010 15:05:57 -0000 1.405
+++ src/gdb/remote.c 5 May 2010 15:42:11 -0000
@@ -1217,8 +1217,8 @@ enum Z_packet_type
static enum auto_boolean remote_Z_packet_detect;
static void
-set_remote_protocol_Z_packet_cmd (char *args, int from_tty,
- struct cmd_list_element *c)
+set_remote_protocol_Z_packet_cmd (char *args, /* ARI: editCase function */
+ int from_tty, struct cmd_list_element *c)
{
int i;
for (i = 0; i < NR_Z_PACKET_TYPES; i++)
@@ -1229,7 +1229,8 @@ set_remote_protocol_Z_packet_cmd (char *
}
static void
-show_remote_protocol_Z_packet_cmd (struct ui_file *file, int from_tty,
+show_remote_protocol_Z_packet_cmd (/* ARI: editCase function */
+ struct ui_file *file, int from_tty,
struct cmd_list_element *c,
const char *value)
{
@@ -5612,7 +5613,8 @@ remote_prepare_to_store (struct regcache
packet was not recognized. */
static int
-store_register_using_P (const struct regcache *regcache,
+store_register_using_P ( /* ARI: editCase function */
+ const struct regcache *regcache,
struct packet_reg *reg)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
@@ -5653,7 +5655,8 @@ store_register_using_P (const struct reg
contents of the register cache buffer. FIXME: ignores errors. */
static void
-store_registers_using_G (const struct regcache *regcache)
+store_registers_using_G ( /* ARI: editCase function */
+ const struct regcache *regcache)
{
struct remote_state *rs = get_remote_state ();
struct remote_arch_state *rsa = get_remote_arch_state ();
@@ -7387,7 +7390,7 @@ remote_remove_breakpoint (struct gdbarch
}
static int
-watchpoint_to_Z_packet (int type)
+watchpoint_to_Z_packet (int type) /* ARI: editCase function */
{
switch (type)
{
Index: src/gdb/sol-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/sol-thread.c,v
retrieving revision 1.78
diff -u -p -r1.78 sol-thread.c
--- src/gdb/sol-thread.c 1 Jan 2010 07:31:41 -0000 1.78
+++ src/gdb/sol-thread.c 5 May 2010 15:42:11 -0000
@@ -1107,11 +1107,11 @@ ps_pdmodel (gdb_ps_prochandle_t ph, int
of libthread_db would fail because of ps_lgetLDT being undefined. */
ps_err_e
-ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid,
+ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid, /* ARI: editCase
function */
struct ssd *pldt)
{
/* NOTE: only used on Solaris, therefore OK to refer to procfs.c. */
- extern struct ssd *procfs_find_LDT_entry (ptid_t);
+ extern struct ssd *procfs_find_ldt_entry (ptid_t);
struct ssd *ret;
/* FIXME: can't I get the process ID from the prochandle or
@@ -1120,7 +1120,7 @@ ps_lgetLDT (gdb_ps_prochandle_t ph, lwpi
if (PIDGET (inferior_ptid) <= 0 || lwpid <= 0)
return PS_BADLID;
- ret = procfs_find_LDT_entry (BUILD_LWP (lwpid, PIDGET (inferior_ptid)));
+ ret = procfs_find_ldt_entry (BUILD_LWP (lwpid, PIDGET (inferior_ptid)));
if (ret)
{
memcpy (pldt, ret, sizeof (struct ssd));
Index: src/gdb/windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.208
diff -u -p -r1.208 windows-nat.c
--- src/gdb/windows-nat.c 16 Apr 2010 07:49:35 -0000 1.208
+++ src/gdb/windows-nat.c 5 May 2010 15:42:12 -0000
@@ -2522,50 +2522,57 @@ _initialize_check_for_gdb_ini (void)
}
/* Define dummy functions which always return error for the rare cases
where
- these functions could not be found. */
+ these functions could not be found.
+ Those functions mix upper and lowercase characters as they follow
+ the name in the windows API.
+ We use ARI comment to avoid a warining on A.R.I. page. */
static BOOL WINAPI
-bad_DebugActiveProcessStop (DWORD w)
+bad_DebugActiveProcessStop (DWORD w) /* ARI: editCase function */
{
return FALSE;
}
static BOOL WINAPI
-bad_DebugBreakProcess (HANDLE w)
+bad_DebugBreakProcess (HANDLE w) /* ARI: editCase function */
{
return FALSE;
}
static BOOL WINAPI
-bad_DebugSetProcessKillOnExit (BOOL w)
+bad_DebugSetProcessKillOnExit (BOOL w) /* ARI: editCase function */
{
return FALSE;
}
static BOOL WINAPI
-bad_EnumProcessModules (HANDLE w, HMODULE *x, DWORD y, LPDWORD z)
+bad_EnumProcessModules (HANDLE w, /* ARI: editCase function */
+ HMODULE *x, DWORD y, LPDWORD z)
{
return FALSE;
}
#ifdef __USEWIDE
static DWORD WINAPI
-bad_GetModuleFileNameExW (HANDLE w, HMODULE x, LPWSTR y, DWORD z)
+bad_GetModuleFileNameExW (HANDLE w, /* ARI: editCase function */
+ HMODULE x, LPWSTR y, DWORD z)
{
return 0;
}
#else
static DWORD WINAPI
-bad_GetModuleFileNameExA (HANDLE w, HMODULE x, LPSTR y, DWORD z)
+bad_GetModuleFileNameExA (HANDLE w, /* ARI: editCase function */
+ HMODULE x, LPSTR y, DWORD z)
{
return 0;
}
#endif
static BOOL WINAPI
-bad_GetModuleInformation (HANDLE w, HMODULE x, LPMODULEINFO y, DWORD z)
+bad_GetModuleInformation (HANDLE w, /* ARI: editCase function */
+ HMODULE x, LPMODULEINFO y, DWORD z)
{
return FALSE;
}
static BOOL WINAPI
-bad_OpenProcessToken (HANDLE w, DWORD x, PHANDLE y)
+bad_OpenProcessToken (HANDLE w, DWORD x, PHANDLE y) /* ARI: editCase
function */
{
return FALSE;
}