Revision: 44663
          http://brlcad.svn.sourceforge.net/brlcad/?rev=44663&view=rev
Author:   davidloman
Date:     2011-05-24 17:39:25 +0000 (Tue, 24 May 2011)

Log Message:
-----------
Formatting.  Tabs/indent/newlines.

Modified Paths:
--------------
    geomcore/trunk/src/GS/GSClient.cxx

Modified: geomcore/trunk/src/GS/GSClient.cxx
===================================================================
--- geomcore/trunk/src/GS/GSClient.cxx  2011-05-24 17:38:16 UTC (rev 44662)
+++ geomcore/trunk/src/GS/GSClient.cxx  2011-05-24 17:39:25 UTC (rev 44663)
@@ -66,99 +66,104 @@
 bool
 GSClient::handleNetMsg(NetMsg* msg)
 {
-    uint16_t type = msg->getMsgType();
-    char buf[BUFSIZ];
+  uint16_t type = msg->getMsgType();
+  char buf[BUFSIZ];
 
-    switch(type) {
-       case SESSIONINFO:
-           {
-               std::string data =((SessionInfoMsg*)msg)->toString();
-               log->logINFO("GSClient", "Recv'ed SessionInfo: " + data);
-               return true;
-           }
-       case FAILURE:
-           {
-               FailureMsg* fMsg = (FailureMsg*)msg;
-               uint8_t fc = fMsg->getFailureCode();
+  switch (type)
+    {
+  case SESSIONINFO:
+    {
+      std::string data = ((SessionInfoMsg*) msg)->toString();
+      log->logINFO("GSClient", "Recv'ed SessionInfo: " + data);
+      return true;
+    }
+  case FAILURE:
+    {
+      FailureMsg* fMsg = (FailureMsg*) msg;
+      uint8_t fc = fMsg->getFailureCode();
 
-               GSUuid* re = fMsg->getReUUID();
+      GSUuid* re = fMsg->getReUUID();
 
-               snprintf(buf, BUFSIZ, "Recv'ed A FailureMsg with code: %d 
(%x)", fc, fc);
-               log->logINFO("GSClient", buf);
-               return true;
-           }
-       case PING:
-           {
-               Portal* p = msg->getOrigin();
-               PingMsg* pingMsg = (PingMsg*)msg;
+      snprintf(buf, BUFSIZ, "Recv'ed A FailureMsg with code: %d (%x)", fc, fc);
+      log->logINFO("GSClient", buf);
+      return true;
+    }
+  case PING:
+    {
+      Portal* p = msg->getOrigin();
+      PingMsg* pingMsg = (PingMsg*) msg;
 
-               std::stringstream ss;
+      std::stringstream ss;
 
-               std::string remNodeName("unknown");
-               if (p != NULL)
-                   remNodeName = p->getRemoteNodeName();
+      std::string remNodeName("unknown");
+      if (p != NULL)
+        remNodeName = p->getRemoteNodeName();
 
-               ss << "PING from: '" << remNodeName << "' ";
-               ss << "Start Time: " << pingMsg->getStartTime();
+      ss << "PING from: '" << remNodeName << "' ";
+      ss << "Start Time: " << pingMsg->getStartTime();
 
-               log->logINFO("GeometryService", ss.str());
+      log->logINFO("GeometryService", ss.str());
 
-               if (p != NULL) {
-                   PongMsg pongMsg((PingMsg*)msg);
-                   p->send(&pongMsg);
-               } else {
-                   log->logINFO("GeometryService", "Can't return ping.  NULL 
Portal*");
-               }
+      if (p != NULL)
+        {
+          PongMsg pongMsg((PingMsg*) msg);
+          p->send(&pongMsg);
+        }
+      else
+        {
+          log->logINFO("GeometryService", "Can't return ping.  NULL Portal*");
+        }
 
-               return true;
-           }
-       case PONG:
-           {
-               Portal* p = msg->getOrigin();
-               PongMsg* pongMsg = (PongMsg*)msg;
+      return true;
+    }
+  case PONG:
+    {
+      Portal* p = msg->getOrigin();
+      PongMsg* pongMsg = (PongMsg*) msg;
 
-               /* calc current and differential times */
-               uint64_t start = pongMsg->getStartTime();
-               uint64_t now = Logger::getCurrentTime();
-               uint64_t diff = now - start;
+      /* calc current and differential times */
+      uint64_t start = pongMsg->getStartTime();
+      uint64_t now = Logger::getCurrentTime();
+      uint64_t diff = now - start;
 
-               std::string remNodeName("unknown");
+      std::string remNodeName("unknown");
 
-               if (p != NULL)
-                   remNodeName = p->getRemoteNodeName();
+      if (p != NULL)
+        remNodeName = p->getRemoteNodeName();
 
-               std::stringstream ss;
-               ss << "PONG from: '" << remNodeName << "' ";
-               ss << " Start: " << start;
-               ss << " Now: " << now;
-               ss << " Diff: " << diff;
+      std::stringstream ss;
+      ss << "PONG from: '" << remNodeName << "' ";
+      ss << " Start: " << start;
+      ss << " Now: " << now;
+      ss << " Diff: " << diff;
 
-               log->logINFO("GSClient", ss.str());
-               return true;
-           }
+      log->logINFO("GSClient", ss.str());
+      return true;
+    }
 
-       case GEOMETRYMANIFEST:
-               {
-                       GeometryManifestMsg* man = (GeometryManifestMsg*)msg;
+  case GEOMETRYMANIFEST:
+    {
+      GeometryManifestMsg* man = (GeometryManifestMsg*) msg;
 
-                       std::string str;
-                       std::stringstream ss;
-                        ss << "Got manifest of " << man->getNumOfItems() << " 
items.";
-                        log->logINFO("GSClient", ss.str());
+      std::string str;
+      std::stringstream ss;
+      ss << "Got manifest of " << man->getNumOfItems() << " items.";
+      log->logINFO("GSClient", ss.str());
 
-                       // build manifest & Chunks to send
-                       std::list<std::string>* items = man->getItemData();
-                       for (std::list<std::string>::iterator it = 
items->begin(); it
-                                       != items->end(); it++) {
-                               str = *it;
-                               std::cout << "  '" << str << ",\n";
-                       }
-                       std::cout << std::endl;
+      // build manifest & Chunks to send
+      std::list<std::string>* items = man->getItemData();
+      for (std::list<std::string>::iterator it = items->begin(); it
+          != items->end(); it++)
+        {
+          str = *it;
+          std::cout << "  '" << str << ",\n";
+        }
+      std::cout << std::endl;
 
-                        log->logINFO("GSClient", ss.str());
+      log->logINFO("GSClient", ss.str());
 
-                       return false;
-               }
+      return false;
+    }
   case GEOMETRYCHUNK:
     {
       GeometryChunkMsg* chunk = (GeometryChunkMsg*) msg;
@@ -167,12 +172,14 @@
       /* Get object name  */
       struct db5_raw_internal raw;
       if (db5_get_raw_internal_ptr(&raw, (const unsigned char *) bb->array())
-          == NULL) {
+          == NULL)
+        {
           bu_log("Corrupted serialized geometry?  Could not deserialize.\n");
           return false;
         }
 
-      if (raw.name.ext_nbytes < 1) {
+      if (raw.name.ext_nbytes < 1)
+        {
           bu_log("Failed to retrieve object name.  Could not deserialize.\n");
           return false;
         }
@@ -184,9 +191,9 @@
 
       delete bb;
       return true;
-      }
     }
-    return false;
+    }
+  return false;
 }
 
 PortalManager*


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to