From 5829791ffaca0178fbbd4111fbdf8c7cbd6de27f Mon Sep 17 00:00:00 2001 From: grischka Date: Sat, 18 Apr 2009 14:31:35 +0200 Subject: fix makefiles etc for subdirs --- examples/ex1.c | 2 +- examples/ex2.c | 11 ++++++----- examples/ex3.c | 7 ++++--- examples/ex4.c | 7 ++++--- examples/ex5.c | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-) (limited to 'examples') diff --git a/examples/ex1.c b/examples/ex1.c index 2dcff7d..28139f9 100755 --- a/examples/ex1.c +++ b/examples/ex1.c @@ -1,7 +1,7 @@ #! /usr/local/bin/tcc -run #include -int main() +int main() { printf("Hello World\n"); return 0; diff --git a/examples/ex2.c b/examples/ex2.c index 6368bee..d415e39 100644 --- a/examples/ex2.c +++ b/examples/ex2.c @@ -1,4 +1,5 @@ -#include "tcclib.h" +#include +#include #define N 20 @@ -23,7 +24,7 @@ int find(int n, int i1, int a, int b, int op) return 1; tab[i1] = n; } - + for(i=0;i +#include +#include int fib(n) { @@ -8,7 +9,7 @@ int fib(n) return fib(n-1) + fib(n-2); } -int main(int argc, char **argv) +int main(int argc, char **argv) { int n; if (argc < 2) { @@ -16,7 +17,7 @@ int main(int argc, char **argv) "Compute nth Fibonacci number\n"); return 1; } - + n = atoi(argv[1]); printf("fib(%d) = %d\n", n, fib(n, 2)); return 0; diff --git a/examples/ex4.c b/examples/ex4.c index 3a3fed7..b33b033 100755 --- a/examples/ex4.c +++ b/examples/ex4.c @@ -1,9 +1,10 @@ #!./tcc -run -L/usr/X11R6/lib -lX11 #include -/* Yes, TCC can use X11 too ! */ #include #include +/* Yes, TCC can use X11 too ! */ + int main(int argc, char **argv) { Display *display; @@ -16,8 +17,8 @@ int main(int argc, char **argv) } printf("X11 display opened.\n"); screen = XScreenOfDisplay(display, 0); - printf("width = %d\nheight = %d\ndepth = %d\n", - screen->width, + printf("width = %d\nheight = %d\ndepth = %d\n", + screen->width, screen->height, screen->root_depth); XCloseDisplay(display); diff --git a/examples/ex5.c b/examples/ex5.c index da625c5..156425e 100644 --- a/examples/ex5.c +++ b/examples/ex5.c @@ -1,7 +1,7 @@ #include #include -int main() +int main() { printf("Hello World\n"); return 0; -- cgit v1.3.1