]> git.ozlabs.org Git - ccan/commitdiff
tdb2: remove extraneous whitespace.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)
Gets us one extra ccanlint point, too.

ccan/tdb2/check.c
ccan/tdb2/free.c
ccan/tdb2/hash.c
ccan/tdb2/io.c
ccan/tdb2/lock.c
ccan/tdb2/private.h
ccan/tdb2/summary.c
ccan/tdb2/tdb2.h
ccan/tdb2/traverse.c

index afb682f5e74c8869f77a12ca8436f797b5413ff2..4cd92b43c040a30c40e4e952e05aac5deb0a13e9 100644 (file)
@@ -1,7 +1,7 @@
- /* 
+ /*
    Trivial Database 2: free list/block handling
    Copyright (C) Rusty Russell 2010
-   
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
@@ -277,7 +277,7 @@ static bool check_hash_tree(struct tdb_context *tdb,
 
                        if (is_subhash(group[b])) {
                                uint64_t subprefix;
-                               subprefix = (hprefix 
+                               subprefix = (hprefix
                                     << (group_bits + TDB_HASH_GROUP_BITS))
                                        + g * (1 << TDB_HASH_GROUP_BITS) + b;
 
@@ -449,7 +449,7 @@ static bool check_free(struct tdb_context *tdb,
        }
        return true;
 }
-                      
+
 static bool check_free_table(struct tdb_context *tdb,
                             tdb_off_t ftable_off,
                             unsigned ftable_num,
index ba14dfcd70747b8ad6789ba08487d30b91cbc6fc..4930400d50f7cabd560d5b31461b6485bea0ab8a 100644 (file)
@@ -1,7 +1,7 @@
- /* 
+ /*
    Trivial Database 2: free list/block handling
    Copyright (C) Rusty Russell 2010
-   
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
index e1b1dfe34bdbfa071e8e4b8a43595c56af247b9d..d242d531780d1d41b7e330b0abfcf894012c82de 100644 (file)
@@ -1,7 +1,7 @@
- /* 
+ /*
    Trivial Database 2: hash handling
    Copyright (C) Rusty Russell 2010
-   
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
@@ -245,7 +245,7 @@ tdb_off_t find_and_lock(struct tdb_context *tdb,
                tinfo->toplevel_group = group;
                tinfo->num_levels = 1;
                tinfo->levels[0].entry = 0;
-               tinfo->levels[0].hashtable = hashtable 
+               tinfo->levels[0].hashtable = hashtable
                        + (group << TDB_HASH_GROUP_BITS) * sizeof(tdb_off_t);
                tinfo->levels[0].total_buckets = 1 << TDB_HASH_GROUP_BITS;
        }
@@ -384,7 +384,7 @@ static tdb_off_t encode_offset(tdb_off_t new_off, struct hash_info *h)
                   << TDB_OFF_HASH_EXTRA_BIT);
 }
 
-/* Simply overwrite the hash entry we found before. */ 
+/* Simply overwrite the hash entry we found before. */
 int replace_in_hash(struct tdb_context *tdb,
                    struct hash_info *h,
                    tdb_off_t new_off)
