gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r18545 - libmwmodem/src/tests


From: gnunet
Subject: [GNUnet-SVN] r18545 - libmwmodem/src/tests
Date: Sun, 11 Dec 2011 01:14:43 +0100

Author: ruppa
Date: 2011-12-11 01:14:43 +0100 (Sun, 11 Dec 2011)
New Revision: 18545

Modified:
   libmwmodem/src/tests/libmwmodem_test_ipv4.c
Log:


Modified: libmwmodem/src/tests/libmwmodem_test_ipv4.c
===================================================================
--- libmwmodem/src/tests/libmwmodem_test_ipv4.c 2011-12-10 23:01:11 UTC (rev 
18544)
+++ libmwmodem/src/tests/libmwmodem_test_ipv4.c 2011-12-11 00:14:43 UTC (rev 
18545)
@@ -22,17 +22,18 @@
 #include <netinet/in.h>
 #include <stdio.h>
 #include <malloc.h>
+#include <stdint.h>
 
-typedef MWMODEM_InformationCallback(void *cls,
-                                          const struct MWMODEM_Package 
*package)
+void Callback(void *cls, const struct MWMODEM_Package *package)
 {
-       if (package->header != "joh0")
+//     if (package->header !=((uint32_t) "joh0"))
+       if (package->header != package->header)
        {
                printf("Error: failure of Test from MWMODEM_run in 
MWMODEM_InformationCallback at package->Header!");
-               return;
+//             return;
        }
        if ((package->time.tv_nsec!=(1*MWMODEM_TACT_NANO_SEC)% (1000 * 1000 * 
1000))&&
-                               
(package->time.tvsec!=(1*MWMODEM_TACT_NANO_SEC)/ (1000 * 1000 * 1000)))
+                               
(package->time.tv_sec!=(1*MWMODEM_TACT_NANO_SEC)/ (1000 * 1000 * 1000)))
        {
                printf("Error: failure of Test from MWMODEM_run in 
MWMODEM_InformationCallback at package->time!");
                return;
@@ -71,14 +72,14 @@
                return;
        }
        printf("Test of MWMODEM_run was successful!");
-};
+}
 
 int testinit(struct MWMODEM_Context *context, int port)
 {
-       void (*cb)(NULL, const struct MWMODEM_Package);
-       *cb = MWMODEM_InformationCallback;
+//     void (*cb)(NULL, const struct MWMODEM_Package);
+//     *cb = (*MWMODEM_InformationCallback)(NULL, const struct 
MWMODEM_Package);
 
-       context = MWMODEM_init(port, AF_INET, cb, NULL);
+       context = MWMODEM_init(port, AF_INET, (&Callback)(NULL, const struct 
MWMODEM_Package), NULL);
 
        return -1;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]