This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: revised, libgfortran .hidden markup


Richard Henderson wrote:

> On Fri, Dec 17, 2004 at 03:20:06AM -0600, Aaron W. LaFramboise wrote:
> 
>>However, this is not the first time itoa() has caused problems for
>>i686-pc-mingw32.  I think the best course of action would be to rename
>>itoa() in libgfortran.h and error.c (and possibly xtoa, for consistancy).
> 
> Agreed.  Feel free to build a patch that renames them to gfc_itoa, 
> or something.  (Not exactly sure what prefix we're using for source
> level namespace separation, if any.)

gfc_ seems to be the right prefix, as its used for several other similar
things, such as gfc_alloca.

Is this patch OK?

Aaron W. LaFramboise

2004-12-17  Aaron W. LaFramboise <aaronavay62@aaronwl.com>

	* libgfortran.h (itoa): Rename to gfc_itoa.
	* io/write.c (itoa): Same.
	* runtime/environ.c (itoa): Same.
	* runtime/error.c (itoa): Same.

Index: gcc/libgfortran/libgfortran.h
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/libgfortran.h,v
retrieving revision 1.18
diff -c -3 -p -r1.18 libgfortran.h
*** gcc/libgfortran/libgfortran.h	14 Dec 2004 10:43:32 -0000	1.18
--- gcc/libgfortran/libgfortran.h	17 Dec 2004 09:42:16 -0000
*************** internal_proto(get_args);
*** 370,377 ****
  
  /* error.c */
  
! extern char *itoa (int64_t);
! internal_proto(itoa);
  
  extern char *xtoa (uint64_t);
  internal_proto(xtoa);
--- 370,377 ----
  
  /* error.c */
  
! extern char *gfc_itoa (int64_t);
! internal_proto(gfc_itoa);
  
  extern char *xtoa (uint64_t);
  internal_proto(xtoa);
Index: gcc/libgfortran/io/write.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/write.c,v
retrieving revision 1.20
diff -c -3 -p -r1.20 write.c
*** gcc/libgfortran/io/write.c	7 Dec 2004 00:01:00 -0000	1.20
--- gcc/libgfortran/io/write.c	17 Dec 2004 09:42:18 -0000
*************** btoa (uint64_t n)
*** 928,934 ****
  void
  write_i (fnode * f, const char *p, int len)
  {
!   write_decimal (f, p, len, (void *) itoa);
  }
  
  
--- 928,934 ----
  void
  write_i (fnode * f, const char *p, int len)
  {
!   write_decimal (f, p, len, (void *) gfc_itoa);
  }
  
  
*************** write_integer (const char *source, int l
*** 1042,1048 ****
    int digits;
    int width;
  
!   q = itoa (extract_int (source, length));
  
    switch (length)
      {
--- 1042,1048 ----
    int digits;
    int width;
  
!   q = gfc_itoa (extract_int (source, length));
  
    switch (length)
      {
Index: gcc/libgfortran/runtime/environ.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/runtime/environ.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 environ.c
*** gcc/libgfortran/runtime/environ.c	12 Dec 2004 08:59:05 -0000	1.4
--- gcc/libgfortran/runtime/environ.c	17 Dec 2004 09:42:19 -0000
*************** check_buffered (int n)
*** 551,557 ****
      return 0;
  
    strcpy (name, "GFORTRAN_UNBUFFERED_");
!   strcat (name, itoa (n));
  
    v.name = name;
    v.value = 2;
--- 551,557 ----
      return 0;
  
    strcpy (name, "GFORTRAN_UNBUFFERED_");
!   strcat (name, gfc_itoa (n));
  
    v.name = name;
    v.value = 2;
Index: gcc/libgfortran/runtime/error.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/runtime/error.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 error.c
*** gcc/libgfortran/runtime/error.c	12 Dec 2004 08:59:05 -0000	1.7
--- gcc/libgfortran/runtime/error.c	17 Dec 2004 09:42:19 -0000
*************** static char buffer[32];		/* buffer for i
*** 60,66 ****
  /* Returns a pointer to a static buffer. */
  
  char *
! itoa (int64_t n)
  {
    int negative;
    char *p;
--- 60,66 ----
  /* Returns a pointer to a static buffer. */
  
  char *
! gfc_itoa (int64_t n)
  {
    int negative;
    char *p;
*************** st_printf (const char *format, ...)
*** 177,183 ****
  	  break;
  
  	case 'd':
! 	  q = itoa (va_arg (arg, int));
  	  count = strlen (q);
  
  	  p = salloc_w (s, &count);
--- 177,183 ----
  	  break;
  
  	case 'd':
! 	  q = gfc_itoa (va_arg (arg, int));
  	  count = strlen (q);
  
  	  p = salloc_w (s, &count);
*************** st_sprintf (char *buffer, const char *fo
*** 254,260 ****
  	  break;
  
  	case 'd':
! 	  p = itoa (va_arg (arg, int));
  	  count = strlen (p);
  
  	  memcpy (buffer, p, count);
--- 254,260 ----
  	  break;
  
  	case 'd':
! 	  p = gfc_itoa (va_arg (arg, int));
  	  count = strlen (p);
  
  	  memcpy (buffer, p, count);

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