hlint: use CamelCase for printf stuff
authorBernhard Urban <lewurm@gmail.com>
Thu, 10 May 2012 10:42:44 +0000 (12:42 +0200)
committerBernhard Urban <lewurm@gmail.com>
Wed, 16 May 2012 22:52:27 +0000 (00:52 +0200)
Mate/BasicBlocks.hs
Mate/ClassPool.hs
Mate/Debug.hs
Mate/MethodPool.hs
Mate/Strings.hs
debug.h

index 92120e0722c32819964c32444ba7bd2a1132b9c9..bf34eee25e57d1e3c6ff138d0b30962f0e8178b8 100644 (file)
@@ -90,7 +90,7 @@ parseMethod :: Class Resolved -> B.ByteString -> IO (Maybe MapBB)
 parseMethod cls method = do
                      let maybe_bb = testCFG $ lookupMethod method cls
                      let msig = methodSignature $ (classMethods cls) !! 1
-                     printf_bb "BB: analysing \"%s\"\n" $ toString (method `B.append` ": " `B.append` (encode msig))
+                     printfBb "BB: analysing \"%s\"\n" $ toString (method `B.append` ": " `B.append` (encode msig))
 #ifdef DBG_BB
                      printMapBB maybe_bb
 #endif
@@ -99,8 +99,8 @@ parseMethod cls method = do
                      -- TODO: remove ;-)
                      let (Just m) = lookupMethod method cls
                      case attrByName m "Code" of
-                      Nothing -> printf_bb "exception: no handler for this method\n"
-                      Just exceptionstream -> printf_bb "exception: \"%s\"\n" (show $ codeExceptions $ decodeMethod exceptionstream)
+                      Nothing -> printfBb "exception: no handler for this method\n"
+                      Just exceptionstream -> printfBb "exception: \"%s\"\n" (show $ codeExceptions $ decodeMethod exceptionstream)
                      return maybe_bb
 
 
index 1f7d7858a63b2cfb6b260249cb4716042ebeb0e1..986193dd5b380c40172ab3a437c4426829801b42 100644 (file)
@@ -133,12 +133,12 @@ loadClass path = do
   let w32_iftable = fromIntegral $ ptrToIntPtr iftable :: Word32
   -- store interface-table at offset 0 in method-table
   pokeElemOff (intPtrToPtr $ fromIntegral mbase) 0 w32_iftable
-  printf_cp "staticmap: %s @ %s\n" (show staticmap) (toString path)
-  printf_cp "fieldmap:  %s @ %s\n" (show fieldmap) (toString path)
-  printf_cp "methodmap: %s @ %s\n" (show methodmap) (toString path)
-  printf_cp "mbase: 0x%08x\n" mbase
-  printf_cp "interfacemethod: %s @ %s\n" (show immap) (toString path)
-  printf_cp "iftable: 0x%08x\n" w32_iftable
+  printfCp "staticmap: %s @ %s\n" (show staticmap) (toString path)
+  printfCp "fieldmap:  %s @ %s\n" (show fieldmap) (toString path)
+  printfCp "methodmap: %s @ %s\n" (show methodmap) (toString path)
+  printfCp "mbase: 0x%08x\n" mbase
+  printfCp "interfacemethod: %s @ %s\n" (show immap) (toString path)
+  printfCp "iftable: 0x%08x\n" w32_iftable
   virtual_map <- get_virtualmap >>= ptr2virtualmap
   let virtual_map' = M.insert mbase path virtual_map
   virtualmap2ptr virtual_map' >>= set_virtualmap
@@ -157,7 +157,7 @@ loadInterface path = do
   case M.lookup path imap of
     Just _ -> return ()
     Nothing -> do
-      printf_cp "interface: loading \"%s\"\n" $ toString path
+      printfCp "interface: loading \"%s\"\n" $ toString path
       let ifpath = toString $ path `B.append` ".class"
       cfile <- parseClassFile ifpath
       -- load "superinterfaces" first
@@ -255,9 +255,9 @@ loadAndInitClass path = do
           let mi = (MethodInfo "<clinit>" path (methodSignature m))
           entry <- compileBB hmap' mi
           addMethodRef entry mi [path]
-          printf_cp "executing static initializer from %s now\n" (toString path)
+          printfCp "executing static initializer from %s now\n" (toString path)
           executeFuncPtr entry
-          printf_cp "static initializer from %s done\n" (toString path)
+          printfCp "static initializer from %s done\n" (toString path)
         Nothing -> error $ "loadClass: static initializer not found (WTF?). abort"
     Nothing -> return ()
 
index b5ee6896cd1c07bc513be8af6b59fe8d4c060a18..c03bfcc74316014f3f4fdc2d9d413bc3de5da046 100644 (file)
@@ -16,32 +16,32 @@ instance VarArgsFake (IO a) where
 instance (Show a, VarArgsFake r) => VarArgsFake (a -> r) where
   varFake _ = \_ -> varFake []
 
