[PATCH 3/7] Removed some compiler warnings.


Gary Molloy <GMolloy@...>
 

Testing

 

Fixed compiler warnings should not affect the building or running of any related MAMA clients. 

Simply try building OpenMAMA and running regression tests and unittests.

 

 

 

From 460bcfbb2c5525cc19750340fbee9a92b9a1f555 Mon Sep 17 00:00:00 2001

From: Gary Molloy <gmolloy@...>

Date: Mon, 23 Jun 2014 15:25:17 +0100

Subject: [PATCH 3/7] Removed some compiler warnings.

 

[OMAMA-270]

 

Description - Removed some compiler warnings from various files

 

Signed-off-by: Gary Molloy <gmolloy@...>

---

mama/c_cpp/src/c/conflation/manager.c                     |  5 +++++

mama/c_cpp/src/c/ft.c                                     |  2 +-

mama/c_cpp/src/c/playback/playbackcapture.c               |  2 +-

mama/c_cpp/src/c/playback/playbackpublisher.h             |  7 +++++++

mama/c_cpp/src/c/transport.c                              |  2 +-

mama/c_cpp/src/cpp/MamaQueue.cpp                          |  2 +-

mama/c_cpp/src/cpp/MamaSymbolList.cpp                     | 14 --------------

mama/c_cpp/src/examples/c/mamalistencachedc.c             | 10 +++++-----

mama/c_cpp/src/examples/c/mamaproxyc.c                    |  8 ++++----

mama/c_cpp/src/examples/c/mamasubscriberc.c               |  4 ++--

mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp       |  4 ++--

mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp              |  2 +-

mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c    |  4 ++--

mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c |  6 ++++--

mama/c_cpp/src/testtools/performance/c/mamaproducerc.c    |  4 ++--

mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c |  6 ++++--

16 files changed, 42 insertions(+), 40 deletions(-)

 

diff --git a/mama/c_cpp/src/c/conflation/manager.c b/mama/c_cpp/src/c/conflation/manager.c

index db6b409..9799369 100644

--- a/mama/c_cpp/src/c/conflation/manager.c

+++ b/mama/c_cpp/src/c/conflation/manager.c

@@ -52,6 +52,11 @@ mamaMsg

mamaConflationManagerImpl_getMsg (mamaConflationManager mgr);

 mama_status

+mamaConflationManagerImpl_processData (mamaConflationManager mgr,

+                                       mamaMsg               msg,

+                                       const char*           topic);

+

+mama_status

mamaConflationManager_allocate (mamaConflationManager* mgr)

{

     mamaConflationMgr *impl =

diff --git a/mama/c_cpp/src/c/ft.c b/mama/c_cpp/src/c/ft.c

index c5b2c85..1a1bb78 100644

--- a/mama/c_cpp/src/c/ft.c

+++ b/mama/c_cpp/src/c/ft.c

@@ -668,7 +668,7 @@ mama_status startTimeoutTimer (mamaFtMemberImpl* impl)

 mama_status stopTimeoutTimer (mamaFtMemberImpl* impl)

{

-    mama_status status;

+    mama_status status = MAMA_STATUS_OK;

    mama_log (MAMA_LOG_LEVEL_FINE, "MAMA FT: stopping timeout timer");

     if (impl->myTimeoutTimer)

     {

diff --git a/mama/c_cpp/src/c/playback/playbackcapture.c b/mama/c_cpp/src/c/playback/playbackcapture.c

index 20af14c..a178634 100644

--- a/mama/c_cpp/src/c/playback/playbackcapture.c

+++ b/mama/c_cpp/src/c/playback/playbackcapture.c

@@ -253,7 +253,7 @@ mama_status mamaCapture_saveMamaMsg (mamaPlaybackCapture* mamaCapture,

         strcat (captureBuffer, temp);

         strcat (captureBuffer, delim);

         memset (bufferLength, '\0', LENGTH);

-        sprintf (bufferLength, "%u", bufferSize);

+        sprintf (bufferLength, "%u", (unsigned int)bufferSize);

         strcat (captureBuffer, bufferLength);

         fwrite (captureBuffer, 1, strlen(captureBuffer), myPlaybackFile);

         fputc  ((char)29,myPlaybackFile);

diff --git a/mama/c_cpp/src/c/playback/playbackpublisher.h b/mama/c_cpp/src/c/playback/playbackpublisher.h

index 7eafc66..e507d84 100644

--- a/mama/c_cpp/src/c/playback/playbackpublisher.h

+++ b/mama/c_cpp/src/c/playback/playbackpublisher.h

@@ -168,6 +168,13 @@ extern mama_bool_t

mamaPlayback_findOrCreateTransport (mamaPlaybackPublisher mamaPlayback,

                                     char* transportName,

                                     mamaTransport* transport);

+

+mama_bool_t

+mamaPlayback_findOrCreatePublisher (mamaPlaybackPublisher mamaPlayback,

+                                    char* keyName,

+                                    mamaPublisher* publisher,

+                                    const char delim);

+

/**

  * Method:  mamaplayback_getSymbol

  * @param:  mamaPlaybackPublisher

diff --git a/mama/c_cpp/src/c/transport.c b/mama/c_cpp/src/c/transport.c

index 339dbc0..81434ae 100644

--- a/mama/c_cpp/src/c/transport.c

+++ b/mama/c_cpp/src/c/transport.c

@@ -738,7 +738,7 @@ mamaTransport_create (mamaTransport transport,

                 self->mLoadBalanceHandle = openSharedLib (sharedObjectName, NULL);

                 if (self->mLoadBalanceHandle)

                 {

-                                                                              void*     vp = NULL;

+                    void*   vp = NULL;

                     mama_log (MAMA_LOG_LEVEL_FINER,

                               "Using Library defined load balancing");

                     vp = loadLibFunc ((LIB_HANDLE)self->mLoadBalanceHandle,

diff --git a/mama/c_cpp/src/cpp/MamaQueue.cpp b/mama/c_cpp/src/cpp/MamaQueue.cpp

index ec6ca3d..7119941 100644

--- a/mama/c_cpp/src/cpp/MamaQueue.cpp

+++ b/mama/c_cpp/src/cpp/MamaQueue.cpp

@@ -160,12 +160,12 @@ namespace Wombat

         {

         }

-                              bool                                                                         mOwner;

         void*                     mClosure;

         MamaQueueEnqueueCallback* mEnqueueCallback;

         MamaQueueMonitorCallback* mMonitorCallback;

         void*                     mMonitorCallbackClosure;

         void*                     mUserClosure;

+        bool                      mOwner;

     };

 

diff --git a/mama/c_cpp/src/cpp/MamaSymbolList.cpp b/mama/c_cpp/src/cpp/MamaSymbolList.cpp

index 4f5bdd6..5a00879 100644

--- a/mama/c_cpp/src/cpp/MamaSymbolList.cpp

+++ b/mama/c_cpp/src/cpp/MamaSymbolList.cpp

@@ -149,19 +149,6 @@ namespace Wombat

             return MAMA_STATUS_OK;

         }

-

-        /**

-         * The orderChange callback for the C API

-         */

-        static mama_status MAMACALLTYPE

-        orderChangeHandler (mamaSymbolList list, void *closure)

-        {

-            MamaSymbolList::MamaSymbolListImpl *impl =

-                static_cast<MamaSymbolList::MamaSymbolListImpl*>(closure);

-            impl->invokeOrderChangeHandlers ();

-

-            return MAMA_STATUS_OK;

-        }

     }

 

@@ -177,7 +164,6 @@ namespace Wombat

         mamaSymbolList_setClosure             (myList, myPimpl);

         mamaSymbolList_setAddSymbolHandler    (myList, addMemberHandler);

         mamaSymbolList_setRemoveSymbolHandler (myList, removeMemberHandler);

-        //mamaSymbolList_setOrderChangeHandler  (myList, orderChangeHandler);

     }

     MamaSymbolList::~MamaSymbolList()

diff --git a/mama/c_cpp/src/examples/c/mamalistencachedc.c b/mama/c_cpp/src/examples/c/mamalistencachedc.c

index 8d683b9..9aa6eb0 100644

--- a/mama/c_cpp/src/examples/c/mamalistencachedc.c

+++ b/mama/c_cpp/src/examples/c/mamalistencachedc.c

@@ -1770,7 +1770,7 @@ displayCb (const mamaMsg       msg,

                 const mamaMsgField  field,

                 void*               closure)

{

-    displayField (field, msg, (int)closure);

+    displayField (field, msg, (int)(intptr_t)closure);

}

 void displayAllFields (mamaMsg msg, mamaSubscription subscription, int

@@ -1807,7 +1807,7 @@ void displayAllFields (mamaMsg msg, mamaSubscription subscription, int

     */

     if (gNewIterators == 0)

     {

-        mamaMsg_iterateFields (msg, displayCb, gDictionary, (void*)indentLevel);

+        mamaMsg_iterateFields (msg, displayCb, gDictionary, (void*)(intptr_t)indentLevel);

     }

     else

     {

@@ -1924,7 +1924,7 @@ highWaterMarkCallback (mamaQueue     queue,

     printf ("%s high water mark exceeded. Num events "

             "on queue: %u\n",

-            queueName == NULL ? "" : queueName, size);

+            queueName == NULL ? "" : queueName, (unsigned int)size);

}

 static void MAMACALLTYPE

@@ -1949,7 +1949,7 @@ lowWaterMarkCallback  (mamaQueue     queue,

     }

     printf ("%s low water mark exceeded. Num events on queue: %u\n",

-            queueName == NULL ? "" : queueName, size);

+            queueName == NULL ? "" : queueName, (unsigned int)size);

}

 void setQueueMonitors (mamaQueue queue, int queueIndex)

@@ -2471,7 +2471,7 @@ mama_status printAllCacheFields(mamaFieldCache fieldCache)

     mama_size_t size = 0;

     mamaFieldCache_getSize(fieldCache, &size);

-    printf("Cache size: %u\n", size);

+    printf("Cache size: %u\n", (unsigned int)size);

    

     ret = mamaFieldCacheIterator_create(&cacheIterator, fieldCache);

     while (mamaFieldCacheIterator_hasNext(cacheIterator))

diff --git a/mama/c_cpp/src/examples/c/mamaproxyc.c b/mama/c_cpp/src/examples/c/mamaproxyc.c

index 40ebbb5..24dcfff 100644

--- a/mama/c_cpp/src/examples/c/mamaproxyc.c

+++ b/mama/c_cpp/src/examples/c/mamaproxyc.c

@@ -227,7 +227,7 @@ static void subscribeToSymbols ()

                                  &callbacks,

                                  gSubscriptionSource,

                                  gSymbolList[i],

-                                 (void*)i);

+                                 (void*)(intptr_t)i);

                                gSubscriptionList[i].symbol = gSymbolList[i];

                               mamaMsg_create(&gSubscriptionList[i].cachedMsg);

