]> rtime.felk.cvut.cz Git - orte.git/commitdiff
Fix most of warnings reported by GCC 4.7 on x86_64 and GCC 4.8.1 RTEMS ARM based...
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Sat, 21 Sep 2013 13:36:04 +0000 (15:36 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Mon, 23 Sep 2013 09:06:29 +0000 (11:06 +0200)
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
orte/examples/hello/h_publisher.c
orte/examples/hello/h_subscriber.c
orte/examples/multicast/m_subscriber.c
orte/examples/ping/orteping.c
orte/examples/reliable/r_publisher.c
orte/examples/reliable/r_subscriber_besteffort.c
orte/examples/reliable/r_subscriber_reliable.c
orte/examples/schneider/schneider_subscriber.c
orte/liborte/sock.c
orte/manager/ortemanager.c

index ab7e45994426d1332be16cdcec93c349ac05ede4..04774f805b528a69aefa60cb40b6568be62b076e 100644 (file)
@@ -82,6 +82,9 @@ publisherCreate(void *arg) {
       sendCallBack,
       NULL,
       &delay);
+  if (p == NULL) {
+    printf("ORTEPublicationCreate failed\n");
+  }
   return arg;
 }
 
index 6cfe38e38370f870b5f9eb7433e00c1505151579..de8031476cc56830de2128c267a3b03e53045bb0 100644 (file)
@@ -84,6 +84,9 @@ subscriberCreate(void *arg) {
        recvCallBack,
        NULL,
        IPADDRESS_INVALID);
+  if (s == NULL) {
+    printf("ORTESubscriptionCreate failed\n");
+  }
   return arg;
 }
 
index 819ba3e59c9c7e9d5e6152b868f800a0782153e3..8b283da1610c954b5ad9579887bba596bfdc1dc4 100644 (file)
@@ -39,7 +39,7 @@
 static ORTEDomain        *d = NULL;
 static char              instance2Recv[64];
 
-int maxDataSize(ORTEGetMaxSizeParam *gms) {
+int maxDataSize(ORTEGetMaxSizeParam *gms, int num) {
   return gms->max_size;
 }
 
@@ -78,6 +78,9 @@ subscriberCreate(void *arg) {
        recvCallBack,
        NULL,
        StringToIPAddress("225.0.0.2"));
+  if (s == NULL) {
+    printf("ORTESubscriptionCreate failed\n");
+  }
   return arg;
 }
 
index 575feeae064cab53a9d480c94bd00415fa063383..08f72bececdf9d548bf79ce5b45da61370396c46 100644 (file)
   #include <getopt.h>
 #endif
 
+#ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+#endif /*HAVE_INTTYPES_H*/
+
+#ifndef PRIu32
+  #define PRIu32 x
+#endif
+
 #ifdef MAIN_RENAMED
 #define main orte_ping_main
 #define exit return
@@ -68,7 +76,7 @@ recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam)
   switch (info->status) {
     case NEW_DATA:
       if (!quite)
-        printf("received fresh issue %d\n",*instance);
+        printf("received fresh issue %"PRIu32"\n",*instance);
       break;
     case DEADLINE:
       printf("deadline occurred\n");
@@ -84,7 +92,7 @@ sendCallBack(const ORTESendInfo *info,void *vinstance, void *sendCallBackParam)
     case NEED_DATA:
       (*instance)++;
       if (!quite)
-        printf("sent issue %d\n",*instance);
+        printf("sent issue %"PRIu32"\n",*instance);
       break;
     case CQL:  //criticalQueueLevel
       break;
@@ -239,6 +247,10 @@ int main(int argc,char *argv[]) {
          sendCallBack,
          NULL,
          &delay);
+   if (p == NULL) {
+     printf("ORTEPublicationCreate failed\n");
+     exit(1);
+   }
   }
   if (haveSubscriber) {
     NTPTIME_BUILD(deadline,3); 
@@ -254,6 +266,10 @@ int main(int argc,char *argv[]) {
          recvCallBack,
          NULL,
         smIPAddress);
+   if (s == NULL) {
+     printf("ORTESubscriptionCreate failed\n");
+     exit(1);
+   }
   }
   //never ending loop
   while (!regfail) 
index 98ce8796f23b915ec1dd7fb3b628a64a288e000b..7f9408f3c8fab26aa2ec43f359c91b1b8af71568 100644 (file)
@@ -79,6 +79,10 @@ main(int argc, char *args[]) {
       sendCallBack,
       NULL,
       &repeating);