-printf_fake :: String -> (VarArgsFake t) => t
-printf_fake _ = varFake []
+printfFake :: String -> (VarArgsFake t) => t
+printfFake _ = varFake []
 
 
 -- see counterpart at `debug.h'
 #ifndef DBG_JIT
-printf_jit :: String -> (VarArgsFake t) => t
-printf_jit = printf_fake
+printfJit :: String -> (VarArgsFake t) => t
+printfJit = printfFake
 #endif
 
 #ifndef DBG_BB
-printf_bb :: String -> (VarArgsFake t) => t
-printf_bb = printf_fake
+printfBb :: String -> (VarArgsFake t) => t
+printfBb = printfFake
 #endif
 
 #ifndef DBG_MP
-printf_mp :: String -> (VarArgsFake t) => t
-printf_mp = printf_fake
+printfMp :: String -> (VarArgsFake t) => t
+printfMp = printfFake
 #endif
 
 #ifndef DBG_CP
-printf_cp :: String -> (VarArgsFake t) => t
-printf_cp = printf_fake
+printfCp :: String -> (VarArgsFake t) => t
+printfCp = printfFake
 #endif
 
 #ifndef DBG_STR
-printf_str :: String -> (VarArgsFake t) => t
-printf_str = printf_fake
+printfStr :: String -> (VarArgsFake t) => t
+printfStr = printfFake
 #endif
index 067a9898585acdd9b2ecca60c3df6ae7841c2b14..3740f1e0c40679dc389c111902550818f90541f3 100644 (file)
@@ -70,7 +70,7 @@ getMethodEntry signal_from methodtable = do
   case M.lookup mi' mmap of
     Nothing -> do
       cls <- getClassFile cm
-      printf_mp "getMethodEntry(from 0x%08x): no method \"%s\" found. compile it\n" w32_from (show mi')
+      printfMp "getMethodEntry(from 0x%08x): no method \"%s\" found. compile it\n" w32_from (show mi')
       mm <- lookupMethodRecursive method [] cls
       case mm of
         Just (mm', clsnames, cls') -> do
@@ -87,7 +87,7 @@ getMethodEntry signal_from methodtable = do
               True -> do
                 -- TODO(bernhard): cleaner please... *do'h*
                 let symbol = (replace "/" "_" $ toString cm) ++ "__" ++ (toString method) ++ "__" ++ (replace ";" "_" $ replace "/" "_" $ replace "(" "_" (replace ")" "_" $ toString $ encode sig))
-                printf_mp "native-call: symbol: %s\n" symbol
+                printfMp "native-call: symbol: %s\n" symbol
                 nf <- loadNativeFunction symbol
                 let w32_nf = fromIntegral nf
                 let mmap' = M.insert mi' w32_nf mmap
@@ -165,9 +165,9 @@ compileBB hmap methodinfo = do
   let tmap' = M.union tmap new_tmap -- prefers elements in cmap
   trapmap2ptr tmap' >>= set_trapmap
 
-  printf_jit "generated code of \"%s\":\n" (toString $ methName methodinfo)
-  mapM_ (printf_jit "%s\n" . showAtt) (snd right)
-  printf_jit "\n\n"
+  printfJit "generated code of \"%s\":\n" (toString $ methName methodinfo)
+  mapM_ (printfJit "%s\n" . showAtt) (snd right)
+  printfJit "\n\n"
   -- UNCOMMENT NEXT LINE FOR GDB FUN
   -- _ <- getLine
   -- (1) start it with `gdb ./mate' and then `run <classfile>'
index 6e541814e7645247ee0f2a638d61fe7cd4a31aab..36b2342eb1f8b1c97f7fb0679921fc32ce33c1c9 100644 (file)
@@ -44,5 +44,5 @@ allocateJavaString str = do
   BI.memset newstr 0 (fromIntegral $ strlen + 1)
   copyBytes newstr arr strlen
   let w32_ptr = fromIntegral $ ptrToIntPtr newstr
-  printf_str "new str ptr: 0x%08x (%s)@%d\n" w32_ptr (toString str) strlen
+  printfStr "new str ptr: 0x%08x (%s)@%d\n" w32_ptr (toString str) strlen
   return w32_ptr
diff --git a/debug.h b/debug.h
index 58fbf3b563da5ed97c5471030e7e928536dadf90..633b89107e41b228e0aca2fabd0167893c7f374e 100644 (file)
--- a/debug.h
+++ b/debug.h
@@ -3,7 +3,7 @@
  * DBG_MP ..... MethodPool.hs
  * DBG_CP ..... ClassPool.hs
  * DBG_STR .... Strings.hs
- * // no printf_* defined
+ * // no printf* defined
  * DBG_TRAP ... show information @ trap.c
  * DBG_CLASS .. dump classfile
  */
 #endif
 
 /* it would be awesome if we could just write
- * > printf_fake = printf
+ * > printfFake = printf
  * here, but the type can't be infered, since `PrintfType'
  * isn't visible (at least this is my explanation :/).
  * if I'm wrong, move this to `Mate/Debug.hs'
  */
 #ifdef DBG_JIT
-#define printf_jit printf
+#define printfJit printf
 #endif
 
 #ifdef DBG_BB
-#define printf_bb printf
+#define printfBb printf
 #endif
 
 #ifdef DBG_MP
-#define printf_mp printf
+#define printfMp printf
 #endif
 
 #ifdef DBG_CP
-#define printf_cp printf
+#define printfCp printf
 #endif
 
 #ifdef DBG_STR
-#define printf_str printf
+#define printfStr printf
 #endif