This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[sim/common] Eliminate MIN from dv-sockser.c
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [sim/common] Eliminate MIN from dv-sockser.c
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 10 Aug 2000 17:44:36 -0700
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);