# HG changeset patch # User Markus Bröker # Date 1239878879 -7200 # Node ID 7abf6146898e83c6e4b32c8f69499a3bd26d1fd0 # Parent 54addf5893ef33aca4c674b33edc530af63a246a indent -bad changed to -nbad: See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=485764 committer: Markus Bröker diff --git a/alpha_beta.c b/alpha_beta.c --- a/alpha_beta.c +++ b/alpha_beta.c @@ -37,11 +37,8 @@ int desired_depth = -1; int estimateFunction (); - int max_alpha_beta (int, int, int); - int min_alpha_beta (int, int, int); - void print (void); /** diff --git a/asm/decimal.c b/asm/decimal.c --- a/asm/decimal.c +++ b/asm/decimal.c @@ -28,6 +28,7 @@ { char *encoded; char swp; + int i; i = 0; @@ -61,7 +62,9 @@ int main (int argc, char **argv) { ULONG decimal, start, end; + int bits, base, i; + char *binaer; base = 2; diff --git a/bad_alloc.cc b/bad_alloc.cc --- a/bad_alloc.cc +++ b/bad_alloc.cc @@ -27,7 +27,9 @@ int main (int argc, char **argv) { vector < int >v; + int i = 0; + char action; if (set_limit (20 * 1024 * 1024)) { @@ -39,11 +41,12 @@ for (;;) { v.push_back (i++); } - } catch (exception & e) { + } + catch (exception & e) { cout << e.what () << " after " << i << " iterations" << endl << endl; cout << "Would you like to see the full error message? (y/n) "; cin >> action; - v.clear(); + v.clear (); switch (action) { case 'y': throw; diff --git a/connection.c b/connection.c --- a/connection.c +++ b/connection.c @@ -15,7 +15,6 @@ int connection (char *ip, unsigned short port) { struct hostent *hs; - struct sockaddr_in sock; int sockfd; diff --git a/copy.cc b/copy.cc --- a/copy.cc +++ b/copy.cc @@ -7,34 +7,34 @@ #include #include -int main(int argc, char **argv) +int main (int argc, char **argv) { - std::ifstream in; - std::ofstream out; + std::ifstream in; + std::ofstream out; - char c; + char c; - if ( argc != 3 ) { - std::cout << "Benutzung: " << argv[0] << " " << std::endl; - return EXIT_SUCCESS; - } + if (argc != 3) { + std::cout << "Benutzung: " << argv[0] << " " << std::endl; + return EXIT_SUCCESS; + } - in.open(argv[1], std::ios::binary); - if ( !in ) { - std::cerr << "Fehler: Kann Datei " << argv[1] << " nicht lesen!" << std::endl; - } + in.open (argv[1], std::ios::binary); + if (!in) { + std::cerr << "Fehler: Kann Datei " << argv[1] << " nicht lesen!" << std::endl; + } - out.open(argv[2]); - if ( !out ) { - std::cerr << "Fehler: Kann Datei " << argv[2] << " nicht beschreiben!" << std::endl; - } + out.open (argv[2]); + if (!out) { + std::cerr << "Fehler: Kann Datei " << argv[2] << " nicht beschreiben!" << std::endl; + } - while ( in.get(c) ) { - out << c; - } + while (in.get (c)) { + out << c; + } - in.close(); - out.close(); + in.close (); + out.close (); - return EXIT_SUCCESS; + return EXIT_SUCCESS; } diff --git a/data_types.c b/data_types.c --- a/data_types.c +++ b/data_types.c @@ -10,19 +10,12 @@ #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 diff --git a/database.c b/database.c --- a/database.c +++ b/database.c @@ -13,13 +13,10 @@ char *conninfo; PGconn *conn; - PGresult *res; int nFields; - int i; - int j; conninfo = "dbname=lightintron"; diff --git a/db_bridge/main.cpp b/db_bridge/main.cpp --- a/db_bridge/main.cpp +++ b/db_bridge/main.cpp @@ -29,7 +29,9 @@ Abstract_DB::DB_ROW vec; Abstract_DB::DB_RESULT result; + unsigned int i, j; + char c; std::string host, user, pass, database; diff --git a/endian.c b/endian.c --- a/endian.c +++ b/endian.c @@ -9,7 +9,6 @@ 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,9 +13,7 @@ int main (int argc, char **argv) { int fd1; - int fd2; - int mode; char *str = "Schreib mal was!"; diff --git a/floating.c b/floating.c --- a/floating.c +++ b/floating.c @@ -10,7 +10,6 @@ double *getValues (int elements) { double *values; - int i; if ((values = calloc (elements + 1, sizeof (double))) == NULL) diff --git a/gauss.c b/gauss.c --- a/gauss.c +++ b/gauss.c @@ -89,7 +89,6 @@ int main (int argc, char **argv) { int i, k; - int MAXX, MAXY; float value; diff --git a/hex2chars.c b/hex2chars.c --- a/hex2chars.c +++ b/hex2chars.c @@ -26,7 +26,6 @@ char *remap_works (char *str, int slen) { int i; - int pos; static char *s; @@ -55,7 +54,6 @@ int i, j; double value; - double *table; static char *s; diff --git a/life.c b/life.c --- a/life.c +++ b/life.c @@ -9,11 +9,8 @@ #define MAX 12 int read_file (char **); - int init_life (char **); - void free_life (char **); - void show_life (char **); int read_file (char **arena) @@ -21,7 +18,6 @@ int i, j; char org; - char file[80]; FILE *inp = NULL; diff --git a/lotto.c b/lotto.c --- a/lotto.c +++ b/lotto.c @@ -74,11 +74,9 @@ LONG *evaluation (LONG * numbers, int num, int verbose) { int i, j, k; - int printed; LONG *values; - LONG *z; int found; @@ -148,17 +146,12 @@ int main (int argc, char **argv) { LONG *values; - LONG *numbers; - LONG max; int i, j; - int found; - int loop; - int verbose, wide, end, num; verbose = wide = 0; diff --git a/lsflib/src/get_line.c b/lsflib/src/get_line.c --- a/lsflib/src/get_line.c +++ b/lsflib/src/get_line.c @@ -17,6 +17,7 @@ { int i, j; char *line, *ptr; + FILE *f = fopen (filename, "r"); if (!f) { diff --git a/lsflib/src/tokenchar.c b/lsflib/src/tokenchar.c --- a/lsflib/src/tokenchar.c +++ b/lsflib/src/tokenchar.c @@ -17,6 +17,7 @@ int tokenchar (FILE * f) { char line[MAXCHARS]; + int i; int lines; int chars; diff --git a/lsflib/src/tokenizer.c b/lsflib/src/tokenizer.c --- a/lsflib/src/tokenizer.c +++ b/lsflib/src/tokenizer.c @@ -21,11 +21,11 @@ * the main routine of the tokenizer * */ - Node *aktuell, *begin; char line[LINE_LENGTH]; char *token; + int tokens; *line = tokens = 0; diff --git a/max.c b/max.c --- a/max.c +++ b/max.c @@ -14,7 +14,6 @@ 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 @@ -23,11 +23,11 @@ int i, n = 0; long int *p; + long int *p_new; - 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/recording.c b/recording.c --- a/recording.c +++ b/recording.c @@ -28,9 +28,7 @@ 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,7 +13,6 @@ #endif unsigned long counter = 0; - unsigned long iters = 0; int compare (int *a, int *b) @@ -77,9 +76,7 @@ int main (int argc, char **argv) { int a[MAX]; - int b[MAX]; - int c[MAX]; int i; diff --git a/sudoku.c b/sudoku.c --- a/sudoku.c +++ b/sudoku.c @@ -185,9 +185,7 @@ 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,7 +12,6 @@ int main (int argc, char **argv) { char line[83]; - char *token; if (argc != 4) { diff --git a/tree.c b/tree.c --- a/tree.c +++ b/tree.c @@ -21,9 +21,7 @@ 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,10 +18,9 @@ int main (int argc, char **argv) { int i; + int elements; + int fd; - int elements; - - int fd; unsigned char numbers[256] = { 0 }; fd = open ("/dev/urandom", O_RDONLY); diff --git a/varargs.c b/varargs.c --- a/varargs.c +++ b/varargs.c @@ -14,7 +14,6 @@ va_list list; char c; - char *s; int value;