[commit] r2090 - Fix sqWin32SerialPort.c to compile again.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] r2090 - Fix sqWin32SerialPort.c to compile again.

commits-3
 
Author: andreas
Date: 2009-08-25 22:23:21 -0700 (Tue, 25 Aug 2009)
New Revision: 2090

Modified:
   trunk/platforms/win32/plugins/SerialPlugin/sqWin32SerialPort.c
Log:
Fix sqWin32SerialPort.c to compile again.

Modified: trunk/platforms/win32/plugins/SerialPlugin/sqWin32SerialPort.c
===================================================================
--- trunk/platforms/win32/plugins/SerialPlugin/sqWin32SerialPort.c 2009-08-26 05:00:02 UTC (rev 2089)
+++ trunk/platforms/win32/plugins/SerialPlugin/sqWin32SerialPort.c 2009-08-26 05:23:21 UTC (rev 2090)
@@ -41,7 +41,7 @@
 }  
 
 /* port number derived from "COMn" name */
-int portNumberForName(char *portName)
+int portNumberForName(const char *portName)
 {
   if ((strlen(portName) < 4)
         || (strncmp(portName, "COM", 3)
@@ -49,7 +49,7 @@
   {
     return -1;
   } else {
-    char *p = portName + 3;
+    const char *p = portName + 3;
     return atoi(p);
   }
 }
@@ -186,24 +186,24 @@
   return 0;
 }
 
-int serialPortOpenByName(char *portName, int dataRate, int stopBitsType,
+int serialPortOpenByName(char *portName, int baudRate, int stopBitsType,
                    int parityType, int dataBits, int inFlowCtrl,
                    int outFlowCtrl, int xOnChar, int xOffChar)
 {
   int portNum = portNumberForName(portName);
-  if (portNum < 0)
-  { success(false);
+  if (portNum < 0) {
+    success(false);
     return 0;
   }
   return serialPortOpen(portNum, baudRate, stopBitsType, parityType,
-                   dataBits, inFlowCtrl, outFlowCtrl, xOnChar, xOffChar)
+ dataBits, inFlowCtrl, outFlowCtrl, xOnChar, xOffChar);
 }
 
 /* Read up to count bytes from the given serial port into the given byte array.
    Read only up to the number of bytes in the port's input buffer; if fewer bytes
    than count have been received, do not wait for additional data to arrive.
    Return zero if no data is available. */
-int serialPortReadInto(int portNum, int count, void *startPtr);
+int serialPortReadInto(int portNum, int count, void *startPtr)
 { DWORD cbReallyRead;
 
   if(!isValidComm(portNum)) return 0;
@@ -257,7 +257,7 @@
   { success(false);
     return 0;
   }
-  return serialPortWriteFrom(portNum, count, startPtr)
+  return serialPortWriteFrom(portNum, count, startPtr);
 }
 
 int serialPortInit(void)