@@ -351,7 +351,7 @@ subscriptionHandlerOnNewRequestCb (mamaDQPublisherManager manager,

         return;

     }

-    mamaDQPublisherManager_createPublisher (manager, symbol, (void*)i, &gSubscriptionList[i].pub);

+    mamaDQPublisherManager_createPublisher (manager, symbol, (void*)(intptr_t)i, &gSubscriptionList[i].pub);

     printf ("Received new request: %s\n", symbol);

@@ -419,7 +419,7 @@ subscriptionHandlerOnRequestCb (mamaDQPublisherManager manager,

         case MAMA_SUBSC_SNAPSHOT:

             mamaMsg_detach (msg);

             info = (recapInfo*) calloc (1, sizeof(recapInfo));

-            info->index =(int)publishTopicInfo->cache;

+            info->index =(int)(intptr_t)publishTopicInfo->cache;

             info->msg = msg;

             mamaSubscription_getQueue(gSubscriptionList[info->index].sub, &queue);

             mamaQueue_enqueueEvent  (queue,

@@ -432,7 +432,7 @@ subscriptionHandlerOnRequestCb (mamaDQPublisherManager manager,

         case MAMA_SUBSC_DQ_UNKNOWN:

         case MAMA_SUBSC_DQ_GROUP_SUBSCRIBER:

             info = (recapInfo*) calloc (1, sizeof(recapInfo));

-            info->index =(int)publishTopicInfo->cache;

+            info->index =(int)(intptr_t)publishTopicInfo->cache;

             mamaSubscription_getQueue(gSubscriptionList[info->index].sub, &queue);

             mamaQueue_enqueueEvent  (queue,

                              sendRecap,

diff --git a/mama/c_cpp/src/examples/c/mamasubscriberc.c b/mama/c_cpp/src/examples/c/mamasubscriberc.c

index e41dfc7..ee9ef1e 100644

--- a/mama/c_cpp/src/examples/c/mamasubscriberc.c

+++ b/mama/c_cpp/src/examples/c/mamasubscriberc.c

@@ -277,12 +277,12 @@ wildCardMsgCb (mamaSubscription       subscription,

     }

     if (itemClosure == NULL)

     {

-        mamaSubscription_setItemClosure (subscription, (void*)(++i));

+        mamaSubscription_setItemClosure (subscription, (void*)(intptr_t)(++i));

     }

     if (gQuietLevel < 2)

     {

         printf ("Received Wild Card Message with topic %s closure=%d\n", topic,

-            (int)itemClosure);

+            (int)(intptr_t)itemClosure);

     }

     displayMsg (msg);

}

diff --git a/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp b/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp

index b7bd615..f5a65fb 100644

--- a/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp

+++ b/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp

@@ -419,7 +419,7 @@ public:

                                           void* closure)

     {

         printf ("%s queue high water mark exceeded. Size %u\n",

-                queue->getQueueName(), size);

+                queue->getQueueName(), (unsigned int)size);

     }

     virtual void onLowWatermark (MamaQueue* queue,

@@ -427,7 +427,7 @@ public:

                                  void *closure)

     {

         printf ("%s queue low water mark exceeded. Size %u\n",

-                queue->getQueueName(), size);

+                queue->getQueueName(), (unsigned int)size);

     }

private:

     QueueMonitorCallback    (const QueueMonitorCallback& copy);

diff --git a/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp b/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp

index 283382a..b775429 100644

--- a/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp

+++ b/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp

@@ -140,8 +140,8 @@ private:

     bool                     sendSync;

     int                      mQuietness;

     SubscriptionList         mSubscriptionList;

-    SubscriptionHandler*     managerCallback;

     MamaLogLevel             mMamaLogLevel;

+    SubscriptionHandler*     managerCallback;

     MamaTimer*               syncTimer;

};

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c

index f6bcd6f..51a8bcd 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c

