[PATCH 4/4] [avis] Whitespace Merging


Ian Bell <IBell@...>
 

From f7e1103527576136f0c6d40a9c0ec3fcc1d3deed Mon Sep 17 00:00:00 2001

Message-Id: <f7e1103527576136f0c6d40a9c0ec3fcc1d3deed.1347023434.git.ibell@...>

In-Reply-To: <05eedcf18f3140b743286fadc59a46c032647ac9.1347023434.git.ibell@...>

References: <05eedcf18f3140b743286fadc59a46c032647ac9.1347023434.git.ibell@...>

From: Ian Bell <ibell@...>

Date: Fri, 7 Sep 2012 13:53:30 +0100

Subject: [PATCH 4/4] [avis] Whitespace Merging

 

Code tidy up has led to whitespace differences between the OpenMAMA

and enterprise versions of the avis bridge.  These are resolved with

this patch

 

Signed-off-by: Ian Bell <ibell@...>

---

mama/c_cpp/src/c/bridge/avis/bridge.c          |   31 ++++++++++++++----------

mama/c_cpp/src/c/bridge/avis/msg.c             |    5 ++--

mama/c_cpp/src/c/bridge/avis/publisher.c       |   11 ++++++---

mama/c_cpp/src/c/bridge/avis/queue.c           |    6 +++++

mama/c_cpp/src/c/bridge/avis/sub.c             |    6 +++--

mama/c_cpp/src/c/bridge/avis/subinitial.c      |    2 +-

mama/c_cpp/src/c/bridge/avis/transportbridge.c |   14 ++++++-----

7 files changed, 47 insertions(+), 28 deletions(-)

 

diff --git a/mama/c_cpp/src/c/bridge/avis/bridge.c b/mama/c_cpp/src/c/bridge/avis/bridge.c

index b08eee9..20c8e43 100755

--- a/mama/c_cpp/src/c/bridge/avis/bridge.c

+++ b/mama/c_cpp/src/c/bridge/avis/bridge.c

@@ -37,6 +37,7 @@ void avisBridge_createImpl (mamaBridge* result)

{

     avisBridgeImpl* avisBridge = NULL;

     mamaBridgeImpl* impl = NULL;

+   

     if (!result) return;

     *result = NULL;

@@ -79,7 +80,7 @@ avisBridge_getDefaultPayloadId (char***name, char** id)

               *name = PAYLOAD_NAMES;

               *id = PAYLOAD_IDS;

-     return MAMA_STATUS_OK;

+    return MAMA_STATUS_OK;

}

 

@@ -90,6 +91,7 @@ avisBridge_open (mamaBridge bridgeImpl)

     mamaBridgeImpl* impl =  (mamaBridgeImpl*)bridgeImpl;

     wsocketstartup();

