diff options
author | Tom Yu <tlyu@mit.edu> | 2009-10-31 00:48:38 +0000 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2009-10-31 00:48:38 +0000 |
commit | 02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b (patch) | |
tree | 61b9147863cd8be3eff63903dc36cae168254bd5 /src/plugins/kdb/db2/libdb2 | |
parent | 162ab371748cba0cc6f172419bd6e71fa04bb878 (diff) | |
download | krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.gz krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.xz krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.zip |
make mark-cstyle
make reindent
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/plugins/kdb/db2/libdb2')
25 files changed, 87 insertions, 92 deletions
diff --git a/src/plugins/kdb/db2/libdb2/btree/bt_delete.c b/src/plugins/kdb/db2/libdb2/btree/bt_delete.c index d002a66edd..02ae2e9be6 100644 --- a/src/plugins/kdb/db2/libdb2/btree/bt_delete.c +++ b/src/plugins/kdb/db2/libdb2/btree/bt_delete.c @@ -154,7 +154,7 @@ __bt_stkacq(t, hp, c) db_pgno_t pgno; recno_t nextpg, prevpg; int exact, level; - + /* * Find the first occurrence of the key in the tree. Toss the * currently locked page so we don't hit an already-locked page. @@ -270,7 +270,7 @@ __bt_stkacq(t, hp, c) if ((h = mpool_get(t->bt_mp, prevpg, 0)) == NULL) return (1); } - + ret: mpool_put(t->bt_mp, h, 0); return ((*hp = mpool_get(t->bt_mp, c->pg.pgno, 0)) == NULL); @@ -402,7 +402,7 @@ __bt_pdelete(t, h) /* Get the parent page. */ if ((pg = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL) return (RET_ERROR); - + idx = parent->index; bi = GETBINTERNAL(pg, idx); @@ -571,7 +571,7 @@ __bt_curdel(t, key, h, idx) key = &c->key; } /* Check previous key, if not at the beginning of the page. */ - if (idx > 0) { + if (idx > 0) { e.page = h; e.index = idx - 1; if (__bt_cmp(t, key, &e) == 0) { diff --git a/src/plugins/kdb/db2/libdb2/btree/bt_open.c b/src/plugins/kdb/db2/libdb2/btree/bt_open.c index 0f848d8adc..069b2dfde0 100644 --- a/src/plugins/kdb/db2/libdb2/btree/bt_open.c +++ b/src/plugins/kdb/db2/libdb2/btree/bt_open.c @@ -202,7 +202,7 @@ __bt_open(fname, flags, mode, openinfo, dflags) default: goto einval; } - + if ((t->bt_fd = open(fname, flags | O_BINARY, mode)) < 0) goto err; diff --git a/src/plugins/kdb/db2/libdb2/btree/bt_seq.c b/src/plugins/kdb/db2/libdb2/btree/bt_seq.c index bbfb9c6c63..6124f968bf 100644 --- a/src/plugins/kdb/db2/libdb2/btree/bt_seq.c +++ b/src/plugins/kdb/db2/libdb2/btree/bt_seq.c @@ -6,7 +6,7 @@ * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. - * + * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright @@ -419,7 +419,7 @@ __bt_first(t, key, erval, exactp) *erval = *ep; return (RET_SUCCESS); } - + /* * Walk backwards, as long as the entry matches and there are * keys left in the tree. Save a copy of each match in case diff --git a/src/plugins/kdb/db2/libdb2/hash/hash.c b/src/plugins/kdb/db2/libdb2/hash/hash.c index c1a66088a0..2343d223c0 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash.c +++ b/src/plugins/kdb/db2/libdb2/hash/hash.c @@ -428,7 +428,7 @@ hget_header(hashp, page_size) hdr_dest = (u_int8_t *)&hashp->hdr; - /* + /* * XXX * This should not be printing to stderr on a "normal" error case. */ @@ -514,14 +514,14 @@ hdestroy(hashp) free(hashp->bigkey_buf); if (hashp->bigdata_buf) free(hashp->bigdata_buf); - + /* XXX This should really iterate over the cursor queue, but it's not clear how to do that, and the only cursor a hash table ever creates is the one used by hash_seq(). Passing NULL as the first arg is also a kludge, but I know that it's never used, so I do it. The intent is to plug the memory leak. Correctness can come later. */ - + if (hashp->seq_cursor) hashp->seq_cursor->delete(NULL, hashp->seq_cursor, 0); @@ -532,7 +532,7 @@ hdestroy(hashp) if (hashp->fp != -1) (void)close(hashp->fp); - /* + /* * *** This may cause problems if hashp->fname is set in any case * other than the case that we are generating a temporary file name. * Note that the new version of mpool should support temporary @@ -704,7 +704,7 @@ hash_access(hashp, action, key, val) num_items = 0; - /* + /* * Set up item_info so that we're looking for space to add an item * as we cycle through the pages looking for the key. */ @@ -868,7 +868,7 @@ cursor_get(dbp, cursorp, key, val, flags) /* * This needs to be changed around. As is, get_item_next advances * the pointers on the page but this function actually advances - * bucket pointers. This works, since the only other place we + * bucket pointers. This works, since the only other place we * use get_item_next is in hash_access which only deals with one * bucket at a time. However, there is the problem that certain other * functions (such as find_bigpair and delpair) depend on the @@ -920,7 +920,7 @@ cursor_delete(dbp, cursor, flags) /* XXX this is empirically determined, so it might not be completely correct, but it seems to work. At the very least it fixes a memory leak */ - + free(cursor->internal); free(cursor); @@ -937,7 +937,7 @@ hash_seq(dbp, key, val, flag) /* * Seq just uses the default cursor to go sequecing through the - * database. Note that the default cursor is the first in the list. + * database. Note that the default cursor is the first in the list. */ hashp = (HTAB *)dbp->internal; diff --git a/src/plugins/kdb/db2/libdb2/hash/hash.h b/src/plugins/kdb/db2/libdb2/hash/hash.h index b202fc9f22..32793ca5b9 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash.h +++ b/src/plugins/kdb/db2/libdb2/hash/hash.h @@ -193,4 +193,4 @@ typedef struct item_info { #define ITEM_GET_N 4 #define UNKNOWN 0xffffffff /* for num_items */ -#define NO_EXPAND 0xfffffffe +#define NO_EXPAND 0xfffffffe diff --git a/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c b/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c index 06210a57cc..6874f47037 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c +++ b/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c @@ -75,7 +75,7 @@ static int32_t collect_data __P((HTAB *, PAGE16 *, int32_t)); /* * Big_insert * - * You need to do an insert and the key/data pair is greater than + * You need to do an insert and the key/data pair is greater than * MINFILL * the bucket size * * Returns: diff --git a/src/plugins/kdb/db2/libdb2/hash/hash_page.c b/src/plugins/kdb/db2/libdb2/hash/hash_page.c index e25115d3f0..f27e7dd86a 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash_page.c +++ b/src/plugins/kdb/db2/libdb2/hash/hash_page.c @@ -102,7 +102,7 @@ __get_item(hashp, cursorp, key, val, item_info) cursorp->pgno = ADDR(cursorp->pagep); cursorp->ndx = 0; cursorp->pgndx = 0; - } else + } else cursorp->pagep = __get_page(hashp, cursorp->pgno, A_RAW); if (!cursorp->pagep) { @@ -140,7 +140,7 @@ __get_item(hashp, cursorp, key, val, item_info) KEY_OFF(cursorp->pagep, cursorp->pgndx); } - /* + /* * All of this information will be set incorrectly for big keys, but * it will be ignored anyway. */ @@ -183,7 +183,7 @@ __get_item_done(hashp, cursorp) __put_page(hashp, cursorp->pagep, A_RAW, 0); cursorp->pagep = NULL; - /* + /* * We don't throw out the page number since we might want to * continue getting on this page. */ @@ -354,7 +354,7 @@ __delpair(hashp, cursorp, item_info) * item on the page. */ src = (u_int8_t *)pagep + OFFSET(pagep) + 1; - /* + /* * Length is the distance between where to start * deleting and end of the data on the page. */ @@ -399,7 +399,7 @@ __delpair(hashp, cursorp, item_info) db_pgno_t to_find, next_pgno, link_page; /* - * We need to go back to the first page in the chain and + * We need to go back to the first page in the chain and * look for this page so that we can update the previous * page's NEXT_PGNO field. */ @@ -511,7 +511,7 @@ __split_page(hashp, obucket, nbucket) } /* - * Add the given pair to the page. + * Add the given pair to the page. * * * Returns: @@ -545,7 +545,7 @@ __addel(hashp, item_info, key, val, num_items, expanding) /* Advance to first page in chain with room for item. */ while (NUM_ENT(pagep) && NEXT_PGNO(pagep) != INVALID_PGNO) { - /* + /* * This may not be the end of the chain, but the pair may fit * anyway. */ @@ -577,9 +577,9 @@ __addel(hashp, item_info, key, val, num_items, expanding) return (-1); } } - + /* At this point, we know the page fits, so we just add it */ - + if (ISBIG(PAIRSIZE(key, val), hashp)) { if (__big_insert(hashp, pagep, key, val)) return (-1); @@ -624,7 +624,7 @@ __addel(hashp, item_info, key, val, num_items, expanding) return (0); } -/* +/* * Special __addel used in big splitting; this one just puts the pointer * to an already-allocated big page in the appropriate bucket. */ @@ -866,8 +866,8 @@ __pgin_routine(pg_cookie, pgno, page) pagep = (PAGE16 *)page; hashp = (HTAB *)pg_cookie; - /* - * There are the following cases for swapping: + /* + * There are the following cases for swapping: * 0) New page that may be unitialized. * 1) Bucket page or overflow page. Either swap * the header or initialize the page. @@ -906,8 +906,8 @@ __pgout_routine(pg_cookie, pgno, page) pagep = (PAGE16 *)page; hashp = (HTAB *)pg_cookie; - /* - * There are the following cases for swapping: + /* + * There are the following cases for swapping: * 1) Bucket page or overflow page. Just swap the header. * 2) Bitmap page. Swap the whole page! * 3) Header pages. Not handled here; these are written directly diff --git a/src/plugins/kdb/db2/libdb2/hash/page.h b/src/plugins/kdb/db2/libdb2/hash/page.h index 8ef8a2e294..989f967c56 100644 --- a/src/plugins/kdb/db2/libdb2/hash/page.h +++ b/src/plugins/kdb/db2/libdb2/hash/page.h @@ -57,7 +57,7 @@ * other (since we use that fact to compute key lengths). In the accessor * macros below, P means a pointer to the page, I means an index of the * particular entry being accessed. - * + * * Hash base page format * BYTE ITEM NBYTES TYPE ACCESSOR MACRO * ---- ------------------ ------ -------- -------------- @@ -167,7 +167,7 @@ typedef unsigned char PAGE8; #define FREESPACE(P) \ ((OFFSET((P)) + 1 - PAGE_OVERHEAD - (NUM_ENT((P)) * PAIR_OVERHEAD))) -/* +/* * Overhead on header pages is just one word -- the length of the * header info stored on that page. */ diff --git a/src/plugins/kdb/db2/libdb2/include/db-queue.h b/src/plugins/kdb/db2/libdb2/include/db-queue.h index 40d32ccb6e..65612ce6f3 100644 --- a/src/plugins/kdb/db2/libdb2/include/db-queue.h +++ b/src/plugins/kdb/db2/libdb2/include/db-queue.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/src/plugins/kdb/db2/libdb2/include/db.hin b/src/plugins/kdb/db2/libdb2/include/db.hin index ad86d0af9c..dca0b00677 100644 --- a/src/plugins/kdb/db2/libdb2/include/db.hin +++ b/src/plugins/kdb/db2/libdb2/include/db.hin @@ -154,7 +154,7 @@ typedef struct { int lorder; /* byte order */ size_t reclen; /* record length (fixed-length records) */ u_char bval; /* delimiting byte (variable-length records */ - char *bfname; /* btree file name */ + char *bfname; /* btree file name */ } RECNOINFO; #if defined(__cplusplus) diff --git a/src/plugins/kdb/db2/libdb2/mpool/mpool.c b/src/plugins/kdb/db2/libdb2/mpool/mpool.c index 3b0be3f55a..acdc1b8276 100644 --- a/src/plugins/kdb/db2/libdb2/mpool/mpool.c +++ b/src/plugins/kdb/db2/libdb2/mpool/mpool.c @@ -106,7 +106,7 @@ mpool_filter(mp, pgin, pgout, pgcookie) mp->pgout = pgout; mp->pgcookie = pgcookie; } - + /* * mpool_new -- * Get a new page of memory. @@ -173,8 +173,8 @@ mpool_delete(mp, page) free(bp); return (RET_SUCCESS); -} - +} + /* * mpool_get * Get a page. @@ -486,7 +486,7 @@ mpool_stat(mp) mp->pagealloc, mp->pageflush); if (mp->cachehit + mp->cachemiss) (void)fprintf(stderr, - "%.0f%% cache hit rate (%lu hits, %lu misses)\n", + "%.0f%% cache hit rate (%lu hits, %lu misses)\n", ((double)mp->cachehit / (mp->cachehit + mp->cachemiss)) * 100, mp->cachehit, mp->cachemiss); (void)fprintf(stderr, "%lu page reads, %lu page writes\n", @@ -506,7 +506,7 @@ mpool_stat(mp) cnt = 0; } else sep = ", "; - + } (void)fprintf(stderr, "\n"); } diff --git a/src/plugins/kdb/db2/libdb2/recno/rec_put.c b/src/plugins/kdb/db2/libdb2/recno/rec_put.c index e7fa75882f..bd710df842 100644 --- a/src/plugins/kdb/db2/libdb2/recno/rec_put.c +++ b/src/plugins/kdb/db2/libdb2/recno/rec_put.c @@ -170,7 +170,7 @@ einval: errno = EINVAL; if (flags == R_SETCURSOR) t->bt_cursor.rcursor = nrec; - + F_SET(t, R_MODIFIED); return (__rec_ret(t, NULL, nrec, key, NULL)); } diff --git a/src/plugins/kdb/db2/libdb2/recno/rec_search.c b/src/plugins/kdb/db2/libdb2/recno/rec_search.c index a328f1be06..15042627d8 100644 --- a/src/plugins/kdb/db2/libdb2/recno/rec_search.c +++ b/src/plugins/kdb/db2/libdb2/recno/rec_search.c @@ -92,7 +92,7 @@ __rec_search(t, recno, op) } BT_PUSH(t, pg, idx - 1); - + pg = r->pgno; switch (op) { case SDELETE: diff --git a/src/plugins/kdb/db2/libdb2/recno/rec_seq.c b/src/plugins/kdb/db2/libdb2/recno/rec_seq.c index 1edaa998e8..8af1378c34 100644 --- a/src/plugins/kdb/db2/libdb2/recno/rec_seq.c +++ b/src/plugins/kdb/db2/libdb2/recno/rec_seq.c @@ -107,7 +107,7 @@ __rec_seq(dbp, key, data, flags) einval: errno = EINVAL; return (RET_ERROR); } - + if (t->bt_nrecs == 0 || nrec > t->bt_nrecs) { if (!F_ISSET(t, R_EOF | R_INMEM) && (status = t->bt_irec(t, nrec)) != RET_SUCCESS) diff --git a/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c b/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c index f77b676f14..cfd1a4211a 100644 --- a/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c +++ b/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c @@ -8,7 +8,7 @@ #include <stdlib.h> #include <string.h> - + void main(int argc, char *argv[]) { char id1[] = {" "}, id2[] = {" "}; int i; @@ -27,13 +27,13 @@ void main(int argc, char *argv[]) { printf("\n Open error on test.db %d %s\n",errno,strerror(errno)); exit(25); } - + while (fscanf(fin," %10s%10s",id1,id2) > 0) { key.size = 11; data.size = 11; key.data = id1; data.data = id2; - printf("%10s %10s\n",key.data,data.data); + printf("%10s %10s\n",key.data,data.data); if (dbp->put(dbp, &key, &data,R_NOOVERWRITE) != 0) { printf("Error writing output\n"); } @@ -41,7 +41,7 @@ void main(int argc, char *argv[]) { } printf("%d Records in\n",out); dbp->close(dbp); - + if ((dbp = dbopen("test.db", O_RDWR | O_BINARY, 0664 , DB_BTREE, NULL )) == NULL) { printf("\n Error on dbopen %d %s\n",errno,strerror(errno)); @@ -56,7 +56,7 @@ void main(int argc, char *argv[]) { strcpy(id2,data.data); id2[0] = 'U'; datao.data=id2; - printf("%10s %10s\n",key.data,data.data); + printf("%10s %10s\n",key.data,data.data); in++; if (in > 10) break; #ifdef notdef @@ -74,11 +74,11 @@ void main(int argc, char *argv[]) { printf("%d Records copied\n",in); in = 0; dbp->seq(dbp, &key, &data,R_FIRST); - printf("%10s %10s\n",key.data,data.data); + printf("%10s %10s\n",key.data,data.data); in++; while (dbp->seq(dbp, &key, &data,R_NEXT) == 0) { in++; - printf("%10s %10s\n",key.data,data.data); + printf("%10s %10s\n",key.data,data.data); } printf("%d Records read\n",in); dbp->close(dbp); diff --git a/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c b/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c index 06f02b3ad0..0d78d59343 100644 --- a/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c +++ b/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c @@ -691,7 +691,7 @@ load(db, argv) key.size = sizeof(recno_t); data.data = lp; data.size = len + 1; - } else { + } else { key.data = lp; key.size = len + 1; for (p = lp + len - 1, t = buf; p >= lp; *t++ = *p--); diff --git a/src/plugins/kdb/db2/libdb2/test/dbtest.c b/src/plugins/kdb/db2/libdb2/test/dbtest.c index b0aee708dc..df92cd79e8 100644 --- a/src/plugins/kdb/db2/libdb2/test/dbtest.c +++ b/src/plugins/kdb/db2/libdb2/test/dbtest.c @@ -390,7 +390,7 @@ get(dbp, kp) exit(1); } else (void)fprintf(stderr, "%lu: %.*s: %s", - lineno, (int) MIN(kp->size, 20), (char *) kp->data, + lineno, (int) MIN(kp->size, 20), (char *) kp->data, NOSUCHKEY); #undef NOSUCHKEY break; @@ -447,8 +447,8 @@ rem(dbp, kp) if (ofd != STDOUT_FILENO) (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1); else if (flags != R_CURSOR) - (void)fprintf(stderr, "%lu: %.*s: %s", - lineno, (int) MIN(kp->size, 20), (char *) kp->data, + (void)fprintf(stderr, "%lu: %.*s: %s", + lineno, (int) MIN(kp->size, 20), (char *) kp->data, NOSUCHKEY); else (void)fprintf(stderr, @@ -492,8 +492,8 @@ seq(dbp, kp) if (ofd != STDOUT_FILENO) (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1); else if (flags == R_CURSOR) - (void)fprintf(stderr, "%lu: %.*s: %s", - lineno, (int) MIN(kp->size, 20), (char *) kp->data, + (void)fprintf(stderr, "%lu: %.*s: %s", + lineno, (int) MIN(kp->size, 20), (char *) kp->data, NOSUCHKEY); else (void)fprintf(stderr, @@ -534,7 +534,7 @@ dump(dbp, rev) } done: return; } - + u_int setflags(s) char *s; @@ -578,7 +578,7 @@ sflags(lflags) return ("UNKNOWN!"); } - + DBTYPE dbtype(s) char *s; @@ -608,7 +608,7 @@ setinfo(db_type, s) *eq++ = '\0'; if (!isdigit((int) *eq)) err("%s: structure set statement must be a number", s); - + switch (db_type) { case DB_BTREE: if (!strcmp("flags", s)) { diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c index 34397ecaa5..02982b1620 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c @@ -109,6 +109,3 @@ main(argc, argv) } exit(0); } - - - diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tcreat3.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tcreat3.c index f11487b320..6767de5e91 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tcreat3.c +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tcreat3.c @@ -97,7 +97,7 @@ char **argv; fprintf(stderr, "cannot enter: key %s\n", item.data); exit(1); - } + } } (dbp->close)(dbp); diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c index 826611486d..32d8250fc4 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c @@ -99,7 +99,7 @@ char **argv; fprintf(stderr, "cannot enter: key %s\n", item.data); exit(1); - } + } } if ( --argc ) { @@ -113,7 +113,7 @@ char **argv; if (stat) { fprintf ( stderr, "Error retrieving %s\n", key.data ); exit(1); - } + } } fclose(fp); } diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c index b15b617bc7..830d7a1854 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c @@ -85,8 +85,8 @@ char **argv; key.data = wp1; item.data = wp2; - while ( fgets(wp1, 8192, stdin) && - fgets(wp2, 8192, stdin) && + while ( fgets(wp1, 8192, stdin) && + fgets(wp2, 8192, stdin) && i++ < MAXWORDS) { /* * put info in structure, and structure in the item @@ -102,14 +102,14 @@ char **argv; item.data); fprintf(stderr, "\terrno: %d\n", errno); exit(1); - } + } } if ( --argc ) { fp = fopen ( argv[0], "r"); i = 0; - while ( fgets(wp1, 256, fp) && - fgets(wp2, 8192, fp) && + while ( fgets(wp1, 256, fp) && + fgets(wp2, 8192, fp) && i++ < MAXWORDS) { key.size = strlen(wp1); diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tseq.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tseq.c index d2d36862d1..bee41961ef 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tseq.c +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tseq.c @@ -72,7 +72,7 @@ char **argv; /* * put info in structure, and structure in the item */ - for ( stat = (dbp->seq) (dbp, &res, &item, 1 ); + for ( stat = (dbp->seq) (dbp, &res, &item, 1 ); stat == 0; stat = (dbp->seq) (dbp, &res, &item, 0 ) ) { diff --git a/src/plugins/kdb/db2/libdb2/test/hash2.tests/bigtest.c b/src/plugins/kdb/db2/libdb2/test/hash2.tests/bigtest.c index 81c559ad2a..c8070c5038 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash2.tests/bigtest.c +++ b/src/plugins/kdb/db2/libdb2/test/hash2.tests/bigtest.c @@ -33,9 +33,9 @@ main(void) returned.data = NULL; if (n == 4627) printf(""); - if (n % 50 == 0) + if (n % 50 == 0) printf("put n = %d\n", n); - if (db->put(db, &key, &value, 0) != 0) + if (db->put(db, &key, &value, 0) != 0) printf("put error, n = %d\n", n); if (db->get(db, &key, &returned, 0) != 0) printf("Immediate get error, n = %d\n", n); @@ -47,7 +47,7 @@ main(void) } for (n = 0; n < 200000; n++) { - if (n % 50 == 0) + if (n % 50 == 0) printf("seq n = %d\n", n); if ((db->seq(db, &key, &returned, 0)) != 0) printf("Seq error, n = %d\n", n); @@ -57,10 +57,10 @@ main(void) for (i = 0; i < 800; i++) if (((int *)returned.data)[i] != 0xDEADBEEF) printf("ERRORRRRRR!!! seq %d\n", n); - } + } for (n = 0; n < 2000; n++) { - if (n % 50 == 0) + if (n % 50 == 0) printf("get n = %d\n", n); if (db->get(db, &key, &returned, 0) != 0) printf("Late get error, n = %d\n", n); @@ -73,4 +73,3 @@ main(void) free(value.data); return(0); } - diff --git a/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c b/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c index adb72c004b..43895a4293 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c +++ b/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c @@ -14,7 +14,7 @@ main(void) char *key_line, *val_line, *get_key, *get_val, *old, *key2; HASHINFO passwd; int n = 0, i = 0, expected; - + key_line = (char *)malloc(100); val_line = (char *)malloc(300); old = (char *)malloc(300); @@ -28,15 +28,15 @@ main(void) passwd.hash = NULL; passwd.nelem = 0; passwd.lorder = 4321; - - db = dbopen("/usr/tmp/passwd.db", O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0664, DB_HASH, + + db = dbopen("/usr/tmp/passwd.db", O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0664, DB_HASH, &passwd); if (!db) { fprintf(stderr, "create_db: couldn't create database file\n"); exit(1); } - + while ((key_line = fgets(key_line, 100, keys)) != NULL) { if (n % 1000 == 0) fprintf(stderr, "Putting #%d.\n", n); @@ -52,7 +52,7 @@ main(void) fprintf(stderr, "Immediate get error, n = %d\n", n); } fprintf(stderr, "Done with put!\n"); - free(key_line); + free(key_line); free(val_line); fclose(keys); fclose(vals); @@ -60,7 +60,7 @@ main(void) - + keys = fopen("yp.keys", "rt"); vals = fopen("yp.total", "rt"); get_key = (char *)malloc(100); @@ -81,7 +81,7 @@ main(void) fgets(get_val, 300, vals); if (memcmp(val.data, (void *)get_val, val.size)) { fprintf(stderr, "Unmatched get on %s.\n", get_key); - fprintf(stderr, "Input = %s\nOutput = %s\n", get_val, + fprintf(stderr, "Input = %s\nOutput = %s\n", get_val, (char *)val.data); } } @@ -107,7 +107,7 @@ main(void) if (n % 1000 == 0) fprintf(stderr, "Sequence getting #%d.\n", n); if (db->seq(db, &key, &val, 0) != 0) { - fprintf(stderr, + fprintf(stderr, "Exiting sequence retrieve; n = %d, expected = %d\n", n - 1 , expected); break; @@ -131,7 +131,7 @@ main(void) n+=2; key2 = fgets(get_key, 100, keys); if (!key2) - break; + break; key.data = (void *)key2; key.size = strlen(key2); if (db->del(db, &key, 0) != 0) @@ -150,7 +150,7 @@ main(void) keys = fopen("yp.keys", "rt"); vals = fopen("yp.total", "rt"); - + db = dbopen("/usr/tmp/passwd.db", O_RDWR|O_BINARY, 0664, DB_HASH, &passwd); n = 0; while ((get_key = fgets(get_key, 100, keys)) != NULL) { @@ -160,14 +160,14 @@ main(void) key2 = fgets(key2, 100, keys); if (!key2) break; - key.data = (void *)get_key; + key.data = (void *)get_key; key.size = strlen(get_key); - if (db->get(db, &key, &val, 0) != 0) + if (db->get(db, &key, &val, 0) != 0) fprintf(stderr, "Retrieval after delete error on %d\n", n); fgets(get_val, 300, vals); if (memcmp(val.data, (void *)get_val, val.size)) { fprintf(stderr, "Unmatched get after delete on %s.\n", get_key); - fprintf(stderr, "Input = %s\nOutput = %s\n", get_val, + fprintf(stderr, "Input = %s\nOutput = %s\n", get_val, (char *)val.data); } fgets(get_val, 300, vals); diff --git a/src/plugins/kdb/db2/libdb2/test/hash2.tests/passwd/genpass.c b/src/plugins/kdb/db2/libdb2/test/hash2.tests/passwd/genpass.c index da37676878..7d03e609cb 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash2.tests/passwd/genpass.c +++ b/src/plugins/kdb/db2/libdb2/test/hash2.tests/passwd/genpass.c @@ -6,7 +6,7 @@ main(int argc, char **argv) { int i,j,n; char *pass[8], r; - + n = atoi(argv[1]); srandom(101173); @@ -20,4 +20,3 @@ main(int argc, char **argv) printf("\n"); } } - |