This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

[rfa] Change lbasename() to return ``const char *''


Hello,

The attached patch changes the liberty function lbasename() so that it 
returns ``const char *''.

Ok?  I think I've updated/fixed all uses to reflect this.

	Andrew
Index: include/ChangeLog
2001-06-13  Andrew Cagney  <ac131313@redhat.com>

	* libiberty.h (lbasename): Change function declaration to return a
	const char pointer.

Index: libiberty/ChangeLog
2001-06-13  Andrew Cagney  <ac131313@redhat.com>

	* lbasename.c (lbasename): Change function definition to return a
	const char pointer.

Index: include/libiberty.h
===================================================================
RCS file: /cvs/gcc/gcc/include/libiberty.h,v
retrieving revision 1.18
diff -p -r1.18 libiberty.h
*** libiberty.h	2001/03/31 18:59:56	1.18
--- libiberty.h	2001/08/08 00:59:19
*************** extern char *basename ();
*** 83,89 ****
  
  /* A well-defined basename () that is always compiled in.  */
  
! extern char *lbasename PARAMS ((const char *));
  
  /* Concatenate an arbitrary number of strings, up to (char *) NULL.
     Allocates memory using xmalloc.  */
--- 83,89 ----
  
  /* A well-defined basename () that is always compiled in.  */
  
! extern const char *lbasename PARAMS ((const char *));
  
  /* Concatenate an arbitrary number of strings, up to (char *) NULL.
     Allocates memory using xmalloc.  */
Index: libiberty/lbasename.c
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/lbasename.c,v
retrieving revision 1.1
diff -p -r1.1 lbasename.c
*** lbasename.c	2001/03/10 10:41:24	1.1
--- lbasename.c	2001/08/08 00:59:20
*************** NAME
*** 23,29 ****
  	lbasename -- return pointer to last component of a pathname
  
  SYNOPSIS
! 	char *lbasename (const char *name)
  
  DESCRIPTION
  	Given a pointer to a string containing a typical pathname
--- 23,29 ----
  	lbasename -- return pointer to last component of a pathname
  
  SYNOPSIS
! 	const char *lbasename (const char *name)
  
  DESCRIPTION
  	Given a pointer to a string containing a typical pathname
*************** DESCRIPTION
*** 69,75 ****
  #  endif
  #endif
  
! char *
  lbasename (name)
       const char *name;
  {
--- 69,75 ----
  #  endif
  #endif
  
! const char *
  lbasename (name)
       const char *name;
  {
*************** lbasename (name)
*** 85,89 ****
      if (IS_DIR_SEPARATOR (*name))
        base = name + 1;
  
!   return (char *) base;
  }
--- 85,89 ----
      if (IS_DIR_SEPARATOR (*name))
        base = name + 1;
  
!   return base;
  }

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