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]

[sim/common] Eliminate MIN from dv-sockser.c


FYI,

I found that the definition clashed on one system - eliminating it was
easier than anything else I could think of :-)

	Andrew
2000-08-09  Andrew Cagney  <cagney@lulu.cygnus.com>

	* dv-sockser.c (dv_sockser_init): Eliminate MIN macro.

Index: dv-sockser.c
===================================================================
RCS file: /cvs/src/src/sim/common/dv-sockser.c,v
retrieving revision 1.1.1.2
diff -p -r1.1.1.2 dv-sockser.c
*** dv-sockser.c	1999/07/07 17:31:06	1.1.1.2
--- dv-sockser.c	2000/08/11 00:42:32
*************** with this program; if not, write to the 
*** 74,80 ****
  #endif /* ! defined (FNBLOCK) */
  #endif /* ! defined (O_NONBLOCK) */
  
- #define MIN(a,b) ((a) < (b) ? (a) : (b))
  
  /* Compromise between eating cpu and properly busy-waiting.
     One could have an option to set this but for now that seems
--- 74,79 ----
*************** dv_sockser_init (SIM_DESC sd)
*** 148,154 ****
  		      sockser_addr);
        return SIM_RC_FAIL;
      }
!   tmp = MIN (port_str - sockser_addr, (int) sizeof hostname - 1);
    strncpy (hostname, sockser_addr, tmp);
    hostname[tmp] = '\000';
    port = atoi (port_str + 1);
--- 147,155 ----
  		      sockser_addr);
        return SIM_RC_FAIL;
      }
!   tmp = port_str - sockser_addr;
!   if (tmp >= sizeof hostname)
!     tmp = sizeof (hostname) - 1;
    strncpy (hostname, sockser_addr, tmp);
    hostname[tmp] = '\000';
    port = atoi (port_str + 1);

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