@@ -716,12 +716,12 @@ int next_in_hash(struct tdb_context *tdb, int ltype,
                        /* They want data as well? */
                        if (dlen) {
                                *dlen = rec_data_length(&rec);
-                               kbuf->dptr = tdb_alloc_read(tdb, 
+                               kbuf->dptr = tdb_alloc_read(tdb,
                                                            off + sizeof(rec),
                                                            kbuf->dsize
                                                            + *dlen);
                        } else {
-                               kbuf->dptr = tdb_alloc_read(tdb, 
+                               kbuf->dptr = tdb_alloc_read(tdb,
                                                            off + sizeof(rec),
                                                            kbuf->dsize);
                        }
index 13af1aecc14336043ff8cc85856429152195a301..7fc268ea551bc8dcaed8cc05a3c04999e09a9cfb 100644 (file)
@@ -1,4 +1,4 @@
- /* 
+ /*
    Unix SMB/CIFS implementation.
 
    trivial database library
@@ -64,7 +64,7 @@ void tdb_mmap(struct tdb_context *tdb)
 
 /* check for an out of bounds access - if it is out of bounds then
    see if the database has been expanded by someone else and expand
-   if necessary 
+   if necessary
    note that "len" is the minimum length needed for the db
 */
 static int tdb_oob(struct tdb_context *tdb, tdb_off_t len, bool probe)
@@ -207,7 +207,7 @@ tdb_off_t tdb_read_off(struct tdb_context *tdb, tdb_off_t off)
 }
 
 /* write a lump of data at a specified offset */
-static int tdb_write(struct tdb_context *tdb, tdb_off_t off, 
+static int tdb_write(struct tdb_context *tdb, tdb_off_t off,
                     const void *buf, tdb_len_t len)
 {
        if (tdb->read_only) {
@@ -411,7 +411,7 @@ static int tdb_expand_file(struct tdb_context *tdb, tdb_len_t addition)
 const void *tdb_access_read(struct tdb_context *tdb,
                            tdb_off_t off, tdb_len_t len, bool convert)
 {
-       const void *ret = NULL; 
+       const void *ret = NULL;
 
        if (likely(!(tdb->flags & TDB_CONVERT)))
                ret = tdb->methods->direct(tdb, off, len, false);
index c503c9a28bb444efa805217d7cd483ae4eed5bed..476b98f3f7ba0d9318edeedafc01ab717f6fe594 100644 (file)
@@ -1,4 +1,4 @@
- /* 
+ /*
    Unix SMB/CIFS implementation.
 
    trivial database library
@@ -198,7 +198,7 @@ static int tdb_brunlock(struct tdb_context *tdb,
   upgrade a read lock to a write lock. This needs to be handled in a
   special way as some OSes (such as solaris) have too conservative
   deadlock detection and claim a deadlock when progress can be
-  made. For those OSes we may loop for a while.  
+  made. For those OSes we may loop for a while.
 */
 int tdb_allrecord_upgrade(struct tdb_context *tdb)
 {
@@ -502,7 +502,7 @@ again:
                        tdb_logerr(tdb, tdb->ecode, TDB_DEBUG_ERROR,
                                 "tdb_allrecord_lock freetables failed");
                }
-               tdb_brunlock(tdb, ltype, TDB_HASH_LOCK_START, 
+               tdb_brunlock(tdb, ltype, TDB_HASH_LOCK_START,
                             TDB_HASH_LOCK_RANGE);
                return -1;
        }
@@ -518,7 +518,7 @@ again:
                tdb_allrecord_unlock(tdb, ltype);
                if (tdb_lock_and_recover(tdb) == -1) {
                        return -1;
-               }               
+               }
                goto again;
        }
 
index e2982bc5aac6cb49ac5c0118736f5c7b536e94c7..c4f8cebd1de4abd354d432a502d0f395479013d8 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef TDB_PRIVATE_H
 #define TDB_PRIVATE_H
- /* 
+ /*
    Trivial Database 2: private types and prototypes
    Copyright (C) Rusty Russell 2010
 
@@ -325,7 +325,7 @@ struct tdb_context {
        int mmap_flags;
 
        /* Error code for last tdb error. */
-       enum TDB_ERROR ecode; 
+       enum TDB_ERROR ecode;
 
        /* the flags passed to tdb_open, for tdb_reopen. */
        uint32_t flags;
@@ -361,7 +361,7 @@ struct tdb_context {
 
        /* Single list of all TDBs, to avoid multiple opens. */
        struct tdb_context *next;
-       dev_t device;   
+       dev_t device;
        ino_t inode;
 };
 
index bb9f5cb54eb5fd3e5dc8fb6257899546e046823b..25be07b0083e7252cfdf7560f9344d83d076159a 100644 (file)
@@ -1,7 +1,7 @@
- /* 
+ /*
    Trivial Database 2: human-readable summary code
    Copyright (C) Rusty Russell 2010
-   
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
index d194de36aebc568b40962ef7a29fbe1e34b97144..f738d1ceafddfc0cefc034c1f7ca1497ebf1553e 100644 (file)
@@ -1,17 +1,17 @@
 #ifndef CCAN_TDB2_H
 #define CCAN_TDB2_H
 
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    trivial database library
 
    Copyright (C) Andrew Tridgell 1999-2004
-   
+
      ** NOTE! The following LGPL license applies to the tdb
      ** library. This does NOT imply that all of Samba is released
      ** under the LGPL
-   
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
@@ -60,7 +60,7 @@ extern "C" {
 #define TDB_ALLOW_NESTING 512 /* Allow transactions to nest */
 
 /* error codes */
-enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK, 
+enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK,
                TDB_ERR_OOM, TDB_ERR_EXISTS, TDB_ERR_NOEXIST,
                TDB_ERR_EINVAL, TDB_ERR_RDONLY, TDB_ERR_NESTING };
 
@@ -68,7 +68,7 @@ enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK,
 enum tdb_summary_flags { TDB_SUMMARY_HISTOGRAMS = 1 };
 
 /* logging uses one of the following levels */
-enum tdb_debug_level {TDB_DEBUG_FATAL = 0, TDB_DEBUG_ERROR, 
+enum tdb_debug_level {TDB_DEBUG_FATAL = 0, TDB_DEBUG_ERROR,
                      TDB_DEBUG_WARNING, TDB_DEBUG_TRACE};
 
 typedef struct tdb_data {
index 14cdac65148fa05c419f0bd6a514806d99d2fc28..b79cc8b47e7c090e64ee12b69b225e8ba4b33f78 100644 (file)
@@ -1,7 +1,7 @@
- /* 
+ /*
    Trivial Database 2: traverse function.
    Copyright (C) Rusty Russell 2010
-   
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
@@ -74,7 +74,7 @@ TDB_DATA tdb_firstkey(struct tdb_context *tdb)
        default:
                return tdb_null;
        }
-}              
+}
 
 /* We lock twice, not very efficient.  We could keep last key & tinfo cached. */
 TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA key)
@@ -97,4 +97,4 @@ TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA key)
        default:
                return tdb_null;
        }
-}              
+}