This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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

[patch] Zap some casts from remote.c


Hello,

I've just checked in the attatched.  remote.c was casting the result of
bfd_get_section_name().

	Andrew
2001-03-19  Andrew Cagney  <ac131313@redhat.com>

	* remote.c (remote_cisco_section_offsets): Do not cast result from
	bfd_get_section_name.
	(compare_sections_command): Ditto.
	(remote_cisco_section_offsets): Make ``p'' a const pointer.
	(compare_sections_command): Ditto for ``sectname''.

Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.41
diff -p -r1.41 remote.c
*** remote.c	2001/03/06 08:21:13	1.41
--- remote.c	2001/03/19 20:56:00
*************** remote_cisco_section_offsets (bfd_vma te
*** 1877,1883 ****
    asection *sect;
    bfd *abfd;
    int len;
-   char *p;
  
    if (symfile_objfile == NULL)
      return -1;			/* no can do nothin' */
--- 1877,1882 ----
*************** remote_cisco_section_offsets (bfd_vma te
*** 1894,1900 ****
         sect != 0;
         sect = sect->next)
      {
!       p = (unsigned char *) bfd_get_section_name (abfd, sect);
        len = strlen (p);
        if (strcmp (p + len - 4, "data") == 0)	/* ends in "data" */
  	if (data_base == 0 ||
--- 1893,1899 ----
         sect != 0;
         sect = sect->next)
      {
!       const char *p = bfd_get_section_name (abfd, sect);
        len = strlen (p);
        if (strcmp (p + len - 4, "data") == 0)	/* ends in "data" */
  	if (data_base == 0 ||
*************** compare_sections_command (char *args, in
*** 4574,4580 ****
    struct cleanup *old_chain;
    char *tmp;
    char *sectdata;
!   char *sectname;
    char *buf = alloca (PBUFSIZ);
    bfd_size_type size;
    bfd_vma lma;
--- 4573,4579 ----
    struct cleanup *old_chain;
    char *tmp;
    char *sectdata;
!   const char *sectname;
    char *buf = alloca (PBUFSIZ);
    bfd_size_type size;
    bfd_vma lma;
*************** compare_sections_command (char *args, in
*** 4596,4602 ****
        if (size == 0)
  	continue;		/* skip zero-length section */
  
!       sectname = (char *) bfd_get_section_name (exec_bfd, s);
        if (args && strcmp (args, sectname) != 0)
  	continue;		/* not the section selected by user */
  
--- 4595,4601 ----
        if (size == 0)
  	continue;		/* skip zero-length section */
  
!       sectname = bfd_get_section_name (exec_bfd, s);
        if (args && strcmp (args, sectname) != 0)
  	continue;		/* not the section selected by user */
  

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