uncrustify source code

master
neingeist 11 years ago
parent ca15f19709
commit 8141a18cab

@ -35,6 +35,10 @@ cppcheck.txt: *.c *.h
tags: *.c tags: *.c
ctags -R . ctags -R .
.PHONY: uncrustify
uncrustify:
uncrustify -c uncrustify.cfg --no-backup *.c
mandelbrot: mandelbrot.c mandelbrot: mandelbrot.c
$(CC) $(CFLAGS) $(shell sdl-config --cflags) -o $@ $< $(shell sdl-config --libs) -lm $(CC) $(CFLAGS) $(shell sdl-config --cflags) -o $@ $< $(shell sdl-config --libs) -lm

@ -6,7 +6,7 @@
double mean(double set[], int set_n) { double mean(double set[], int set_n) {
double sum = 0.0; double sum = 0.0;
for(int i=0; i<set_n; i++) { for (int i=0; i<set_n; i++) {
sum += set[i]; sum += set[i];
} }
@ -40,7 +40,7 @@ double sample_stddev(double set[], int set_n) {
double set_min(double set[], int set_n) { double set_min(double set[], int set_n) {
double min = MAXDOUBLE; double min = MAXDOUBLE;
for(int i=0; i<set_n; i++) { for (int i=0; i<set_n; i++) {
min=fmin(set[i], min); min=fmin(set[i], min);
} }

@ -1,7 +1,7 @@
/* /*
Write a recursive function that searches for a target in a sorted array using Write a recursive function that searches for a target in a sorted array using
binay search, where the array, its size and the target are given as parameters. binay search, where the array, its size and the target are given as parameters.
*/ */
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
@ -51,7 +51,8 @@ int main(void) {
21090, 22277, 22624, 24634, 24877, 21090, 22277, 22624, 24634, 24877,
25367, 25586, 26706, 26720, 26958, 25367, 25586, 26706, 26720, 26958,
27478, 28269, 29142, 30630, 30804, 27478, 28269, 29142, 30630, 30804,
31984, 32398, 32588 }; 31984, 32398, 32588
};
assert_sorted(a, 43); assert_sorted(a, 43);
assert(binsearch(a, 43, 912) == 0); assert(binsearch(a, 43, 912) == 0);

@ -254,7 +254,7 @@ int main(void) {
assert(list_elementat(foolist, list_length(foolist)+2) == NULL); assert(list_elementat(foolist, list_length(foolist)+2) == NULL);
/* Free up remaining items and the list. */ /* Free up remaining items and the list. */
while(!list_empty(foolist)) { while (!list_empty(foolist)) {
list_node_t *el = list_elementat(foolist, 0); list_node_t *el = list_elementat(foolist, 0);
free(list_remove(foolist, el)); free(list_remove(foolist, el));
} }

@ -45,7 +45,7 @@ int main(void) {
{ "string", luaopen_string }, { "string", luaopen_string },
{ NULL, NULL} { NULL, NULL}
}; };
for(luaL_Reg *lib = lualibs; lib->func; lib++) { for (luaL_Reg *lib = lualibs; lib->func; lib++) {
printf("Loading %s\n", lib->name); printf("Loading %s\n", lib->name);
lib->func(L); lib->func(L);
lua_setglobal(L, lib->name); lua_setglobal(L, lib->name);

@ -4,7 +4,7 @@
int main() { int main() {
int i = 0xffff; int i = 0xffff;
asm("movl $23, %0" asm ("movl $23, %0"
: "=r" (i) /* output */ : "=r" (i) /* output */
/* : no input */ /* : no input */
/* : no clobbered */ /* : no clobbered */

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save