fix all remaining -Wall warnings on Windows

This commit is contained in:
Joey Hess 2014-02-25 14:09:39 -04:00
parent 360ecb9f35
commit 3f6e4b8c7c
13 changed files with 57 additions and 44 deletions

View file

@ -27,7 +27,6 @@ import qualified Git.Command
import qualified Git.Config
import Utility.ThreadScheduler
import qualified Assistant.Threads.Watcher as Watcher
import Utility.LogFile
import Utility.Batch
import Utility.NotificationBroadcaster
import Config
@ -43,6 +42,9 @@ import qualified Annex
#ifdef WITH_WEBAPP
import Assistant.WebApp.Types
#endif
#ifndef mingw32_HOST_OS
import Utility.LogFile
#endif
import Data.Time.Clock.POSIX
import qualified Data.Text as T
@ -214,10 +216,10 @@ checkLogSize n = do
checkLogSize $ n + 1
where
filesize f = fromIntegral . fileSize <$> liftIO (getFileStatus f)
#endif
oneMegabyte :: Int
oneMegabyte = 1000000
oneMegabyte :: Int
oneMegabyte = 1000000
#endif
oneHour :: Int
oneHour = 60 * 60

View file

@ -23,7 +23,6 @@ import Assistant.Types.Changes
import Assistant.Alert
import Utility.DirWatcher
import Utility.DirWatcher.Types
import qualified Utility.Lsof as Lsof
import qualified Annex
import qualified Annex.Queue
import qualified Git
@ -40,6 +39,9 @@ import Annex.ReplaceFile
import Git.Types
import Config
import Utility.ThreadScheduler
#ifndef mingw32_HOST_OS
import qualified Utility.Lsof as Lsof
#endif
import Data.Bits.Utils
import Data.Typeable

View file

@ -114,9 +114,9 @@ checkRepositoryPath p = do
- browsed to a directory with git-annex and run it from there. -}
defaultRepositoryPath :: Bool -> IO FilePath
defaultRepositoryPath firstrun = do
cwd <- liftIO getCurrentDirectory
home <- myHomeDir
#ifndef mingw32_HOST_OS
home <- myHomeDir
cwd <- liftIO getCurrentDirectory
if home == cwd && firstrun
then inhome
else ifM (legit cwd <&&> canWrite cwd)
@ -127,7 +127,7 @@ defaultRepositoryPath firstrun = do
-- On Windows, always default to ~/Desktop/annex or ~/annex,
-- no cwd handling because the user might be able to write
-- to the entire drive.
inhome
if firstrun then inhome else inhome
#endif
where
inhome = do
@ -136,9 +136,11 @@ defaultRepositoryPath firstrun = do
( relHome $ desktop </> gitAnnexAssistantDefaultDir
, return $ "~" </> gitAnnexAssistantDefaultDir
)
#ifndef mingw32_HOST_OS
-- Avoid using eg, standalone build's git-annex.linux/ directory
-- when run from there.
legit d = not <$> doesFileExist (d </> "git-annex")
#endif
newRepositoryForm :: FilePath -> Hamlet.Html -> MkMForm RepositoryPath
newRepositoryForm defpath msg = do

View file

@ -12,7 +12,6 @@ module Assistant.WebApp.Configurators.Pairing where
import Assistant.Pairing
import Assistant.WebApp.Common
import Assistant.WebApp.Configurators
import Assistant.Types.Buddies
import Annex.UUID
#ifdef WITH_PAIRING
@ -34,6 +33,9 @@ import Assistant.NetMessager
import Assistant.WebApp.RepoList
import Assistant.WebApp.Configurators.XMPP
#endif
#if defined(WITH_PAIRING) || defined(WITH_XMP)
import Assistant.WebApp.Configurators
#endif
import Utility.UserInfo
import Git