* [patch] serial, mdebugread, top.c, utils, frame.c: remove unused variables
@ 2010-05-07 0:50 Michael Snyder
2010-05-08 21:12 ` Jan Kratochvil
0 siblings, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2010-05-07 0:50 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: tmp28.txt --]
[-- Type: text/plain, Size: 4597 bytes --]
2010-05-06 Michael Snyder <msnyder@vmware.com>
* serial.c (serial_for_fd): Delete unused variable.
* mdebugread.c (psymtab_to_symtab_1): Delete unused variable.
* top.c (execute_command): Delete unused variable.
(init_main): Delete unused variable.
* utils.c (do_fclose_cleanup): Delete unused variable.
(do_all_inferior_continuations): Delete unused variable.
(initialize_utils): Delete unused variable.
(internal_problem_mode): Delete unused global.
* frame.c (get_prev_frame): Delete unused global.
(get_frame_locals_address): Delete unused global.
(get_frame_args_address): Delete unused global.
Index: serial.c
===================================================================
RCS file: /cvs/src/src/gdb/serial.c,v
retrieving revision 1.36
diff -u -p -r1.36 serial.c
--- serial.c 26 Apr 2010 21:45:50 -0000 1.36
+++ serial.c 7 May 2010 00:46:45 -0000
@@ -247,7 +247,6 @@ struct serial *
serial_for_fd (int fd)
{
struct serial *scb;
- struct serial_ops *ops;
for (scb = scb_base; scb; scb = scb->next)
if (scb->fd == fd)
Index: mdebugread.c
===================================================================
RCS file: /cvs/src/src/gdb/mdebugread.c,v
retrieving revision 1.110
diff -u -p -r1.110 mdebugread.c
--- mdebugread.c 10 Mar 2010 18:27:00 -0000 1.110
+++ mdebugread.c 7 May 2010 00:46:45 -0000
@@ -4124,7 +4124,6 @@ psymtab_to_symtab_1 (struct partial_symt
{
/* This symbol table contains ordinary ecoff entries. */
- int f_max;
int maxlines;
EXTR *ext_ptr;
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.178
diff -u -p -r1.178 top.c
--- top.c 7 Apr 2010 16:54:39 -0000 1.178
+++ top.c 7 May 2010 00:46:46 -0000
@@ -360,7 +360,6 @@ execute_command (char *p, int from_tty)
#ifdef HAVE_SBRK
long space_at_cmd_start = 0;
#endif
- extern int display_time;
extern int display_space;
if (target_can_async_p ())
@@ -1516,8 +1515,6 @@ Notification of completion for asynchron
static void
init_main (void)
{
- struct cmd_list_element *c;
-
/* initialize the prompt stack to a simple "(gdb) " prompt or to
whatever the DEFAULT_PROMPT is. */
the_prompts.top = 0;
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.231
diff -u -p -r1.231 utils.c
--- utils.c 4 May 2010 21:09:25 -0000 1.231
+++ utils.c 7 May 2010 00:46:46 -0000
@@ -266,7 +266,6 @@ make_cleanup_close (int fd)
static void
do_fclose_cleanup (void *arg)
{
- FILE *file = arg;
fclose (arg);
}
@@ -553,7 +552,6 @@ add_inferior_continuation (void (*contin
void
do_all_inferior_continuations (void)
{
- struct cleanup *old_chain;
struct cleanup *as_cleanup;
struct inferior *inf = current_inferior ();
@@ -899,7 +897,6 @@ static const char *internal_problem_mode
internal_problem_no,
NULL
};
-static const char *internal_problem_mode = internal_problem_ask;
/* Print a message reporting an internal error/warning. Ask the user
if they want to continue, dump core, or just exit. Return
@@ -2823,8 +2820,6 @@ show_debug_timestamp (struct ui_file *fi
void
initialize_utils (void)
{
- struct cmd_list_element *c;
-
add_setshow_uinteger_cmd ("width", class_support, &chars_per_line, _("\
Set number of characters gdb thinks are in a line."), _("\
Show number of characters gdb thinks are in a line."), NULL,
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.280
diff -u -p -r1.280 frame.c
--- frame.c 16 Apr 2010 01:12:07 -0000 1.280
+++ frame.c 7 May 2010 00:46:46 -0000
@@ -1677,8 +1677,6 @@ inside_entry_func (struct frame_info *th
struct frame_info *
get_prev_frame (struct frame_info *this_frame)
{
- struct frame_info *prev_frame;
-
/* There is always a frame. If this assertion fails, suspect that
something should be calling get_selected_frame() or
get_current_frame(). */
@@ -1906,7 +1904,6 @@ get_frame_base_address (struct frame_inf
CORE_ADDR
get_frame_locals_address (struct frame_info *fi)
{
- void **cache;
if (get_frame_type (fi) != NORMAL_FRAME)
return 0;
/* If there isn't a frame address method, find it. */
@@ -1922,7 +1919,6 @@ get_frame_locals_address (struct frame_i
CORE_ADDR
get_frame_args_address (struct frame_info *fi)
{
- void **cache;
if (get_frame_type (fi) != NORMAL_FRAME)
return 0;
/* If there isn't a frame address method, find it. */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] serial, mdebugread, top.c, utils, frame.c: remove unused variables
2010-05-07 0:50 [patch] serial, mdebugread, top.c, utils, frame.c: remove unused variables Michael Snyder
@ 2010-05-08 21:12 ` Jan Kratochvil
2010-05-09 9:14 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2010-05-08 21:12 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
On Fri, 07 May 2010 02:50:22 +0200, Michael Snyder wrote:
> static void
> do_fclose_cleanup (void *arg)
> {
> - FILE *file = arg;
> fclose (arg);
> }
I believe the intentional was rather `fclose (file);' according to the general
GDB template of callback functions:
void
func (void *arg)
{
real_type *var = arg;
Use VAR having it type-checked callee prototypes or real_type changes.
}
But I understand it is a nitpick for never-changing FILE * and fclose.
Regards,
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] serial, mdebugread, top.c, utils, frame.c: remove unused variables
2010-05-08 21:12 ` Jan Kratochvil
@ 2010-05-09 9:14 ` Joel Brobecker
2010-05-10 17:26 ` Michael Snyder
0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2010-05-09 9:14 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: Michael Snyder, gdb-patches
> > static void
> > do_fclose_cleanup (void *arg)
> > {
> > - FILE *file = arg;
> > fclose (arg);
> > }
>
> I believe the intentional was rather `fclose (file);' according to the general
> GDB template of callback functions:
Good catch, Jan.
> void
> func (void *arg)
> {
> real_type *var = arg;
>
> Use VAR having it type-checked callee prototypes or real_type changes.
> }
>
> But I understand it is a nitpick for never-changing FILE * and fclose.
I think it's still important that we follow that paradigm (IMO).
It makes the code clearer.
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] serial, mdebugread, top.c, utils, frame.c: remove unused variables
2010-05-09 9:14 ` Joel Brobecker
@ 2010-05-10 17:26 ` Michael Snyder
0 siblings, 0 replies; 4+ messages in thread
From: Michael Snyder @ 2010-05-10 17:26 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Jan Kratochvil, gdb-patches
Joel Brobecker wrote:
>>> static void
>>> do_fclose_cleanup (void *arg)
>>> {
>>> - FILE *file = arg;
>>> fclose (arg);
>>> }
>> I believe the intentional was rather `fclose (file);' according to the general
>> GDB template of callback functions:
>
> Good catch, Jan.
>
>> void
>> func (void *arg)
>> {
>> real_type *var = arg;
>>
>> Use VAR having it type-checked callee prototypes or real_type changes.
>> }
>>
>> But I understand it is a nitpick for never-changing FILE * and fclose.
>
> I think it's still important that we follow that paradigm (IMO).
> It makes the code clearer.
>
OK, restored as:
2010-05-10 Michael Snyder <msnyder@vmware.com>
* utils.c (do_fclose_cleanup) Restore local variable.
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.232
diff -u -p -r1.232 utils.c
--- utils.c 7 May 2010 00:47:37 -0000 1.232
+++ utils.c 10 May 2010 17:24:40 -0000
@@ -266,7 +266,8 @@ make_cleanup_close (int fd)
static void
do_fclose_cleanup (void *arg)
{
- fclose (arg);
+ FILE *file = arg;
+ fclose (file);
}
/* Return a new cleanup that closes FILE. */
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-10 17:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-07 0:50 [patch] serial, mdebugread, top.c, utils, frame.c: remove unused variables Michael Snyder
2010-05-08 21:12 ` Jan Kratochvil
2010-05-09 9:14 ` Joel Brobecker
2010-05-10 17:26 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox