valueset: Remove the unused link field.
[libfirm] / ir / lpp / lpp_net.c
index 3ff6a56..15ce82d 100644 (file)
@@ -59,6 +59,7 @@
 #include "lpp_net.h"
 #include "lpp_t.h"
 #include "lpp_comm.h"
+#include "xmalloc.h"
 
 #ifdef _WIN32
 static int winsock_init(void)
@@ -109,7 +110,7 @@ static int connect_tcp(const char *host, uint16_t port)
        sin.sin_port   = htons(port);
 
        if ((phe = gethostbyname(host)))
-               memcpy(&sin.sin_addr, phe->h_addr, phe->h_length);
+               memcpy(&sin.sin_addr, phe->h_addr_list[0], phe->h_length);
        else if((sin.sin_addr.s_addr = inet_addr(host)) == INADDR_NONE) {
                lpp_print_err("cannot get host entry for %s", host);
                return -1;
@@ -136,7 +137,7 @@ char **lpp_get_solvers(const char *host)
        lpp_writel(comm, LPP_CMD_SOLVERS);
        lpp_flush(comm);
        n = lpp_readl(comm);
-       res = malloc((n + 1) * sizeof(res[0]));
+       res = XMALLOCN(char*, n+1);
        res[n] = NULL;
 
        if(n > 0) {
@@ -187,20 +188,15 @@ void lpp_solve_net(lpp_t *lpp, const char *host, const char *solver)
        lpp_writes(comm, solver);
        lpp_flush(comm);
 
-#if 0
-       ERR_CHECK_RETURN_VOID(lpp_ack(fd, sizeof(buf), buf), == 0,
-               ("could not set solver: %s", solver));
-#endif
-
        t_send = ir_timer_new();
        t_recv = ir_timer_new();
 
-       ir_timer_push(t_send);
+       ir_timer_start(t_send);
        lpp_writel(comm, LPP_CMD_PROBLEM);
        lpp_serialize(comm, lpp, 1);
        lpp_serialize_values(comm, lpp, lpp_value_start);
        lpp_flush(comm);
-       ir_timer_pop();
+       ir_timer_stop(t_send);
        lpp->send_time = ir_timer_elapsed_usec(t_send);
 
        ready = 0;
@@ -211,7 +207,7 @@ void lpp_solve_net(lpp_t *lpp, const char *host, const char *solver)
                                ir_timer_push(t_recv);
                                lpp_deserialize_stats(comm, lpp);
                                lpp_deserialize_values(comm, lpp, lpp_value_solution);
-                               ir_timer_pop();
+                               ir_timer_stop(t_recv);
                                lpp->recv_time = ir_timer_elapsed_usec(t_recv);
                                ready = 1;
                                break;