@@ -372,7 +372,7 @@ static void MAMACALLTYPE mc_msgCb

   if ((msgCount - lastMsgCount) >= gIntervalRate)

   {

     gettimeofday(&gNow, NULL);

-    printf ("Rate: %llu\tLatency(usec): Low: %lld\tAverage: %lld\tHigh: %lld\tGaps: %llu\n",

+    printf ("Rate: %" PRIi64 "\tLatency(usec): Low: %" PRIi64 "\tAverage: %" PRIi64 "\tHigh: %" PRIi64 "\tGaps: %" PRIu64 "\n",

            (uint64_t)((float)(msgCount-lastMsgCount)/(((float)((gNow.tv_sec - gLast.tv_sec)*1000000) + (gNow.tv_usec - gLast.tv_usec))/1000000.0f)),

            lowLatency,

            (int64_t)((float)runningLatency/(float)sampleCount),

@@ -443,7 +443,7 @@ static void MAMACALLTYPE mc_msgCb2

     time(&nTime);

     now = localtime(&nTime);

     strftime(nowTime, 100, "%Y/%m/%d - %H:%M:%S", now);

-    printf ("%s Rate: %llu\tLatency(usec): Low: %lld\tAverage: %lld\tHigh: %lld\n",

+    printf ("%s Rate: %" PRIu64 "\tLatency(usec): Low: %" PRIi64 "\tAverage: %" PRIi64 "\tHigh: %" PRIi64 "\n",

             nowTime,

            (uint64_t)((float)(msgCount-lastMsgCount)/(((float)((gNow.tv_sec - gLast.tv_sec)*1000000) + (gNow.tv_usec - gLast.tv_usec))/1000000.0f)),

            lowLatency,

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

index a322fd4..9c2046d 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

@@ -719,6 +719,7 @@ static void configure_malloc_behavior(void)

     mallopt(M_MMAP_MAX, 0);

}

+/*

static void

 show_new_pagefault_count(const char* logtext,

                   const char* allowed_maj,

@@ -740,7 +741,7 @@ show_new_pagefault_count(const char* logtext,

     last_majflt = usage.ru_majflt;

     last_minflt = usage.ru_minflt;

}

-

+*/

 static void reserve_process_memory(int size)

{

@@ -2450,7 +2451,8 @@ static void subscriptionOnMsg

     int64_t gapSinceDisplay = 0;

     struct timespec ts1,ts2;

     int64_t diff = 0;

-    uint64_t startTsc, endTsc =0;

+    uint64_t startTsc = 0;

+    uint64_t endTsc = 0;

     mama_size_t msgLen;

     symbol* sym = (symbol*)closure;

     statsGroup* lats;

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c b/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c

index 181784d..88948cf 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c

@@ -201,7 +201,7 @@ int main (int argc, const char **argv)

         mp_nanosleep(sleepTime);

       }

       gettimeofday (&now, NULL);

-      printf ("RATE = %llu\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

+      printf ("RATE = %" PRIu64 "\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

       if (gflush)

       {

         fflush(stdout);

@@ -223,7 +223,7 @@ int main (int argc, const char **argv)

         mp_publishMessage (msgNum++, mamaTime, randVal);

       }

       gettimeofday (&now, NULL);

-      printf ("RATE = %llu\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

+      printf ("RATE = %" PRIu64 "\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

       if (gflush)

      {

         fflush(stdout);

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c b/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

index 8839500..9fc28e0 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

@@ -451,6 +451,7 @@ static void setprio(int prio, int sched)

         perror("sched_setscheduler");

}

+/*

static void

show_new_pagefault_count(const char* logtext,

                   const char* allowed_maj,

@@ -469,6 +470,7 @@ show_new_pagefault_count(const char* logtext,

     last_majflt = usage.ru_majflt;

     last_minflt = usage.ru_minflt;

}

+*/

 static void configure_malloc_behavior(void)

{

@@ -1235,7 +1237,7 @@ static void initializePublishers

)

{

     int i = 0, j = 0, count = 0;

-    publisher* pub;

+    publisher* pub = NULL;

     uint64_t   nsec = gThrottle ? 1000000000/gThrottle : 0;

     char** symbol = gSymbolList;

@@ -1380,7 +1382,7 @@ static void initializePublishers

     if (gUsePlayback)

     {

                mamaPlaybackFileParser_allocate (&gFileParser);

-              mamaPlaybackFileParser_openFile(gFileParser, gPlaybackFilename);

+             mamaPlaybackFileParser_openFile(gFileParser, (char*)gPlaybackFilename);

     }

}

--

1.8.3.1

 


This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange Group, Inc. (ICE), NYSE Euronext or any of their subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.


Gary Molloy <GMolloy@...>
 

Update to existing patch “0003-Removed-some-compiler-warnings.patch”

 

Some functions were hashed out when they should have been removed

 

 

From 336e7fb506ef84c8d7c511103ecf9c73deff04ac Mon Sep 17 00:00:00 2001

From: Gary Molloy <gmolloy@...>

Date: Tue, 24 Jun 2014 15:52:45 +0100

Subject: [PATCH 1/2] Update to existing patch

 

[OMAMA-270]

 

Update to existing patch.  During the code cleanup a function was hashed out rather than deleted.

 

Signed-off-by: Gary Molloy <gmolloy@...>

---

.../src/testtools/performance/c/mamaconsumerc_v2.c | 24 ----------------------

.../src/testtools/performance/c/mamaproducerc_v2.c | 21 -------------------

2 files changed, 45 deletions(-)

 

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

index 9c2046d..8360fc8 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

@@ -719,30 +719,6 @@ static void configure_malloc_behavior(void)

     mallopt(M_MMAP_MAX, 0);

}

-/*

-static void

-show_new_pagefault_count(const char* logtext,

-                  const char* allowed_maj,

-                  const char* allowed_min)

-{

-    int last_majflt = 0, last_minflt = 0;

-    struct rusage usage;

-

-    getrusage(RUSAGE_SELF, &usage);

-

-    fprintf (gFilep, "%-30.30s: Pagefaults, Major:%ld (Allowed %s), "

-             "Minor:%ld (Allowed %s)\n",

-             logtext,

-             usage.ru_majflt - last_majflt,

-             allowed_maj,

-             usage.ru_minflt - last_minflt,

-             allowed_min);

-

-    last_majflt = usage.ru_majflt;

-    last_minflt = usage.ru_minflt;

-}

-*/

-

static void reserve_process_memory(int size)

{

     int i;

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c b/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

index 9fc28e0..62fcc2c 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

@@ -451,27 +451,6 @@ static void setprio(int prio, int sched)

         perror("sched_setscheduler");

}

-/*

-static void

-show_new_pagefault_count(const char* logtext,

-                  const char* allowed_maj,

-                  const char* allowed_min)

-{

-    static int last_majflt = 0, last_minflt = 0;

-    struct rusage usage;

-

-    getrusage(RUSAGE_SELF, &usage);

-

-    printf("%-30.30s: Pagefaults, Major:%ld (Allowed %s), " \

-           "Minor:%ld (Allowed %s)\n", logtext,

-           usage.ru_majflt - last_majflt, allowed_maj,

-           usage.ru_minflt - last_minflt, allowed_min);

-

-    last_majflt = usage.ru_majflt;

-    last_minflt = usage.ru_minflt;

-}

-*/

-

static void configure_malloc_behavior(void)

{

     if (mlockall(MCL_CURRENT | MCL_FUTURE))

--

1.8.3.1

 

 

From: openmama-dev-bounces@... [mailto:openmama-dev-bounces@...] On Behalf Of Gary Molloy
Sent: 24 June 2014 10:53
To: openmama-dev@...
Subject: [Openmama-dev] [PATCH 3/7] Removed some compiler warnings.

 

Testing

 

Fixed compiler warnings should not affect the building or running of any related MAMA clients. 

Simply try building OpenMAMA and running regression tests and unittests.

 

 

 

From 460bcfbb2c5525cc19750340fbee9a92b9a1f555 Mon Sep 17 00:00:00 2001

From: Gary Molloy <gmolloy@...>

Date: Mon, 23 Jun 2014 15:25:17 +0100

Subject: [PATCH 3/7] Removed some compiler warnings.

 

[OMAMA-270]

 

Description - Removed some compiler warnings from various files

 

Signed-off-by: Gary Molloy <gmolloy@...>

---

mama/c_cpp/src/c/conflation/manager.c                     |  5 +++++

mama/c_cpp/src/c/ft.c                                     |  2 +-

mama/c_cpp/src/c/playback/playbackcapture.c               |  2 +-

mama/c_cpp/src/c/playback/playbackpublisher.h             |  7 +++++++

mama/c_cpp/src/c/transport.c                              |  2 +-

mama/c_cpp/src/cpp/MamaQueue.cpp                          |  2 +-

mama/c_cpp/src/cpp/MamaSymbolList.cpp                     | 14 --------------

mama/c_cpp/src/examples/c/mamalistencachedc.c             | 10 +++++-----

mama/c_cpp/src/examples/c/mamaproxyc.c                    |  8 ++++----

mama/c_cpp/src/examples/c/mamasubscriberc.c               |  4 ++--

mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp       |  4 ++--

mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp              |  2 +-

mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c    |  4 ++--

mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c |  6 ++++--

mama/c_cpp/src/testtools/performance/c/mamaproducerc.c    |  4 ++--

mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c |  6 ++++--

16 files changed, 42 insertions(+), 40 deletions(-)

 

diff --git a/mama/c_cpp/src/c/conflation/manager.c b/mama/c_cpp/src/c/conflation/manager.c

index db6b409..9799369 100644

--- a/mama/c_cpp/src/c/conflation/manager.c

+++ b/mama/c_cpp/src/c/conflation/manager.c

@@ -52,6 +52,11 @@ mamaMsg

mamaConflationManagerImpl_getMsg (mamaConflationManager mgr);

 

 mama_status

+mamaConflationManagerImpl_processData (mamaConflationManager mgr,

+                                       mamaMsg               msg,

+                                       const char*           topic);

+

+mama_status

mamaConflationManager_allocate (mamaConflationManager* mgr)

{

     mamaConflationMgr *impl =

diff --git a/mama/c_cpp/src/c/ft.c b/mama/c_cpp/src/c/ft.c

index c5b2c85..1a1bb78 100644

--- a/mama/c_cpp/src/c/ft.c

+++ b/mama/c_cpp/src/c/ft.c

@@ -668,7 +668,7 @@ mama_status startTimeoutTimer (mamaFtMemberImpl* impl)

 

 mama_status stopTimeoutTimer (mamaFtMemberImpl* impl)

{

-    mama_status status;

+    mama_status status = MAMA_STATUS_OK;

    mama_log (MAMA_LOG_LEVEL_FINE, "MAMA FT: stopping timeout timer");

     if (impl->myTimeoutTimer)

     {

diff --git a/mama/c_cpp/src/c/playback/playbackcapture.c b/mama/c_cpp/src/c/playback/playbackcapture.c

index 20af14c..a178634 100644

--- a/mama/c_cpp/src/c/playback/playbackcapture.c

+++ b/mama/c_cpp/src/c/playback/playbackcapture.c

@@ -253,7 +253,7 @@ mama_status mamaCapture_saveMamaMsg (mamaPlaybackCapture* mamaCapture,

         strcat (captureBuffer, temp);

         strcat (captureBuffer, delim);

         memset (bufferLength, '\0', LENGTH);

-        sprintf (bufferLength, "%u", bufferSize);

+        sprintf (bufferLength, "%u", (unsigned int)bufferSize);

         strcat (captureBuffer, bufferLength);

         fwrite (captureBuffer, 1, strlen(captureBuffer), myPlaybackFile);

         fputc  ((char)29,myPlaybackFile);

diff --git a/mama/c_cpp/src/c/playback/playbackpublisher.h b/mama/c_cpp/src/c/playback/playbackpublisher.h

index 7eafc66..e507d84 100644

--- a/mama/c_cpp/src/c/playback/playbackpublisher.h

+++ b/mama/c_cpp/src/c/playback/playbackpublisher.h

@@ -168,6 +168,13 @@ extern mama_bool_t

mamaPlayback_findOrCreateTransport (mamaPlaybackPublisher mamaPlayback,

                                     char* transportName,

                                     mamaTransport* transport);

+

+mama_bool_t

+mamaPlayback_findOrCreatePublisher (mamaPlaybackPublisher mamaPlayback,

+                                    char* keyName,

+                                    mamaPublisher* publisher,

+                                    const char delim);

+

/**

  * Method:  mamaplayback_getSymbol

  * @param:  mamaPlaybackPublisher

diff --git a/mama/c_cpp/src/c/transport.c b/mama/c_cpp/src/c/transport.c

index 339dbc0..81434ae 100644

--- a/mama/c_cpp/src/c/transport.c

+++ b/mama/c_cpp/src/c/transport.c

@@ -738,7 +738,7 @@ mamaTransport_create (mamaTransport transport,

                 self->mLoadBalanceHandle = openSharedLib (sharedObjectName, NULL);

                 if (self->mLoadBalanceHandle)

                 {

-                                                                              void*     vp = NULL;

+                    void*   vp = NULL;

                     mama_log (MAMA_LOG_LEVEL_FINER,

                               "Using Library defined load balancing");

                     vp = loadLibFunc ((LIB_HANDLE)self->mLoadBalanceHandle,

diff --git a/mama/c_cpp/src/cpp/MamaQueue.cpp b/mama/c_cpp/src/cpp/MamaQueue.cpp

index ec6ca3d..7119941 100644

--- a/mama/c_cpp/src/cpp/MamaQueue.cpp

+++ b/mama/c_cpp/src/cpp/MamaQueue.cpp

@@ -160,12 +160,12 @@ namespace Wombat

         {

         }

 

-                              bool                                                                         mOwner;

         void*                     mClosure;

         MamaQueueEnqueueCallback* mEnqueueCallback;

         MamaQueueMonitorCallback* mMonitorCallback;

         void*                     mMonitorCallbackClosure;

         void*                     mUserClosure;

+        bool                      mOwner;

     };

 

 

diff --git a/mama/c_cpp/src/cpp/MamaSymbolList.cpp b/mama/c_cpp/src/cpp/MamaSymbolList.cpp

index 4f5bdd6..5a00879 100644

--- a/mama/c_cpp/src/cpp/MamaSymbolList.cpp

+++ b/mama/c_cpp/src/cpp/MamaSymbolList.cpp

@@ -149,19 +149,6 @@ namespace Wombat

 

             return MAMA_STATUS_OK;

         }

-

-        /**

-         * The orderChange callback for the C API

-         */

-        static mama_status MAMACALLTYPE

-        orderChangeHandler (mamaSymbolList list, void *closure)

-        {

-            MamaSymbolList::MamaSymbolListImpl *impl =

-                static_cast<MamaSymbolList::MamaSymbolListImpl*>(closure);

-            impl->invokeOrderChangeHandlers ();

-

-            return MAMA_STATUS_OK;

-        }

     }

 

 

@@ -177,7 +164,6 @@ namespace Wombat

         mamaSymbolList_setClosure             (myList, myPimpl);

         mamaSymbolList_setAddSymbolHandler    (myList, addMemberHandler);

         mamaSymbolList_setRemoveSymbolHandler (myList, removeMemberHandler);

-        //mamaSymbolList_setOrderChangeHandler  (myList, orderChangeHandler);

     }

 

     MamaSymbolList::~MamaSymbolList()

diff --git a/mama/c_cpp/src/examples/c/mamalistencachedc.c b/mama/c_cpp/src/examples/c/mamalistencachedc.c

index 8d683b9..9aa6eb0 100644

--- a/mama/c_cpp/src/examples/c/mamalistencachedc.c

+++ b/mama/c_cpp/src/examples/c/mamalistencachedc.c

@@ -1770,7 +1770,7 @@ displayCb (const mamaMsg       msg,

                 const mamaMsgField  field,

                 void*               closure)

{

-    displayField (field, msg, (int)closure);

+    displayField (field, msg, (int)(intptr_t)closure);

}

 

 void displayAllFields (mamaMsg msg, mamaSubscription subscription, int

@@ -1807,7 +1807,7 @@ void displayAllFields (mamaMsg msg, mamaSubscription subscription, int

     */

     if (gNewIterators == 0)

     {

-        mamaMsg_iterateFields (msg, displayCb, gDictionary, (void*)indentLevel);

+        mamaMsg_iterateFields (msg, displayCb, gDictionary, (void*)(intptr_t)indentLevel);

     }

     else

     {

@@ -1924,7 +1924,7 @@ highWaterMarkCallback (mamaQueue     queue,

 

     printf ("%s high water mark exceeded. Num events "

             "on queue: %u\n",

-            queueName == NULL ? "" : queueName, size);

+            queueName == NULL ? "" : queueName, (unsigned int)size);

}

 

 static void MAMACALLTYPE

@@ -1949,7 +1949,7 @@ lowWaterMarkCallback  (mamaQueue     queue,

     }

 

     printf ("%s low water mark exceeded. Num events on queue: %u\n",

-            queueName == NULL ? "" : queueName, size);

+            queueName == NULL ? "" : queueName, (unsigned int)size);

}

 

 void setQueueMonitors (mamaQueue queue, int queueIndex)

@@ -2471,7 +2471,7 @@ mama_status printAllCacheFields(mamaFieldCache fieldCache)

     mama_size_t size = 0;

 

     mamaFieldCache_getSize(fieldCache, &size);

-    printf("Cache size: %u\n", size);

+    printf("Cache size: %u\n", (unsigned int)size);

    

     ret = mamaFieldCacheIterator_create(&cacheIterator, fieldCache);

     while (mamaFieldCacheIterator_hasNext(cacheIterator))

diff --git a/mama/c_cpp/src/examples/c/mamaproxyc.c b/mama/c_cpp/src/examples/c/mamaproxyc.c

index 40ebbb5..24dcfff 100644

--- a/mama/c_cpp/src/examples/c/mamaproxyc.c

+++ b/mama/c_cpp/src/examples/c/mamaproxyc.c

@@ -227,7 +227,7 @@ static void subscribeToSymbols ()

                                  &callbacks,

                                  gSubscriptionSource,

                                  gSymbolList[i],

-                                 (void*)i);

+                                 (void*)(intptr_t)i);

 

                                gSubscriptionList[i].symbol = gSymbolList[i];

                               mamaMsg_create(&gSubscriptionList[i].cachedMsg);

@@ -351,7 +351,7 @@ subscriptionHandlerOnNewRequestCb (mamaDQPublisherManager manager,

         return;

     }

 

-    mamaDQPublisherManager_createPublisher (manager, symbol, (void*)i, &gSubscriptionList[i].pub);

+    mamaDQPublisherManager_createPublisher (manager, symbol, (void*)(intptr_t)i, &gSubscriptionList[i].pub);

 

     printf ("Received new request: %s\n", symbol);

 

@@ -419,7 +419,7 @@ subscriptionHandlerOnRequestCb (mamaDQPublisherManager manager,

         case MAMA_SUBSC_SNAPSHOT:

             mamaMsg_detach (msg);

             info = (recapInfo*) calloc (1, sizeof(recapInfo));

-            info->index =(int)publishTopicInfo->cache;

+            info->index =(int)(intptr_t)publishTopicInfo->cache;

             info->msg = msg;

             mamaSubscription_getQueue(gSubscriptionList[info->index].sub, &queue);

             mamaQueue_enqueueEvent  (queue,

@@ -432,7 +432,7 @@ subscriptionHandlerOnRequestCb (mamaDQPublisherManager manager,

         case MAMA_SUBSC_DQ_UNKNOWN:

         case MAMA_SUBSC_DQ_GROUP_SUBSCRIBER:

             info = (recapInfo*) calloc (1, sizeof(recapInfo));

-            info->index =(int)publishTopicInfo->cache;

+            info->index =(int)(intptr_t)publishTopicInfo->cache;

             mamaSubscription_getQueue(gSubscriptionList[info->index].sub, &queue);

             mamaQueue_enqueueEvent  (queue,

                              sendRecap,

diff --git a/mama/c_cpp/src/examples/c/mamasubscriberc.c b/mama/c_cpp/src/examples/c/mamasubscriberc.c

index e41dfc7..ee9ef1e 100644

--- a/mama/c_cpp/src/examples/c/mamasubscriberc.c

+++ b/mama/c_cpp/src/examples/c/mamasubscriberc.c

@@ -277,12 +277,12 @@ wildCardMsgCb (mamaSubscription       subscription,

     }

     if (itemClosure == NULL)

     {

-        mamaSubscription_setItemClosure (subscription, (void*)(++i));

+        mamaSubscription_setItemClosure (subscription, (void*)(intptr_t)(++i));

     }

     if (gQuietLevel < 2)

     {

         printf ("Received Wild Card Message with topic %s closure=%d\n", topic,

-            (int)itemClosure);

+            (int)(intptr_t)itemClosure);

     }

     displayMsg (msg);

}

diff --git a/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp b/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp

index b7bd615..f5a65fb 100644

--- a/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp

+++ b/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp

@@ -419,7 +419,7 @@ public:

                                           void* closure)

     {

         printf ("%s queue high water mark exceeded. Size %u\n",

-                queue->getQueueName(), size);

+                queue->getQueueName(), (unsigned int)size);

     }

 

     virtual void onLowWatermark (MamaQueue* queue,

@@ -427,7 +427,7 @@ public:

                                  void *closure)

     {

         printf ("%s queue low water mark exceeded. Size %u\n",

-                queue->getQueueName(), size);

+                queue->getQueueName(), (unsigned int)size);

     }

private:

     QueueMonitorCallback    (const QueueMonitorCallback& copy);

diff --git a/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp b/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp

index 283382a..b775429 100644

--- a/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp

+++ b/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp

@@ -140,8 +140,8 @@ private:

     bool                     sendSync;

     int                      mQuietness;

     SubscriptionList         mSubscriptionList;

-    SubscriptionHandler*     managerCallback;

     MamaLogLevel             mMamaLogLevel;

+    SubscriptionHandler*     managerCallback;

     MamaTimer*               syncTimer;

};

 

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c

index f6bcd6f..51a8bcd 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c

@@ -372,7 +372,7 @@ static void MAMACALLTYPE mc_msgCb

   if ((msgCount - lastMsgCount) >= gIntervalRate)

   {

     gettimeofday(&gNow, NULL);

-    printf ("Rate: %llu\tLatency(usec): Low: %lld\tAverage: %lld\tHigh: %lld\tGaps: %llu\n",

+    printf ("Rate: %" PRIi64 "\tLatency(usec): Low: %" PRIi64 "\tAverage: %" PRIi64 "\tHigh: %" PRIi64 "\tGaps: %" PRIu64 "\n",

            (uint64_t)((float)(msgCount-lastMsgCount)/(((float)((gNow.tv_sec - gLast.tv_sec)*1000000) + (gNow.tv_usec - gLast.tv_usec))/1000000.0f)),

            lowLatency,

            (int64_t)((float)runningLatency/(float)sampleCount),

@@ -443,7 +443,7 @@ static void MAMACALLTYPE mc_msgCb2

     time(&nTime);

     now = localtime(&nTime);

     strftime(nowTime, 100, "%Y/%m/%d - %H:%M:%S", now);

-    printf ("%s Rate: %llu\tLatency(usec): Low: %lld\tAverage: %lld\tHigh: %lld\n",

+    printf ("%s Rate: %" PRIu64 "\tLatency(usec): Low: %" PRIi64 "\tAverage: %" PRIi64 "\tHigh: %" PRIi64 "\n",

             nowTime,

            (uint64_t)((float)(msgCount-lastMsgCount)/(((float)((gNow.tv_sec - gLast.tv_sec)*1000000) + (gNow.tv_usec - gLast.tv_usec))/1000000.0f)),

            lowLatency,

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

index a322fd4..9c2046d 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

@@ -719,6 +719,7 @@ static void configure_malloc_behavior(void)

     mallopt(M_MMAP_MAX, 0);

}

 

+/*

static void

 show_new_pagefault_count(const char* logtext,

                   const char* allowed_maj,

@@ -740,7 +741,7 @@ show_new_pagefault_count(const char* logtext,

     last_majflt = usage.ru_majflt;

     last_minflt = usage.ru_minflt;

}

-

+*/

 

 static void reserve_process_memory(int size)

{

@@ -2450,7 +2451,8 @@ static void subscriptionOnMsg

     int64_t gapSinceDisplay = 0;

     struct timespec ts1,ts2;

     int64_t diff = 0;

-    uint64_t startTsc, endTsc =0;

+    uint64_t startTsc = 0;

+    uint64_t endTsc = 0;

     mama_size_t msgLen;

     symbol* sym = (symbol*)closure;

     statsGroup* lats;

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c b/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c

index 181784d..88948cf 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c

@@ -201,7 +201,7 @@ int main (int argc, const char **argv)

         mp_nanosleep(sleepTime);

       }

       gettimeofday (&now, NULL);

-      printf ("RATE = %llu\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

+      printf ("RATE = %" PRIu64 "\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

       if (gflush)

       {

         fflush(stdout);

@@ -223,7 +223,7 @@ int main (int argc, const char **argv)

         mp_publishMessage (msgNum++, mamaTime, randVal);

       }

       gettimeofday (&now, NULL);

-      printf ("RATE = %llu\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

+      printf ("RATE = %" PRIu64 "\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

       if (gflush)

      {

         fflush(stdout);

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c b/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

index 8839500..9fc28e0 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

@@ -451,6 +451,7 @@ static void setprio(int prio, int sched)

         perror("sched_setscheduler");

}

 

+/*

static void

show_new_pagefault_count(const char* logtext,

                   const char* allowed_maj,

@@ -469,6 +470,7 @@ show_new_pagefault_count(const char* logtext,

     last_majflt = usage.ru_majflt;

     last_minflt = usage.ru_minflt;

}

+*/

 

 static void configure_malloc_behavior(void)

{

@@ -1235,7 +1237,7 @@ static void initializePublishers

)

{

     int i = 0, j = 0, count = 0;

-    publisher* pub;

+    publisher* pub = NULL;

     uint64_t   nsec = gThrottle ? 1000000000/gThrottle : 0;

     char** symbol = gSymbolList;

 

@@ -1380,7 +1382,7 @@ static void initializePublishers

     if (gUsePlayback)

     {

                mamaPlaybackFileParser_allocate (&gFileParser);

-              mamaPlaybackFileParser_openFile(gFileParser, gPlaybackFilename);

+             mamaPlaybackFileParser_openFile(gFileParser, (char*)gPlaybackFilename);

     }

}

 

--

1.8.3.1

 


This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange Group, Inc. (ICE), NYSE Euronext or any of their subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.



This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange Group, Inc. (ICE), NYSE Euronext or any of their subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.


Damian Maguire <DMaguire@...>
 

Cheers Gary, raised as Bugzilla BZ133

D

From: Gary Molloy <GMolloy@...>
Date: Tuesday, June 24, 2014 10:52 AM
To: "openmama-dev@..." <openmama-dev@...>
Subject: [Openmama-dev] [PATCH 3/7] Removed some compiler warnings.

Testing

 

Fixed compiler warnings should not affect the building or running of any related MAMA clients. 

Simply try building OpenMAMA and running regression tests and unittests.

 

 

 

From 460bcfbb2c5525cc19750340fbee9a92b9a1f555 Mon Sep 17 00:00:00 2001

From: Gary Molloy <gmolloy@...>

Date: Mon, 23 Jun 2014 15:25:17 +0100

Subject: [PATCH 3/7] Removed some compiler warnings.

 

[OMAMA-270]

 

Description - Removed some compiler warnings from various files

 

Signed-off-by: Gary Molloy <gmolloy@...>

---

mama/c_cpp/src/c/conflation/manager.c                     |  5 +++++

mama/c_cpp/src/c/ft.c                                     |  2 +-

mama/c_cpp/src/c/playback/playbackcapture.c               |  2 +-

mama/c_cpp/src/c/playback/playbackpublisher.h             |  7 +++++++

mama/c_cpp/src/c/transport.c                              |  2 +-

mama/c_cpp/src/cpp/MamaQueue.cpp                          |  2 +-

mama/c_cpp/src/cpp/MamaSymbolList.cpp                     | 14 --------------

mama/c_cpp/src/examples/c/mamalistencachedc.c             | 10 +++++-----

mama/c_cpp/src/examples/c/mamaproxyc.c                    |  8 ++++----

mama/c_cpp/src/examples/c/mamasubscriberc.c               |  4 ++--

mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp       |  4 ++--

mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp              |  2 +-

mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c    |  4 ++--

mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c |  6 ++++--

mama/c_cpp/src/testtools/performance/c/mamaproducerc.c    |  4 ++--

mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c |  6 ++++--

16 files changed, 42 insertions(+), 40 deletions(-)

 

diff --git a/mama/c_cpp/src/c/conflation/manager.c b/mama/c_cpp/src/c/conflation/manager.c

index db6b409..9799369 100644

--- a/mama/c_cpp/src/c/conflation/manager.c

+++ b/mama/c_cpp/src/c/conflation/manager.c

@@ -52,6 +52,11 @@ mamaMsg

mamaConflationManagerImpl_getMsg (mamaConflationManager mgr);

 mama_status

+mamaConflationManagerImpl_processData (mamaConflationManager mgr,

+                                       mamaMsg               msg,

+                                       const char*           topic);

+

+mama_status

mamaConflationManager_allocate (mamaConflationManager* mgr)

{

     mamaConflationMgr *impl =

diff --git a/mama/c_cpp/src/c/ft.c b/mama/c_cpp/src/c/ft.c

index c5b2c85..1a1bb78 100644

--- a/mama/c_cpp/src/c/ft.c

+++ b/mama/c_cpp/src/c/ft.c

@@ -668,7 +668,7 @@ mama_status startTimeoutTimer (mamaFtMemberImpl* impl)

 mama_status stopTimeoutTimer (mamaFtMemberImpl* impl)

{

-    mama_status status;

+    mama_status status = MAMA_STATUS_OK;

    mama_log (MAMA_LOG_LEVEL_FINE, "MAMA FT: stopping timeout timer");

     if (impl->myTimeoutTimer)

     {

diff --git a/mama/c_cpp/src/c/playback/playbackcapture.c b/mama/c_cpp/src/c/playback/playbackcapture.c

index 20af14c..a178634 100644

--- a/mama/c_cpp/src/c/playback/playbackcapture.c

+++ b/mama/c_cpp/src/c/playback/playbackcapture.c

@@ -253,7 +253,7 @@ mama_status mamaCapture_saveMamaMsg (mamaPlaybackCapture* mamaCapture,

         strcat (captureBuffer, temp);

         strcat (captureBuffer, delim);

         memset (bufferLength, '\0', LENGTH);

-        sprintf (bufferLength, "%u", bufferSize);

+        sprintf (bufferLength, "%u", (unsigned int)bufferSize);

         strcat (captureBuffer, bufferLength);

         fwrite (captureBuffer, 1, strlen(captureBuffer), myPlaybackFile);

         fputc  ((char)29,myPlaybackFile);

diff --git a/mama/c_cpp/src/c/playback/playbackpublisher.h b/mama/c_cpp/src/c/playback/playbackpublisher.h

index 7eafc66..e507d84 100644

--- a/mama/c_cpp/src/c/playback/playbackpublisher.h

+++ b/mama/c_cpp/src/c/playback/playbackpublisher.h

@@ -168,6 +168,13 @@ extern mama_bool_t

mamaPlayback_findOrCreateTransport (mamaPlaybackPublisher mamaPlayback,

                                     char* transportName,

                                     mamaTransport* transport);

+

+mama_bool_t

+mamaPlayback_findOrCreatePublisher (mamaPlaybackPublisher mamaPlayback,

+                                    char* keyName,

+                                    mamaPublisher* publisher,

+                                    const char delim);

+

/**

  * Method:  mamaplayback_getSymbol

  * @param:  mamaPlaybackPublisher

diff --git a/mama/c_cpp/src/c/transport.c b/mama/c_cpp/src/c/transport.c

index 339dbc0..81434ae 100644

--- a/mama/c_cpp/src/c/transport.c

+++ b/mama/c_cpp/src/c/transport.c

@@ -738,7 +738,7 @@ mamaTransport_create (mamaTransport transport,

                 self->mLoadBalanceHandle = openSharedLib (sharedObjectName, NULL);

                 if (self->mLoadBalanceHandle)

                 {

-                                                                              void*     vp = NULL;

+                    void*   vp = NULL;

                     mama_log (MAMA_LOG_LEVEL_FINER,

                               "Using Library defined load balancing");

                     vp = loadLibFunc ((LIB_HANDLE)self->mLoadBalanceHandle,

diff --git a/mama/c_cpp/src/cpp/MamaQueue.cpp b/mama/c_cpp/src/cpp/MamaQueue.cpp

index ec6ca3d..7119941 100644

--- a/mama/c_cpp/src/cpp/MamaQueue.cpp

+++ b/mama/c_cpp/src/cpp/MamaQueue.cpp

@@ -160,12 +160,12 @@ namespace Wombat

         {

         }

-                              bool                                                                         mOwner;

         void*                     mClosure;

         MamaQueueEnqueueCallback* mEnqueueCallback;

         MamaQueueMonitorCallback* mMonitorCallback;

         void*                     mMonitorCallbackClosure;

         void*                     mUserClosure;

+        bool                      mOwner;

     };

 

diff --git a/mama/c_cpp/src/cpp/MamaSymbolList.cpp b/mama/c_cpp/src/cpp/MamaSymbolList.cpp

index 4f5bdd6..5a00879 100644

--- a/mama/c_cpp/src/cpp/MamaSymbolList.cpp

+++ b/mama/c_cpp/src/cpp/MamaSymbolList.cpp

@@ -149,19 +149,6 @@ namespace Wombat

             return MAMA_STATUS_OK;

         }

-

-        /**

-         * The orderChange callback for the C API

-         */

-        static mama_status MAMACALLTYPE

-        orderChangeHandler (mamaSymbolList list, void *closure)

-        {

-            MamaSymbolList::MamaSymbolListImpl *impl =

-                static_cast<MamaSymbolList::MamaSymbolListImpl*>(closure);

-            impl->invokeOrderChangeHandlers ();

-

-            return MAMA_STATUS_OK;

-        }

     }

 

@@ -177,7 +164,6 @@ namespace Wombat

         mamaSymbolList_setClosure             (myList, myPimpl);

         mamaSymbolList_setAddSymbolHandler    (myList, addMemberHandler);

         mamaSymbolList_setRemoveSymbolHandler (myList, removeMemberHandler);

-        //mamaSymbolList_setOrderChangeHandler  (myList, orderChangeHandler);

     }

     MamaSymbolList::~MamaSymbolList()

diff --git a/mama/c_cpp/src/examples/c/mamalistencachedc.c b/mama/c_cpp/src/examples/c/mamalistencachedc.c

index 8d683b9..9aa6eb0 100644

--- a/mama/c_cpp/src/examples/c/mamalistencachedc.c

+++ b/mama/c_cpp/src/examples/c/mamalistencachedc.c

@@ -1770,7 +1770,7 @@ displayCb (const mamaMsg       msg,

                 const mamaMsgField  field,

                 void*               closure)

{

-    displayField (field, msg, (int)closure);

+    displayField (field, msg, (int)(intptr_t)closure);

}

 void displayAllFields (mamaMsg msg, mamaSubscription subscription, int

@@ -1807,7 +1807,7 @@ void displayAllFields (mamaMsg msg, mamaSubscription subscription, int

     */

     if (gNewIterators == 0)

     {

-        mamaMsg_iterateFields (msg, displayCb, gDictionary, (void*)indentLevel);

+        mamaMsg_iterateFields (msg, displayCb, gDictionary, (void*)(intptr_t)indentLevel);

     }

     else

     {

@@ -1924,7 +1924,7 @@ highWaterMarkCallback (mamaQueue     queue,

     printf ("%s high water mark exceeded. Num events "

             "on queue: %u\n",

-            queueName == NULL ? "" : queueName, size);

+            queueName == NULL ? "" : queueName, (unsigned int)size);

}

 static void MAMACALLTYPE

@@ -1949,7 +1949,7 @@ lowWaterMarkCallback  (mamaQueue     queue,

     }

     printf ("%s low water mark exceeded. Num events on queue: %u\n",

-            queueName == NULL ? "" : queueName, size);

+            queueName == NULL ? "" : queueName, (unsigned int)size);

}

 void setQueueMonitors (mamaQueue queue, int queueIndex)

@@ -2471,7 +2471,7 @@ mama_status printAllCacheFields(mamaFieldCache fieldCache)

     mama_size_t size = 0;

     mamaFieldCache_getSize(fieldCache, &size);

-    printf("Cache size: %u\n", size);

+    printf("Cache size: %u\n", (unsigned int)size);

    

     ret = mamaFieldCacheIterator_create(&cacheIterator, fieldCache);

     while (mamaFieldCacheIterator_hasNext(cacheIterator))

diff --git a/mama/c_cpp/src/examples/c/mamaproxyc.c b/mama/c_cpp/src/examples/c/mamaproxyc.c

index 40ebbb5..24dcfff 100644

--- a/mama/c_cpp/src/examples/c/mamaproxyc.c

+++ b/mama/c_cpp/src/examples/c/mamaproxyc.c

@@ -227,7 +227,7 @@ static void subscribeToSymbols ()

                                  &callbacks,

                                  gSubscriptionSource,

                                  gSymbolList[i],

-                                 (void*)i);

+                                 (void*)(intptr_t)i);

                                gSubscriptionList[i].symbol = gSymbolList[i];

                               mamaMsg_create(&gSubscriptionList[i].cachedMsg);

@@ -351,7 +351,7 @@ subscriptionHandlerOnNewRequestCb (mamaDQPublisherManager manager,

         return;

     }

-    mamaDQPublisherManager_createPublisher (manager, symbol, (void*)i, &gSubscriptionList[i].pub);

+    mamaDQPublisherManager_createPublisher (manager, symbol, (void*)(intptr_t)i, &gSubscriptionList[i].pub);

     printf ("Received new request: %s\n", symbol);

@@ -419,7 +419,7 @@ subscriptionHandlerOnRequestCb (mamaDQPublisherManager manager,

         case MAMA_SUBSC_SNAPSHOT:

             mamaMsg_detach (msg);

             info = (recapInfo*) calloc (1, sizeof(recapInfo));

-            info->index =(int)publishTopicInfo->cache;

+            info->index =(int)(intptr_t)publishTopicInfo->cache;

             info->msg = msg;

             mamaSubscription_getQueue(gSubscriptionList[info->index].sub, &queue);

             mamaQueue_enqueueEvent  (queue,

@@ -432,7 +432,7 @@ subscriptionHandlerOnRequestCb (mamaDQPublisherManager manager,

         case MAMA_SUBSC_DQ_UNKNOWN:

         case MAMA_SUBSC_DQ_GROUP_SUBSCRIBER:

             info = (recapInfo*) calloc (1, sizeof(recapInfo));

-            info->index =(int)publishTopicInfo->cache;

+            info->index =(int)(intptr_t)publishTopicInfo->cache;

             mamaSubscription_getQueue(gSubscriptionList[info->index].sub, &queue);

             mamaQueue_enqueueEvent  (queue,

                              sendRecap,

diff --git a/mama/c_cpp/src/examples/c/mamasubscriberc.c b/mama/c_cpp/src/examples/c/mamasubscriberc.c

index e41dfc7..ee9ef1e 100644

--- a/mama/c_cpp/src/examples/c/mamasubscriberc.c

+++ b/mama/c_cpp/src/examples/c/mamasubscriberc.c

@@ -277,12 +277,12 @@ wildCardMsgCb (mamaSubscription       subscription,

     }

     if (itemClosure == NULL)

     {

-        mamaSubscription_setItemClosure (subscription, (void*)(++i));

+        mamaSubscription_setItemClosure (subscription, (void*)(intptr_t)(++i));

     }

     if (gQuietLevel < 2)

     {

         printf ("Received Wild Card Message with topic %s closure=%d\n", topic,

-            (int)itemClosure);

+            (int)(intptr_t)itemClosure);

     }

     displayMsg (msg);

}

diff --git a/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp b/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp

index b7bd615..f5a65fb 100644

--- a/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp

+++ b/mama/c_cpp/src/examples/cpp/mamalistencachedcpp.cpp

@@ -419,7 +419,7 @@ public:

                                           void* closure)

     {

         printf ("%s queue high water mark exceeded. Size %u\n",

-                queue->getQueueName(), size);

+                queue->getQueueName(), (unsigned int)size);

     }

     virtual void onLowWatermark (MamaQueue* queue,

@@ -427,7 +427,7 @@ public:

                                  void *closure)

     {

         printf ("%s queue low water mark exceeded. Size %u\n",

-                queue->getQueueName(), size);

+                queue->getQueueName(), (unsigned int)size);

     }

private:

     QueueMonitorCallback    (const QueueMonitorCallback& copy);

diff --git a/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp b/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp

index 283382a..b775429 100644

--- a/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp

+++ b/mama/c_cpp/src/examples/cpp/mamaproxycpp.cpp

@@ -140,8 +140,8 @@ private:

     bool                     sendSync;

     int                      mQuietness;

     SubscriptionList         mSubscriptionList;

-    SubscriptionHandler*     managerCallback;

     MamaLogLevel             mMamaLogLevel;

+    SubscriptionHandler*     managerCallback;

     MamaTimer*               syncTimer;

};

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c

index f6bcd6f..51a8bcd 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c

@@ -372,7 +372,7 @@ static void MAMACALLTYPE mc_msgCb

   if ((msgCount - lastMsgCount) >= gIntervalRate)

   {

     gettimeofday(&gNow, NULL);

-    printf ("Rate: %llu\tLatency(usec): Low: %lld\tAverage: %lld\tHigh: %lld\tGaps: %llu\n",

+    printf ("Rate: %" PRIi64 "\tLatency(usec): Low: %" PRIi64 "\tAverage: %" PRIi64 "\tHigh: %" PRIi64 "\tGaps: %" PRIu64 "\n",

            (uint64_t)((float)(msgCount-lastMsgCount)/(((float)((gNow.tv_sec - gLast.tv_sec)*1000000) + (gNow.tv_usec - gLast.tv_usec))/1000000.0f)),

            lowLatency,

            (int64_t)((float)runningLatency/(float)sampleCount),

@@ -443,7 +443,7 @@ static void MAMACALLTYPE mc_msgCb2

     time(&nTime);

     now = localtime(&nTime);

     strftime(nowTime, 100, "%Y/%m/%d - %H:%M:%S", now);

-    printf ("%s Rate: %llu\tLatency(usec): Low: %lld\tAverage: %lld\tHigh: %lld\n",

+    printf ("%s Rate: %" PRIu64 "\tLatency(usec): Low: %" PRIi64 "\tAverage: %" PRIi64 "\tHigh: %" PRIi64 "\n",

             nowTime,

            (uint64_t)((float)(msgCount-lastMsgCount)/(((float)((gNow.tv_sec - gLast.tv_sec)*1000000) + (gNow.tv_usec - gLast.tv_usec))/1000000.0f)),

            lowLatency,

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

index a322fd4..9c2046d 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c

@@ -719,6 +719,7 @@ static void configure_malloc_behavior(void)

     mallopt(M_MMAP_MAX, 0);

}

+/*

static void

 show_new_pagefault_count(const char* logtext,

                   const char* allowed_maj,

@@ -740,7 +741,7 @@ show_new_pagefault_count(const char* logtext,

     last_majflt = usage.ru_majflt;

     last_minflt = usage.ru_minflt;

}

-

+*/

 static void reserve_process_memory(int size)

{

@@ -2450,7 +2451,8 @@ static void subscriptionOnMsg

     int64_t gapSinceDisplay = 0;

     struct timespec ts1,ts2;

     int64_t diff = 0;

-    uint64_t startTsc, endTsc =0;

+    uint64_t startTsc = 0;

+    uint64_t endTsc = 0;

     mama_size_t msgLen;

     symbol* sym = (symbol*)closure;

     statsGroup* lats;

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c b/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c

index 181784d..88948cf 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaproducerc.c

@@ -201,7 +201,7 @@ int main (int argc, const char **argv)

         mp_nanosleep(sleepTime);

       }

       gettimeofday (&now, NULL);

-      printf ("RATE = %llu\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

+      printf ("RATE = %" PRIu64 "\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

       if (gflush)

       {

         fflush(stdout);

@@ -223,7 +223,7 @@ int main (int argc, const char **argv)

         mp_publishMessage (msgNum++, mamaTime, randVal);

       }

       gettimeofday (&now, NULL);

-      printf ("RATE = %llu\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

+      printf ("RATE = %" PRIu64 "\n", (uint64_t)((float)refreshRate/(((float)((now.tv_sec - last.tv_sec)*1000000) + (now.tv_usec - last.tv_usec))/1000000.0f)));

       if (gflush)

      {

         fflush(stdout);

diff --git a/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c b/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

index 8839500..9fc28e0 100644

--- a/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

+++ b/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c

@@ -451,6 +451,7 @@ static void setprio(int prio, int sched)

         perror("sched_setscheduler");

}

+/*

static void

show_new_pagefault_count(const char* logtext,

                   const char* allowed_maj,

@@ -469,6 +470,7 @@ show_new_pagefault_count(const char* logtext,

     last_majflt = usage.ru_majflt;

     last_minflt = usage.ru_minflt;

}

+*/

 static void configure_malloc_behavior(void)

{

@@ -1235,7 +1237,7 @@ static void initializePublishers

)

{

     int i = 0, j = 0, count = 0;

-    publisher* pub;

+    publisher* pub = NULL;

     uint64_t   nsec = gThrottle ? 1000000000/gThrottle : 0;

     char** symbol = gSymbolList;

@@ -1380,7 +1382,7 @@ static void initializePublishers

     if (gUsePlayback)

     {

                mamaPlaybackFileParser_allocate (&gFileParser);

-              mamaPlaybackFileParser_openFile(gFileParser, gPlaybackFilename);

+             mamaPlaybackFileParser_openFile(gFileParser, (char*)gPlaybackFilename);

     }

}

--

1.8.3.1

 


This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange Group, Inc. (ICE), NYSE Euronext or any of their subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.

This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of Intercontinental Exchange, Inc. (ICE), Euronext or any of their subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.