# HG changeset patch # User Markus Bröker # Date 1239878838 -7200 # Node ID 81a574d60c1540e794a1a0c377d0421809f0ae45 # Parent d227047a3e880034a67819cda251ee88cb4c1d5f typo in min2time format string committer: Markus Bröker diff --git a/alpha_beta.c b/alpha_beta.c --- a/alpha_beta.c +++ b/alpha_beta.c @@ -25,6 +25,7 @@ typedef struct Node Node; Move *bestMove; + Node *stack_end; char board[BOARD_SIZE] = { @@ -36,8 +37,11 @@ int desired_depth = -1; int estimateFunction (); + int max_alpha_beta (int, int, int); + int min_alpha_beta (int, int, int); + void print (void); /** @@ -201,7 +205,9 @@ int max_alpha_beta (int depth, int alpha, int beta) { int moveValue; + int t; + Move *move; if (desired_depth == -1) @@ -242,7 +248,9 @@ int min_alpha_beta (int depth, int alpha, int beta) { int moveValue; + int t; + Move *move; t = 0; @@ -288,7 +296,9 @@ int main (int argc, char **argv) { Node *actual; + int i, t, value; + int depth; if (argc == 2) diff --git a/concatenation.c b/concatenation.c --- a/concatenation.c +++ b/concatenation.c @@ -46,6 +46,7 @@ int main (int argc, char **argv) { Person person[5]; + int i; set_Person (&person[0], "Breitkopf", "Manuela", "Maxim-Gorki-Strasse 49", 18106, "Rostock"); diff --git a/connection.c b/connection.c --- a/connection.c +++ b/connection.c @@ -15,7 +15,9 @@ int connection (char *ip, unsigned short port) { struct hostent *hs; + struct sockaddr_in sock; + int sockfd; memset (&sock, 0, sizeof (sock)); @@ -47,7 +49,9 @@ int main (int argc, char **argv) { char buffer[1024]; + int sockfd; + int num; if (argc != 3) { diff --git a/counter.c b/counter.c --- a/counter.c +++ b/counter.c @@ -10,7 +10,9 @@ int main (int argc, char **argv) { time_t t; + struct tm *time_str; + int start, end; if (argc != 2) { diff --git a/crypt.c b/crypt.c --- a/crypt.c +++ b/crypt.c @@ -10,6 +10,7 @@ int main (int argc, char **argv) { char *data; + int i; if (argc != 2) { diff --git a/data_types.c b/data_types.c --- a/data_types.c +++ b/data_types.c @@ -10,19 +10,24 @@ #include typedef unsigned char UCHAR; + typedef signed char SCHAR; typedef unsigned short USHORT; + typedef signed short SSHORT; typedef unsigned int UINT; + typedef signed int SINT; typedef unsigned long ULONG; + typedef signed long SLONG; #ifdef __USE_ISOC99 typedef unsigned long long ULLONG; + typedef signed long long SLLONG; #endif diff --git a/database.c b/database.c --- a/database.c +++ b/database.c @@ -11,10 +11,15 @@ int main (int argc, char **argv) { char *conninfo; + PGconn *conn; + PGresult *res; + int nFields; + int i; + int j; conninfo = "dbname=lightintron"; diff --git a/dnsresolve.c b/dnsresolve.c --- a/dnsresolve.c +++ b/dnsresolve.c @@ -12,6 +12,7 @@ int main (int argc, char **argv) { struct hostent *he; + char *ip; int i = 0; diff --git a/endian.c b/endian.c --- a/endian.c +++ b/endian.c @@ -9,6 +9,7 @@ int endian () { unsigned short word = 0x1234; + unsigned char *p = (unsigned char *)&word; return ((p[0] == 0x34) ? 0 : 1); diff --git a/file_demo.c b/file_demo.c --- a/file_demo.c +++ b/file_demo.c @@ -13,8 +13,11 @@ int main (int argc, char **argv) { int fd1; + int fd2; + int mode; + char *str = "Schreib mal was!"; if (argc != 2) diff --git a/floating.c b/floating.c --- a/floating.c +++ b/floating.c @@ -10,6 +10,7 @@ double *getValues (int elements) { double *values; + int i; if ((values = calloc (elements + 1, sizeof (double))) == NULL) @@ -24,6 +25,7 @@ int main (int argc, char **argv) { double *values = getValues (MAX); + int i; for (i = 0; i < MAX; i++) { diff --git a/function_pointers.c b/function_pointers.c --- a/function_pointers.c +++ b/function_pointers.c @@ -7,34 +7,34 @@ #include typedef struct T { - int a; - int b; + int a; + int b; } T; -int plus(T t) +int plus (T t) { - return t.a+t.b; + return t.a + t.b; } -int minus(T t) +int minus (T t) { - return t.a-t.b; + return t.a - t.b; } -int func(T t, int (*ptrFunc)(T)) +int func (T t, int (*ptrFunc) (T)) { - return ptrFunc(t); + return ptrFunc (t); } -int main(int argc, char **argv) +int main (int argc, char **argv) { - T t = { - .a = 20, - .b = 10 - }; + T t = { + .a = 20, + .b = 10 + }; - printf("Result: %d\n", func(t, &plus)); - printf("Result: %d\n", func(t, &minus)); + printf ("Result: %d\n", func (t, &plus)); + printf ("Result: %d\n", func (t, &minus)); - return EXIT_SUCCESS; + return EXIT_SUCCESS; } diff --git a/gauss.c b/gauss.c --- a/gauss.c +++ b/gauss.c @@ -32,6 +32,7 @@ void gauss (float **A, int MAXX, int MAXY) { int i, j, k, n; + float h; i = 0; @@ -88,7 +89,9 @@ int main (int argc, char **argv) { int i, k; + int MAXX, MAXY; + float value; float **A; diff --git a/hex2chars.c b/hex2chars.c --- a/hex2chars.c +++ b/hex2chars.c @@ -26,7 +26,9 @@ char *remap_works (char *str, int slen) { int i; + int pos; + static char *s; if ((s = malloc (slen + 1)) == NULL) @@ -51,8 +53,11 @@ char *remap_works_not (char *str, int slen) { int i, j; + double value; + double *table; + static char *s; int clen = strlen (characters); @@ -103,8 +108,11 @@ int main (int argc, char **argv) { int i; + int len; + char *start; + char *end; if (argc != 2) { diff --git a/life.c b/life.c --- a/life.c +++ b/life.c @@ -9,16 +9,21 @@ #define MAX 12 int read_file (char **); + int init_life (char **); + void free_life (char **); + void show_life (char **); int read_file (char **arena) { int i, j; + char org; char file[80]; + FILE *inp = NULL; while (inp == NULL) { diff --git a/lotto.c b/lotto.c --- a/lotto.c +++ b/lotto.c @@ -41,7 +41,9 @@ LONG *lottery (LONG end, LONG num) { int i, j; + LONG *z; + int unique; if ((z = (LONG *) calloc (num + 1, sizeof (int))) == NULL) @@ -72,8 +74,11 @@ LONG *evaluation (LONG * numbers, int num, int verbose) { int i, j, k; + int printed; + LONG *values; + LONG *z; int found; @@ -143,12 +148,15 @@ int main (int argc, char **argv) { LONG *values; + LONG *numbers; + LONG max; int i, j; int found; + int loop; int verbose, wide, end, num; diff --git a/max.c b/max.c --- a/max.c +++ b/max.c @@ -14,6 +14,7 @@ int main (int argc, char **argv) { unsigned int a; + unsigned int b; if (argc != 3) { diff --git a/mem2swap.c b/mem2swap.c --- a/mem2swap.c +++ b/mem2swap.c @@ -21,10 +21,13 @@ int main (int argc, char **argv) { int i, n = 0; + long int *p; + long int *p_new; char *args[] = { "/usr/bin/free", "-m", NULL }; int size = sizeof (*p); + int megs = DEFAULT_MEGS * 1024 * 1024; if (argc == 2) diff --git a/min2time.c b/min2time.c --- a/min2time.c +++ b/min2time.c @@ -23,7 +23,7 @@ if ((minutes < 0) || !(minutes < INT_MAX)) return EXIT_FAILURE; - printf ("%.3d:%.2d:%.2d:%.2d (yy:dd:hh:mm)\n", minutes / 60 / 24 / 365, (minutes / (60 * 24) % 365), + printf ("%.2d:%.2d:%.2d:%.2d (yy:dd:hh:mm)\n", minutes / 60 / 24 / 365, (minutes / (60 * 24) % 365), (minutes / 60) % 24, minutes % 60); return EXIT_SUCCESS; diff --git a/ncurses.c b/ncurses.c --- a/ncurses.c +++ b/ncurses.c @@ -37,8 +37,11 @@ wchar_t fucnt (WINDOW * win) { wchar_t guess; + char dest[4]; + int maxx; + int maxy; while (guess != ESCAPE) { @@ -74,6 +77,7 @@ int main () { wchar_t x; + WINDOW *win; check_locale (); diff --git a/numerierung.c b/numerierung.c --- a/numerierung.c +++ b/numerierung.c @@ -17,8 +17,11 @@ int main (int argc, char **argv) { char buffer[81]; + int counter = 0; + FILE *f; + int c, pure = 0; while ((c = getopt (argc, argv, "hp")) != -1) { diff --git a/prog_limit.c b/prog_limit.c --- a/prog_limit.c +++ b/prog_limit.c @@ -14,6 +14,7 @@ int main (int argc, char **argv) { int i; + char **args; if (argc < 3) { diff --git a/recording.c b/recording.c --- a/recording.c +++ b/recording.c @@ -28,7 +28,9 @@ int main (int argc, char **argv) { int fd; /* sound device file descriptor */ + int arg; /* argument for ioctl calls */ + int status; /* return status of system calls */ /* diff --git a/sort.c b/sort.c --- a/sort.c +++ b/sort.c @@ -13,6 +13,7 @@ #endif unsigned long counter = 0; + unsigned long iters = 0; int compare (int *a, int *b) @@ -76,8 +77,11 @@ int main (int argc, char **argv) { int a[MAX]; + int b[MAX]; + int c[MAX]; + int i; srand (time (NULL)); diff --git a/sudoku.c b/sudoku.c --- a/sudoku.c +++ b/sudoku.c @@ -41,6 +41,7 @@ static unsigned long iterations = 0; typedef struct Field Field; + typedef Field **Board; /** @@ -129,6 +130,7 @@ int solveBoard (Board board, int k) { u_int i; + int q; if ((++iterations > MAX_ITERATIONS)) @@ -181,8 +183,11 @@ int main (int argc, char **argv) { Board b; + int i; + int ret; + int colored = 0; while ((i = getopt (argc, argv, "ch")) != -1) { diff --git a/testcase.c b/testcase.c --- a/testcase.c +++ b/testcase.c @@ -12,6 +12,7 @@ int main (int argc, char **argv) { char line[83]; + char *token; if (argc != 4) { diff --git a/threads.c b/threads.c --- a/threads.c +++ b/threads.c @@ -30,6 +30,7 @@ int main (int argc, char **argv) { int i; + pthread_t thread; pthread_create (&thread, NULL, &thread_func, NULL); diff --git a/tree.c b/tree.c --- a/tree.c +++ b/tree.c @@ -19,8 +19,11 @@ T *make_list (int elements, int rand_max) { int i; + T *t; + T *actual; + T *first = NULL; srand (time (NULL)); diff --git a/urandom.c b/urandom.c --- a/urandom.c +++ b/urandom.c @@ -18,7 +18,9 @@ int main (int argc, char **argv) { int i; + int elements; + int fd; unsigned char numbers[256] = { 0 }; diff --git a/varargs.c b/varargs.c --- a/varargs.c +++ b/varargs.c @@ -10,9 +10,13 @@ int params (char *fmt, ...) { int i = 0; + va_list list; + char c; + char *s; + int value; va_start (list, fmt); diff --git a/xdemo.c b/xdemo.c --- a/xdemo.c +++ b/xdemo.c @@ -10,8 +10,11 @@ int main (int argc, char **argv) { Window w = 0; + Display *dpy = XOpenDisplay (NULL); + XEvent xev; + int active; if (dpy == NULL) {