From 816f6d2bd816d4d84413f4bf6cb17198ad1aa39b Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Thu, 27 Mar 2025 19:05:05 +0100 Subject: Compile: Fix formatting of generated code --- src/Compile.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Compile.hs') diff --git a/src/Compile.hs b/src/Compile.hs index 6e46f74..908b304 100644 --- a/src/Compile.hs +++ b/src/Compile.hs @@ -352,21 +352,21 @@ compileToString env expr = ,compose [printStructDecl sd . showString "\n" | sd <- structs] ,showString "\n" ,showString "static void* malloc_instr(size_t n) {\n" - ,showString " void *ptr = malloc(n);" + ,showString " void *ptr = malloc(n);\n" ,if debugAllocs then showString "printf(\"[chad-kernel] malloc(%zu) -> %p\\n\", n, ptr);\n" else id - ,showString " return ptr;" + ,showString " return ptr;\n" ,showString "}\n" ,showString "static void* calloc_instr(size_t n) {\n" - ,showString " void *ptr = calloc(n, 1);" + ,showString " void *ptr = calloc(n, 1);\n" ,if debugAllocs then showString "printf(\"[chad-kernel] calloc(%zu) -> %p\\n\", n, ptr);\n" else id - ,showString " return ptr;" + ,showString " return ptr;\n" ,showString "}\n" ,showString "static void free_instr(void *ptr) {\n" ,if debugAllocs then showString "printf(\"[chad-kernel] free(%p)\\n\", ptr);\n" else id - ,showString " free(ptr);" + ,showString " free(ptr);\n" ,showString "}\n\n" ,compose [showString str . showString "\n\n" | str <- toList (csTopLevelDecls s)] ,showString $ -- cgit v1.2.3-70-g09d2