+   

     mama_log (MAMA_LOG_LEVEL_FINEST, "avisBridge_open(): Entering.");

     if (MAMA_STATUS_OK !=

@@ -126,32 +128,34 @@ avisBridge_open (mamaBridge bridgeImpl)

mama_status

avisBridge_close (mamaBridge bridgeImpl)

{

-   mama_status     status = MAMA_STATUS_OK;

-   mamaBridgeImpl* impl   = NULL;

-   mama_log (MAMA_LOG_LEVEL_FINEST, "avisBridge_close(): Entering.");

+    mama_status     status = MAMA_STATUS_OK;

+    mamaBridgeImpl* impl   = NULL;

+   

+    mama_log (MAMA_LOG_LEVEL_FINEST, "avisBridge_close(): Entering.");

-   impl =  (mamaBridgeImpl*)bridgeImpl;

+    impl =  (mamaBridgeImpl*)bridgeImpl;

 

-   if (0 != destroyHeap (gTimerHeap))

-   {

+    if (0 != destroyHeap (gTimerHeap))

+    {

         mama_log (MAMA_LOG_LEVEL_ERROR, "avisBridge_close():"

                 "Failed to destroy Avis timer heap.");

         status = MAMA_STATUS_PLATFORM;

-   }

+    }

-   mamaQueue_destroyWait(impl->mDefaultEventQueue);

+    mamaQueue_destroyWait(impl->mDefaultEventQueue);

-   free (impl);

+    free (impl);

+   

     wsocketcleanup();

-   return status;

+    return status;

}

 

 mama_status

avisBridge_start(mamaQueue defaultEventQueue)

{

-    mama_status status = MAMA_STATUS_OK;

+    mama_status     status     = MAMA_STATUS_OK;

     avisBridgeImpl* avisBridge = NULL;

     mama_log (MAMA_LOG_LEVEL_FINER, "avisBridge_start(): Start dispatching on default event queue.");

@@ -173,10 +177,11 @@ avisBridge_start(mamaQueue defaultEventQueue)

mama_status

avisBridge_stop(mamaQueue defaultEventQueue)

{

-    mama_status status = MAMA_STATUS_OK;

+    mama_status     status     = MAMA_STATUS_OK;

     avisBridgeImpl* avisBridge = NULL;

     mama_log (MAMA_LOG_LEVEL_FINER, "avisBridge_stop(): Stopping bridge.");

+

     if (MAMA_STATUS_OK != (status = mamaBridgeImpl_getClosure((mamaBridge) mamaQueueImpl_getBridgeImpl(defaultEventQueue), (void**) &avisBridge))) {

         mama_log (MAMA_LOG_LEVEL_ERROR, "avisBridge_stop(): Could not get Elvin object");

         return status;

diff --git a/mama/c_cpp/src/c/bridge/avis/msg.c b/mama/c_cpp/src/c/bridge/avis/msg.c

index d4132b2..346598e 100644

--- a/mama/c_cpp/src/c/bridge/avis/msg.c

+++ b/mama/c_cpp/src/c/bridge/avis/msg.c

@@ -134,8 +134,8 @@ avisBridgeMamaMsg_isFromInbox (msgBridge msg)

 mama_status

avisBridgeMamaMsg_setSendSubject (msgBridge   msg,

-                                   const char* symbol,

-                                   const char* subject)

+                                  const char* symbol,

+                                  const char* subject)

{

     mama_status status = MAMA_STATUS_OK;

     CHECK_MSG(msg);

@@ -165,6 +165,7 @@ avisBridgeMamaMsg_duplicateReplyHandle (msgBridge msg, void** result)

{

     const char* replyAddr;

     mama_status status = MAMA_STATUS_OK;

+

     CHECK_MSG(msg);

     if (MAMA_STATUS_OK != (status = mamaMsg_getString(avisMsg(msg)->mParent, INBOX_FIELD_NAME, 0, &replyAddr))) {

         return status;

diff --git a/mama/c_cpp/src/c/bridge/avis/publisher.c b/mama/c_cpp/src/c/bridge/avis/publisher.c

index c19c732..1f6d598 100644

--- a/mama/c_cpp/src/c/bridge/avis/publisher.c

+++ b/mama/c_cpp/src/c/bridge/avis/publisher.c

@@ -71,6 +71,7 @@ avisBridgeMamaPublisher_createByIndex (publisherBridge* result,

     avisPublisherBridge* publisher = NULL;

     if (!result || !tport) return MAMA_STATUS_NULL_ARG;

+

     CHECK_AVIS(avis);

     *result = NULL;

@@ -176,10 +177,10 @@ avisBridgeMamaPublisher_sendReplyToInbox (publisherBridge  publisher,

                                            mamaMsg          request,

                                            mamaMsg          reply)

{

-    Attributes* requestMsg = NULL;

-    Attributes* replyMsg = NULL;

+    Attributes*  requestMsg = NULL;

+    Attributes*  replyMsg   = NULL;

     const char*  replyAddr  = NULL;

-    mama_size_t        dataLen;

+    mama_size_t  dataLen;

     mama_status  status;

    

     CHECK_PUBLISHER(publisher);

@@ -230,7 +231,8 @@ avisBridgeMamaPublisher_sendFromInboxByIndex (publisherBridge publisher,

{

     const char* replyAddr = NULL;

     mama_status status;

-  //  CHECK_PUBLISHER(publisher);

+

+    //  CHECK_PUBLISHER(publisher);

     if (avisPublisher(publisher) == 0)

                return MAMA_STATUS_NULL_ARG;

     if (avisPublisher(publisher)->mAvis == 0)

@@ -264,6 +266,7 @@ avisBridgeMamaPublisher_sendReplyToInboxHandle (publisherBridge publisher,

                                                mamaMsg         reply)

{

     mama_status status;

+

     CHECK_PUBLISHER(publisher);

     status = mamaMsg_updateString(reply, SUBJECT_FIELD_NAME, 0, (const char*) inbox);

diff --git a/mama/c_cpp/src/c/bridge/avis/queue.c b/mama/c_cpp/src/c/bridge/avis/queue.c

index cb73902..952a644 100644

--- a/mama/c_cpp/src/c/bridge/avis/queue.c

+++ b/mama/c_cpp/src/c/bridge/avis/queue.c

@@ -52,6 +52,7 @@ avisBridgeMamaQueue_create (queueBridge* queue,

                             mamaQueue    parent)

{

     avisQueueBridge* avisQueue = NULL;

+

     if (queue == NULL)

         return MAMA_STATUS_NULL_ARG;

     *queue = NULL;

@@ -76,6 +77,7 @@ avisBridgeMamaQueue_create_usingNative (queueBridge* queue,

                                         void*        nativeQueue)

{

     avisQueueBridge* avisQueue = NULL;

+   

     if (queue == NULL)

         return MAMA_STATUS_NULL_ARG;

     *queue = NULL;

@@ -109,6 +111,7 @@ avisBridgeMamaQueue_dispatch (queueBridge queue)

     wombatQueueStatus status;

     CHECK_QUEUE(queue);

+

     do

     {

         /* 500 is .5 seconds */

@@ -135,6 +138,7 @@ mama_status

avisBridgeMamaQueue_timedDispatch (queueBridge queue, uint64_t timeout)

{

     wombatQueueStatus status;

+   

     CHECK_QUEUE(queue);

     status = wombatQueue_timedDispatch (avisQueue(queue)->mQueue,

@@ -157,6 +161,7 @@ mama_status

avisBridgeMamaQueue_dispatchEvent (queueBridge queue)

{

     wombatQueueStatus status;

+

     CHECK_QUEUE(queue);

     status = wombatQueue_dispatch (avisQueue(queue)->mQueue,

@@ -189,6 +194,7 @@ avisBridgeMamaQueue_enqueueEvent (queueBridge        queue,

{

     wombatQueueStatus status;

     avisQueueClosure* cl = NULL;

+   

     CHECK_QUEUE(queue);

     cl = (avisQueueClosure*)calloc(1, sizeof(avisQueueClosure));

diff --git a/mama/c_cpp/src/c/bridge/avis/sub.c b/mama/c_cpp/src/c/bridge/avis/sub.c

index 26f345f..a670cc3 100644

--- a/mama/c_cpp/src/c/bridge/avis/sub.c

+++ b/mama/c_cpp/src/c/bridge/avis/sub.c

@@ -199,6 +199,7 @@ avisBridgeMamaSubscription_create (subscriptionBridge* subscriber,

                                     void*               closure)

{

     avisSubscription* impl = NULL;

+   

     if (!subscriber || !subscription || !transport )

         return MAMA_STATUS_NULL_ARG;

@@ -271,6 +272,7 @@ avisBridgeMamaSubscription_destroy (subscriptionBridge subscriber)

{

     mama_status status = MAMA_STATUS_OK;

     wombatQueue   queue = NULL;

+

     CHECK_SUBSCRIBER(subscriber);

     elvin_subscription_remove_listener(avisSub(subscriber)->mAvisSubscription, avis_callback);

@@ -317,7 +319,7 @@ avisBridgeMamaSubscription_isValid (subscriptionBridge subscriber)

 mama_status

avisBridgeMamaSubscription_getPlatformError (subscriptionBridge subscriber,

-                                              void**             error)

+                                             void**             error)

{

     CHECK_SUBSCRIBER(subscriber);

     *error = &(avisSub(subscriber)->mAvis->error);

@@ -326,7 +328,7 @@ avisBridgeMamaSubscription_getPlatformError (subscriptionBridge subscriber,

 mama_status

avisBridgeMamaSubscription_setTopicClosure (subscriptionBridge subscriber,

-                                             void* closure)

+                                            void* closure)

{

     return MAMA_STATUS_NOT_IMPLEMENTED;

}

diff --git a/mama/c_cpp/src/c/bridge/avis/subinitial.c b/mama/c_cpp/src/c/bridge/avis/subinitial.c

index 230c8e3..b230f33 100644

--- a/mama/c_cpp/src/c/bridge/avis/subinitial.c

+++ b/mama/c_cpp/src/c/bridge/avis/subinitial.c

@@ -20,7 +20,6 @@

  */

 #include <wombat/wUuid.h>

-

#include <mama/mama.h>

#include <bridge.h>

#include <string.h>

@@ -112,6 +111,7 @@ avisBridgeMamaInbox_createByIndex (inboxBridge*           bridge,

    mamaMsgCallbacks cb;

    avisInboxImpl* impl = NULL;

    mama_status status = MAMA_STATUS_OK;

+

    if (!bridge || !transport || !queue || !msgCB) return MAMA_STATUS_NULL_ARG;

    impl = (avisInboxImpl*)calloc(1, sizeof(avisInboxImpl));

    if (!impl)

diff --git a/mama/c_cpp/src/c/bridge/avis/transportbridge.c b/mama/c_cpp/src/c/bridge/avis/transportbridge.c

index 897f1ee..f274ee7 100755

--- a/mama/c_cpp/src/c/bridge/avis/transportbridge.c

+++ b/mama/c_cpp/src/c/bridge/avis/transportbridge.c

@@ -40,10 +40,10 @@

 #define avisTransport(transport) ((avisTransportBridge*) transport)

#define CHECK_TRANSPORT(transport) \

-   do {  \

-      if (avisTransport(transport) == 0) return MAMA_STATUS_NULL_ARG; \

-      if (avisTransport(transport)->mAvis == 0) return MAMA_STATUS_INVALID_ARG;\

-    } while(0)

+        do {  \

+           if (avisTransport(transport) == 0) return MAMA_STATUS_NULL_ARG; \

+           if (avisTransport(transport)->mAvis == 0) return MAMA_STATUS_INVALID_ARG; \

+         } while(0)

 

 

@@ -103,6 +103,7 @@ getURL( const char *name )

     int len = 0;

     char* buff = NULL;

     const char* property = NULL;

+   

     if (name == NULL)

         return NULL;

@@ -150,6 +151,7 @@ mama_status avisTransportBridge_start(avisTransportBridge* transportBridge)

    /* stop Avis event loop */

    wthread_t tid;

    int rc;

+  

    CHECK_TRANSPORT(transportBridge);

 

    rc = wthread_create(&tid, NULL, avisDispatchThread, transportBridge);

@@ -228,7 +230,7 @@ avisBridgeMamaTransport_create (transportBridge* result,

     mamaBridgeImpl*      bridgeImpl = NULL;

     const char*          url        = NULL;

     

-    transport = (avisTransportBridge*)calloc( 1, sizeof( avisTransportBridge ));

+    transport = (avisTransportBridge*)calloc( 1, sizeof( avisTransportBridge ) );

     if (transport == NULL)

         return MAMA_STATUS_NOMEM;

@@ -252,6 +254,7 @@ avisBridgeMamaTransport_create (transportBridge* result,

         free(transport);

         return status;

     }

+

     if (avisBridge->mTransportBridge != NULL)

     {

         mama_log (MAMA_LOG_LEVEL_ERROR,

@@ -332,7 +335,6 @@ avisBridgeMamaTransport_destroy (transportBridge transport)

     return MAMA_STATUS_OK;

}

-

int

avisBridgeMamaTransport_isValid (transportBridge transport)

{

--

1.7.9.5

 




Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.