mitar avatar mitar committed abec240

Removed some compiler warnings.

Comments (0)

Files changed (2)

lib/Robotics/NXT/BluetoothUtils.hs

 
 import Control.Exception
 import Control.Monad.State
+#ifdef linux_HOST_OS
 import Foreign.C.String
 import Foreign.C.Types
+#endif
 
 import Robotics.NXT.Errors
 import Robotics.NXT.Protocol
 
 -- Foreign function call for C function which returns link quality Bluetooth value of a connection to a given Bluetooth address
 foreign import ccall unsafe "lq" lq :: CString -> IO CInt
-#endif
 
 -- As defined in blue.h
 blueError :: Int
 blueError = 1000
 blueNotConnected :: Int
 blueNotConnected = 1001
+#endif
 
 {-|
 Gets received signal strength indicator (RSSI) of the Bluetooth connection to the NXT brick.
   bluetoothRSSIAddr addr
 
 bluetoothRSSIAddr :: BTAddress -> NXT Int
+#ifdef linux_HOST_OS
 bluetoothRSSIAddr addr = do
-#ifdef linux_HOST_OS
   ret <- liftIO $ withCString addr rssi
   let ret' = fromIntegral ret
   case ret' of
       | ret' == blueNotConnected -> liftIO $ throwIO $ NXTException "Connection not established"
       | otherwise                -> return ret'
 #else
+bluetoothRSSIAddr _ = do
     liftIO $ throwIO $ NXTException "Not supported on this system"
 #endif
 
   bluetoothLinkQualityAddr addr
 
 bluetoothLinkQualityAddr :: BTAddress -> NXT Int
+#ifdef linux_HOST_OS
 bluetoothLinkQualityAddr addr = do
-#ifdef linux_HOST_OS
   ret <- liftIO $ withCString addr lq
   let ret' = fromIntegral ret
   case ret' of
       | ret' == blueNotConnected -> liftIO $ throwIO $ NXTException "Connection not established"
       | otherwise                -> return ret'
 #else
+bluetoothLinkQualityAddr _ = do
   liftIO $ throwIO $ NXTException "Not supported on this system"
 #endif
 
 
   let Device device = fromMaybe (Device defaultDevice) . find isDevice $ opts
 
-  putStrLn "Please connect a motor to port A, a swich sensor to port 1, an ultrasonic sensor to port 2, and press enter key to continue."
+  putStrLn "Please connect a motor to port A, a switch sensor to port 1, an ultrasonic sensor to port 2, and press enter key to continue."
 
   _ <- try getLine :: IO (Either IOException String)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.