+  if (p == NULL) {
+    printf("ORTEPublicationCreate failed\n");
+    return 1;
+  }
   #ifndef CONFIG_ORTE_RT
   while(1) {
     ORTESleepMs(1000);
index 5ab3345b17d999de1282c8a722e1cf9463983175..c72cfdfbca19ee361dca292216ef4835fc767521 100644 (file)
@@ -81,6 +81,10 @@ main(int argc, char *args[]) {
        recvCallBack,
        NULL,
        IPADDRESS_INVALID);
+  if (s == NULL) {
+    printf("ORTESubscriptionCreate failed\n");
+    return 1;
+  }
   #ifndef CONFIG_ORTE_RT
   while (1) 
     ORTESleepMs(1000);
index 354c60962758fa8d2e51d89d10299a4a949641fc..084b46fc7a5f134c2d72a5a32956b4cb402b1ea0 100644 (file)
@@ -81,6 +81,10 @@ main(int argc, char *args[]) {
        recvCallBack,
        NULL,
        IPADDRESS_INVALID);
+  if (s == NULL) {
+    printf("ORTESubscriptionCreate failed\n");
+    return 1;
+  }
   #ifndef CONFIG_ORTE_RT
   while (1) 
     ORTESleepMs(1000);
index d0452ae0423a64f06d36fd330de8b5c87d648acd..a320f2b583ae6e6918c797d7839d8b630639a8e1 100644 (file)
@@ -39,7 +39,7 @@
 static ORTEDomain        *d = NULL;
 static char              instance2Recv[64];
 
-int maxDataSize(ORTEGetMaxSizeParam *gms) {
+int maxDataSize(ORTEGetMaxSizeParam *gms, int num) {
   return gms->max_size;
 }
 
@@ -80,6 +80,9 @@ subscriberCreate(void *arg) {
 //       StringToIPAddress("225.0.0.2")
        IPADDRESS_INVALID
        );
+  if (s == NULL) {
+    printf("ORTESubscriptionCreate failed\n");
+  }
   return arg;
 }
 
index 12b9c5987599084aec8ca6ef100340cbade37db7..a5818e58c6f4fbe0b0e55ba704b04aa645261eb7 100644 (file)
@@ -210,7 +210,7 @@ sock_get_local_interfaces(sock_t *sock,ORTEIFProp *IFProp,char *IFCount) {
   }
 
   freeifaddrs(ifa);
-
+  return 0;
 #elif defined(SOCK_BSD)
   #define SOCK_SIOCGIFCONF_SA_LEN_UNCONDITIONAL 1 /* seems to be required for RTEMS*/
 
index 910df3b9fc1c19cfd4cd958af76108f195b3e3eb..bc42bfeddbe3636e739e309a367fb6abc229e025 100644 (file)
  
 #include "orte_all.h"
 
+#ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+ #if defined(PRIx32) && !defined(ORTE_PRI_HostId)
+  #define ORTE_PRI_HostId PRIx32
+  #define ORTE_PRI_AppId PRIx32
+ #endif
+#endif /*HAVE_INTTYPES_H*/
+
+#ifndef ORTE_PRI_HostId
+  #define ORTE_PRI_HostId x
+  #define ORTE_PRI_AppId x
+#endif
+
 #ifdef MAIN_RENAMED
 #define main ortemanager_main
 #define exit return
@@ -48,7 +61,7 @@ static ORTEDomainAppEvents *events=NULL;
 //event system
 Boolean
 onMgrAppRemoteNew(const struct ORTEAppInfo *appInfo, void *param) {
-  printf("%s 0x%x-0x%x was accepted\n",
+  printf("%s 0x%"ORTE_PRI_HostId"-0x%"ORTE_PRI_AppId" was accepted\n",
          (appInfo->appId & 0x3)==MANAGER ? "manager" : "application",
          appInfo->hostId,appInfo->appId);
   return ORTE_TRUE;
@@ -56,7 +69,7 @@ onMgrAppRemoteNew(const struct ORTEAppInfo *appInfo, void *param) {
 
 void
 onMgrAppDelete(const struct ORTEAppInfo *appInfo, void *param) {
-  printf("%s 0x%x-0x%x was deleted\n",
+  printf("%s 0x%"ORTE_PRI_HostId"-0x%"ORTE_PRI_AppId" was deleted\n",
          (appInfo->appId & 0x3)==MANAGER ? "manager" : "application",
          appInfo->hostId,appInfo->appId);
 }