Why isn't the astyle program formatting my c source file?
Background: I copy-and-pasted a c source file from gitlab and for some reason, the resulting file was jumbled. I was hoping to be able to run the file through astyle and come away with a nicely formatted file, but my various attempts have had no effect. Each attempt has resulted in a message saying, "Unchanged ecl-hello-world.c"
Here's the malformed source file:
#include <stdio.h> #include <ecl/ecl.h> int main (int argc, char **argv) { /* Initialize ECL */ cl_boot(argc, argv); /* Initialize the library we linked in. Each library * has to be initialized. It is best if all libraries * are joined using ASDF:MAKE-BUILD. */ extern void init_lib_HELLO_LISP(cl_object); ecl_init_module(NULL, init_lib_HELLO_LISP); cl_object result= cl_eval(c_string_to_object("(hello-lisp)")); ecl_print(result, ECL_T); cl_object my_fun = cl_eval(c_string_to_object("(lambda (x) (1+ x))")); ecl_print(my_fun, ECL_T); result=cl_funcall(2, my_fun, ecl_make_fixnum(8)); ecl_print(result, ECL_T); ecl_terpri(ECL_T); cl_shutdown(); return 0; }
Here are the invocations of astyle I've tried:
astyle ecl-hello-world.c
astyle --style=allman --indent=spaces=4 ecl-hello-world.c
astyle --style=linux ecl-hello-world.c