Revision: 7252
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7252&view=rev
Author:   thjc
Date:     2009-01-07 18:40:46 +0000 (Wed, 07 Jan 2009)

Log Message:
-----------
fixed some compiler warnings in p2os.cc

Modified Paths:
--------------
    code/player/branches/release-2-1-patches/server/drivers/mixed/p2os/p2os.cc

Modified: 
code/player/branches/release-2-1-patches/server/drivers/mixed/p2os/p2os.cc
===================================================================
--- code/player/branches/release-2-1-patches/server/drivers/mixed/p2os/p2os.cc  
2009-01-07 18:31:15 UTC (rev 7251)
+++ code/player/branches/release-2-1-patches/server/drivers/mixed/p2os/p2os.cc  
2009-01-07 18:40:46 UTC (rev 7252)
@@ -845,7 +845,12 @@
     if(this->radio_modemp)
     {
       puts("Initializing radio modem...");
-      write(this->psos_fd, "WMS2\r", 5);
+      int ret = write(this->psos_fd, "WMS2\r", 5);
+      if (ret < 5)
+      {
+         PLAYER_ERROR1("P2OS: Write failed to complete (%d)",ret);
+         return 1;
+      }
 
       usleep(50000);
       char modem_buf[50];
@@ -864,7 +869,12 @@
       while(strstr(modem_buf, "ected to addres") == NULL)
       {
         puts("Initializing radio modem...");
-        write(this->psos_fd, "WMS2\r", 5);
+        int ret = write(this->psos_fd, "WMS2\r", 5);
+        if (ret < 5)
+        {
+               PLAYER_ERROR1("P2OS: Failed to write full packet to modem 
(%d)", ret);
+               return 1;
+        }
 
         usleep(50000);
         char modem_buf[50];
@@ -1633,9 +1643,9 @@
     }
 
     if(packet.packet[0] == 0xFA && packet.packet[1] == 0xFB &&
-       (packet.packet[3] == 0x30 || packet.packet[3] == 0x31) ||
-       (packet.packet[3] == 0x32 || packet.packet[3] == 0x33) ||
-       (packet.packet[3] == 0x34))
+       (packet.packet[3] == 0x30 || packet.packet[3] == 0x31 ||
+       packet.packet[3] == 0x32 || packet.packet[3] == 0x33 ||
+       packet.packet[3] == 0x34))
     {
 
       /* It is a server packet, so process it */
@@ -1695,10 +1705,10 @@
       }
     }
     else if(packet.packet[0] == 0xFA && packet.packet[1] == 0xFB &&
-            (packet.packet[3] == 0x50 || packet.packet[3] == 0x80) ||
-//            (packet.packet[3] == 0xB0 || packet.packet[3] == 0xC0) ||
-            (packet.packet[3] == 0xC0) ||
-            (packet.packet[3] == 0xD0 || packet.packet[3] == 0xE0))
+            (packet.packet[3] == 0x50 || packet.packet[3] == 0x80 ||
+//            packet.packet[3] == 0xB0 || packet.packet[3] == 0xC0 ||
+            packet.packet[3] == 0xC0 ||
+            packet.packet[3] == 0xD0 || packet.packet[3] == 0xE0))
     {
       /* It is a vision packet from the old Cognachrome system*/
 
@@ -2369,12 +2379,15 @@
                     imager_config->contrast);
 
     if (imager_config->autogain >= 0)
+    {
       if (imager_config->autogain == 0)
         np += sprintf((char*)&cam_command[np], " 19 32");
       else
         np += sprintf((char*)&cam_command[np], " 19 33");
+    }
 
     if (imager_config->colormode >= 0)
+    {
       if (imager_config->colormode == 3)
         np += sprintf((char*)&cam_command[np], " 18 36");
       else if (imager_config->colormode == 2)
@@ -2383,6 +2396,7 @@
         np += sprintf((char*)&cam_command[np], " 18 44");
       else
         np += sprintf((char*)&cam_command[np], " 18 40");
+    }
 
     if (np > 6)
     {


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

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to