[commit: hsc2hs] master: M-x untabify & M-x delete-trailing-whitespace (7fa9c38)

git at git.haskell.org git at git.haskell.org
Sat Dec 27 22:24:13 UTC 2014


Repository : ssh://git@git.haskell.org/hsc2hs

On branch  : master
Link       : http://git.haskell.org/hsc2hs.git/commitdiff/7fa9c384bbc3546315bf5af45590b64ca550b7ce

>---------------------------------------------------------------

commit 7fa9c384bbc3546315bf5af45590b64ca550b7ce
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Dec 27 23:21:44 2014 +0100

    M-x untabify & M-x delete-trailing-whitespace


>---------------------------------------------------------------

7fa9c384bbc3546315bf5af45590b64ca550b7ce
 C.hs             | 25 ++++++++++++-------------
 Common.hs        |  1 -
 DirectCodegen.hs |  3 +--
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/C.hs b/C.hs
index 11d31f2..c6a7e5e 100644
--- a/C.hs
+++ b/C.hs
@@ -152,18 +152,18 @@ outTokenC (pos, key, arg) =
             's':'t':'r':'u':'c':'t':' ':_ -> ""
             't':'y':'p':'e':'d':'e':'f':' ':_ -> ""
             'i':'n':'l':'i':'n':'e':' ':arg' ->
-		case span (\c -> c /= '{' && c /= '=') arg' of
-		(header, body) ->
-		    outCLine pos++
-		    "#ifndef __GNUC__\n" ++
-		    "extern inline\n" ++
-		    "#endif\n"++
-		    header++
-		    "\n#ifndef __GNUC__\n" ++
-		    ";\n" ++
-		    "#else\n"++
-		    body++
-		    "\n#endif\n"
+                case span (\c -> c /= '{' && c /= '=') arg' of
+                (header, body) ->
+                    outCLine pos++
+                    "#ifndef __GNUC__\n" ++
+                    "extern inline\n" ++
+                    "#endif\n"++
+                    header++
+                    "\n#ifndef __GNUC__\n" ++
+                    ";\n" ++
+                    "#else\n"++
+                    body++
+                    "\n#endif\n"
             _ -> outCLine pos++arg++"\n"
         _ | conditional key -> outCLine pos++"#"++key++" "++arg++"\n"
         _ -> ""
@@ -207,4 +207,3 @@ showCString = concatMap showCChar
                       intToDigit (ord c `quot` 64),
                       intToDigit (ord c `quot` 8 `mod` 8),
                       intToDigit (ord c          `mod` 8)]
-
diff --git a/Common.hs b/Common.hs
index 7b33093..ae11241 100644
--- a/Common.hs
+++ b/Common.hs
@@ -66,4 +66,3 @@ catchIO = Exception.catch
 
 onlyOne :: String -> IO a
 onlyOne what = die ("Only one "++what++" may be specified\n")
-
diff --git a/DirectCodegen.hs b/DirectCodegen.hs
index 42b31a5..c6f428d 100644
--- a/DirectCodegen.hs
+++ b/DirectCodegen.hs
@@ -31,7 +31,7 @@ outputDirect config outName outDir outBase name toks = do
 -- via GHC has changed a few times, so this seems to be the only way...  :-P * * *
                           ++ ".exe"
 #endif
-	outHFile     = outBase++"_hsc.h"
+        outHFile     = outBase++"_hsc.h"
         outHName     = outDir++outHFile
         outCName     = outDir++outBase++"_hsc.c"
 
@@ -107,4 +107,3 @@ outputDirect config outName outDir outBase name toks = do
             concatMap outTokenC specials
             -- NB. outHFile not outHName; works better when processed
             -- by gcc or mkdependC.
-



More information about the ghc-commits mailing list