[llvm-commits] CVS: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/echo.cpp

John Criswell criswell at cs.uiuc.edu
Tue Aug 3 12:45:04 PDT 2004



Changes in directory llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++:

echo.cpp updated: 1.2 -> 1.3

Responsible party: criswell
---
Log message:

Hardcoded the value of "any interface value" to be 127.0.0.1, in network
byte order.
This gets around htonl() being implemented in in-line asm in system header
files, although it makes the assumption that the loopback interface is
127.0.0.1.  In my experience, that's a pretty good bet on any UNIX
platform.


---
Diffs of the changes:  (+9 -1)

Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/echo.cpp
diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/echo.cpp:1.2 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/echo.cpp:1.3
--- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/echo.cpp:1.2	Tue Jun 15 15:48:16 2004
+++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/echo.cpp	Tue Aug  3 14:44:53 2004
@@ -1,5 +1,5 @@
 // -*- mode: c++ -*-
-// $Id: echo.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $
+// $Id: echo.cpp,v 1.3 2004/08/03 19:44:53 criswell Exp $
 // http://www.bagley.org/~doug/shootout/
 
 #include <stdio.h>
@@ -33,7 +33,11 @@
 	sysabort("server/setsockopt");
     memset(&sin,0,sizeof(sin));
     sin.sin_family = AF_INET;
+#if 0
     sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+#else
+    sin.sin_addr.s_addr = 0x0100007f;
+#endif
     sin.sin_port = 0;
     if (bind(ss, (sockaddr *)&sin, sizeof(sin)) == -1)
 	sysabort("server/bind");
@@ -59,7 +63,11 @@
     if ((sock = socket(PF_INET, SOCK_STREAM, 0)) == -1)
 	sysabort("client/socket");
     sin.sin_family = AF_INET;
+#if 0
     sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+#else
+    sin.sin_addr.s_addr = 0x0100007f;
+#endif
     sin.sin_port = port;
     if (connect(sock, (sockaddr *)&sin, sizeof(sin)) == -1)
 	sysabort("client/connect");





More information about the llvm-commits mailing list