From 697f7dfd273223e316ed286cff1c22b589779bd4 Mon Sep 17 00:00:00 2001 From: orange Date: Sun, 16 Jun 2013 16:41:27 +0200 Subject: [PATCH] reindent --- circular-buffer.c | 4 ++-- ncurses-pong.c | 18 +++++++++--------- structs.c | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/circular-buffer.c b/circular-buffer.c index 0a5abd7..b79db30 100644 --- a/circular-buffer.c +++ b/circular-buffer.c @@ -25,7 +25,7 @@ struct cb { int start; int end; - elem_t * elems; + elem_t *elems; }; typedef struct cb cb_t; @@ -45,7 +45,7 @@ void cb_init(cb_t * cb, int size) { cb->start = 0; - cb->elems = malloc(sizeof(elem_t)*size); + cb->elems = malloc(sizeof(elem_t) * size); if (!cb->elems) dienomem(); } diff --git a/ncurses-pong.c b/ncurses-pong.c index c8c4573..c3d021f 100644 --- a/ncurses-pong.c +++ b/ncurses-pong.c @@ -17,7 +17,7 @@ void xy2rc(float x, float y, int *r, int *c) { } float lerp(float from, float to, float t) { - return from + t * (to-from); + return from + t * (to - from); } float ball_x = 0.0; @@ -36,7 +36,7 @@ void paint_ball() { void paint_paddles() { int r, c; - xy2rc( 0, pad_l, &r, &c); + xy2rc(0, pad_l, &r, &c); mvaddch(r, c, ACS_VLINE); xy2rc(MAX_X, pad_r, &r, &c); @@ -53,17 +53,17 @@ void paint() { } int main() { - initscr(); /* Start curses mode */ - curs_set(0); /* Disable cursor */ + initscr(); /* Start curses mode */ + curs_set(0); /* Disable cursor */ - while(true) { + while (true) { ball_x += dir_x; ball_y += dir_y; - if (ball_x>MAX_X || ball_x<0) { + if (ball_x > MAX_X || ball_x < 0) { dir_x = -dir_x; } - if (ball_y>MAX_Y || ball_y<0) { + if (ball_y > MAX_Y || ball_y < 0) { dir_y = -dir_y; } @@ -79,6 +79,6 @@ int main() { usleep(50000); } - getch(); /* Wait for user input */ - endwin(); /* End curses mode */ + getch(); /* Wait for user input */ + endwin(); /* End curses mode */ } diff --git a/structs.c b/structs.c index dfc0013..1745467 100644 --- a/structs.c +++ b/structs.c @@ -5,7 +5,7 @@ struct test { }; typedef struct test test_t; -int main(int argc, char * argv[]) { +int main(int argc, char *argv[]) { test_t a = { 23 }; test_t b = { 42 };