From 727938dbcf6b5d561199583812c318639c27571a Mon Sep 17 00:00:00 2001 From: neingeist Date: Thu, 9 May 2013 19:32:02 +0200 Subject: [PATCH] play around with indent --- Makefile | 5 +++++ approximate-pi.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 03e1c60..1e5aae3 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,8 @@ CFLAGS=-std=c99 +INDENTOPTS=-kr --no-tabs --braces-on-func-def-line --indent-level2 all: approximate-pi + +.PHONY: indent +indent: + indent $(INDENTOPTS) *.c diff --git a/approximate-pi.c b/approximate-pi.c index 7c37b7b..feeabd2 100644 --- a/approximate-pi.c +++ b/approximate-pi.c @@ -5,11 +5,11 @@ double approximate_pi(unsigned int steps) { double approximate_pi = 4.0; bool subtract = true; - for(int i=2; i<=steps; i++) { + for (int i = 2; i <= steps; i++) { if (subtract) { - approximate_pi -= (4.0/(i*2-1)); + approximate_pi -= (4.0 / (i * 2 - 1)); } else { - approximate_pi += (4.0/(i*2-1)); + approximate_pi += (4.0 / (i * 2 - 1)); } subtract = !subtract; }