Browse Source

tdb2: remove extraneous whitespace.

Gets us one extra ccanlint point, too.
Rusty Russell 15 years ago
parent
commit
0aa58f6e60
9 changed files with 34 additions and 34 deletions
  1. 4 4
      ccan/tdb2/check.c
  2. 2 2
      ccan/tdb2/free.c
  3. 6 6
      ccan/tdb2/hash.c
  4. 4 4
      ccan/tdb2/io.c
  5. 4 4
      ccan/tdb2/lock.c
  6. 3 3
      ccan/tdb2/private.h
  7. 2 2
      ccan/tdb2/summary.c
  8. 5 5
      ccan/tdb2/tdb2.h
  9. 4 4
      ccan/tdb2/traverse.c

+ 4 - 4
ccan/tdb2/check.c

@@ -1,7 +1,7 @@
- /* 
+ /*
    Trivial Database 2: free list/block handling
    Trivial Database 2: free list/block handling
    Copyright (C) Rusty Russell 2010
    Copyright (C) Rusty Russell 2010
-   
+
    This library is free software; you can redistribute it and/or
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    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])) {
 			if (is_subhash(group[b])) {
 				uint64_t subprefix;
 				uint64_t subprefix;
-				subprefix = (hprefix 
+				subprefix = (hprefix
 				     << (group_bits + TDB_HASH_GROUP_BITS))
 				     << (group_bits + TDB_HASH_GROUP_BITS))
 					+ g * (1 << TDB_HASH_GROUP_BITS) + b;
 					+ g * (1 << TDB_HASH_GROUP_BITS) + b;
 
 
@@ -449,7 +449,7 @@ static bool check_free(struct tdb_context *tdb,
 	}
 	}
 	return true;
 	return true;
 }
 }
-		       
+
 static bool check_free_table(struct tdb_context *tdb,
 static bool check_free_table(struct tdb_context *tdb,
 			     tdb_off_t ftable_off,
 			     tdb_off_t ftable_off,
 			     unsigned ftable_num,
 			     unsigned ftable_num,

+ 2 - 2
ccan/tdb2/free.c

@@ -1,7 +1,7 @@
- /* 
+ /*
    Trivial Database 2: free list/block handling
    Trivial Database 2: free list/block handling
    Copyright (C) Rusty Russell 2010
    Copyright (C) Rusty Russell 2010
-   
+
    This library is free software; you can redistribute it and/or
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    License as published by the Free Software Foundation; either

+ 6 - 6
ccan/tdb2/hash.c

@@ -1,7 +1,7 @@
- /* 
+ /*
    Trivial Database 2: hash handling
    Trivial Database 2: hash handling
    Copyright (C) Rusty Russell 2010
    Copyright (C) Rusty Russell 2010
-   
+
    This library is free software; you can redistribute it and/or
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    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->toplevel_group = group;
 		tinfo->num_levels = 1;
 		tinfo->num_levels = 1;
 		tinfo->levels[0].entry = 0;
 		tinfo->levels[0].entry = 0;
-		tinfo->levels[0].hashtable = hashtable 
+		tinfo->levels[0].hashtable = hashtable
 			+ (group << TDB_HASH_GROUP_BITS) * sizeof(tdb_off_t);
 			+ (group << TDB_HASH_GROUP_BITS) * sizeof(tdb_off_t);
 		tinfo->levels[0].total_buckets = 1 << TDB_HASH_GROUP_BITS;
 		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);
 		   << 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,
 int replace_in_hash(struct tdb_context *tdb,
 		    struct hash_info *h,
 		    struct hash_info *h,
 		    tdb_off_t new_off)
 		    tdb_off_t new_off)
@@ -716,12 +716,12 @@ int next_in_hash(struct tdb_context *tdb, int ltype,
 			/* They want data as well? */
 			/* They want data as well? */
 			if (dlen) {
 			if (dlen) {
 				*dlen = rec_data_length(&rec);
 				*dlen = rec_data_length(&rec);
-				kbuf->dptr = tdb_alloc_read(tdb, 
+				kbuf->dptr = tdb_alloc_read(tdb,
 							    off + sizeof(rec),
 							    off + sizeof(rec),
 							    kbuf->dsize
 							    kbuf->dsize
 							    + *dlen);
 							    + *dlen);
 			} else {
 			} else {
-				kbuf->dptr = tdb_alloc_read(tdb, 
+				kbuf->dptr = tdb_alloc_read(tdb,
 							    off + sizeof(rec),
 							    off + sizeof(rec),
 							    kbuf->dsize);
 							    kbuf->dsize);
 			}
 			}

+ 4 - 4
ccan/tdb2/io.c

@@ -1,4 +1,4 @@
- /* 
+ /*
    Unix SMB/CIFS implementation.
    Unix SMB/CIFS implementation.
 
 
    trivial database library
    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
 /* 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
    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
    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)
 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 */
 /* 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)
 		     const void *buf, tdb_len_t len)
 {
 {
 	if (tdb->read_only) {
 	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,
 const void *tdb_access_read(struct tdb_context *tdb,
 			    tdb_off_t off, tdb_len_t len, bool convert)
 			    tdb_off_t off, tdb_len_t len, bool convert)
 {
 {
-	const void *ret = NULL;	
+	const void *ret = NULL;
 
 
 	if (likely(!(tdb->flags & TDB_CONVERT)))
 	if (likely(!(tdb->flags & TDB_CONVERT)))
 		ret = tdb->methods->direct(tdb, off, len, false);
 		ret = tdb->methods->direct(tdb, off, len, false);

+ 4 - 4
ccan/tdb2/lock.c

@@ -1,4 +1,4 @@
- /* 
+ /*
    Unix SMB/CIFS implementation.
    Unix SMB/CIFS implementation.
 
 
    trivial database library
    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
   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
   special way as some OSes (such as solaris) have too conservative
   deadlock detection and claim a deadlock when progress can be
   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)
 int tdb_allrecord_upgrade(struct tdb_context *tdb)
 {
 {
@@ -502,7 +502,7 @@ again:
 			tdb_logerr(tdb, tdb->ecode, TDB_DEBUG_ERROR,
 			tdb_logerr(tdb, tdb->ecode, TDB_DEBUG_ERROR,
 				 "tdb_allrecord_lock freetables failed");
 				 "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);
 			     TDB_HASH_LOCK_RANGE);
 		return -1;
 		return -1;
 	}
 	}
@@ -518,7 +518,7 @@ again:
 		tdb_allrecord_unlock(tdb, ltype);
 		tdb_allrecord_unlock(tdb, ltype);
 		if (tdb_lock_and_recover(tdb) == -1) {
 		if (tdb_lock_and_recover(tdb) == -1) {
 			return -1;
 			return -1;
-		}		
+		}
 		goto again;
 		goto again;
 	}
 	}
 
 

+ 3 - 3
ccan/tdb2/private.h

@@ -1,6 +1,6 @@
 #ifndef TDB_PRIVATE_H
 #ifndef TDB_PRIVATE_H
 #define TDB_PRIVATE_H
 #define TDB_PRIVATE_H
- /* 
+ /*
    Trivial Database 2: private types and prototypes
    Trivial Database 2: private types and prototypes
    Copyright (C) Rusty Russell 2010
    Copyright (C) Rusty Russell 2010
 
 
@@ -325,7 +325,7 @@ struct tdb_context {
 	int mmap_flags;
 	int mmap_flags;
 
 
 	/* Error code for last tdb error. */
 	/* Error code for last tdb error. */
-	enum TDB_ERROR ecode; 
+	enum TDB_ERROR ecode;
 
 
 	/* the flags passed to tdb_open, for tdb_reopen. */
 	/* the flags passed to tdb_open, for tdb_reopen. */
 	uint32_t flags;
 	uint32_t flags;
@@ -361,7 +361,7 @@ struct tdb_context {
 
 
 	/* Single list of all TDBs, to avoid multiple opens. */
 	/* Single list of all TDBs, to avoid multiple opens. */
 	struct tdb_context *next;
 	struct tdb_context *next;
-	dev_t device;	
+	dev_t device;
 	ino_t inode;
 	ino_t inode;
 };
 };
 
 

+ 2 - 2
ccan/tdb2/summary.c

@@ -1,7 +1,7 @@
- /* 
+ /*
    Trivial Database 2: human-readable summary code
    Trivial Database 2: human-readable summary code
    Copyright (C) Rusty Russell 2010
    Copyright (C) Rusty Russell 2010
-   
+
    This library is free software; you can redistribute it and/or
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    License as published by the Free Software Foundation; either

+ 5 - 5
ccan/tdb2/tdb2.h

@@ -1,17 +1,17 @@
 #ifndef CCAN_TDB2_H
 #ifndef CCAN_TDB2_H
 #define CCAN_TDB2_H
 #define CCAN_TDB2_H
 
 
-/* 
+/*
    Unix SMB/CIFS implementation.
    Unix SMB/CIFS implementation.
 
 
    trivial database library
    trivial database library
 
 
    Copyright (C) Andrew Tridgell 1999-2004
    Copyright (C) Andrew Tridgell 1999-2004
-   
+
      ** NOTE! The following LGPL license applies to the tdb
      ** NOTE! The following LGPL license applies to the tdb
      ** library. This does NOT imply that all of Samba is released
      ** library. This does NOT imply that all of Samba is released
      ** under the LGPL
      ** under the LGPL
-   
+
    This library is free software; you can redistribute it and/or
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    License as published by the Free Software Foundation; either
@@ -60,7 +60,7 @@ extern "C" {
 #define TDB_ALLOW_NESTING 512 /* Allow transactions to nest */
 #define TDB_ALLOW_NESTING 512 /* Allow transactions to nest */
 
 
 /* error codes */
 /* 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_OOM, TDB_ERR_EXISTS, TDB_ERR_NOEXIST,
 		TDB_ERR_EINVAL, TDB_ERR_RDONLY, TDB_ERR_NESTING };
 		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 };
 enum tdb_summary_flags { TDB_SUMMARY_HISTOGRAMS = 1 };
 
 
 /* logging uses one of the following levels */
 /* 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};
 		      TDB_DEBUG_WARNING, TDB_DEBUG_TRACE};
 
 
 typedef struct tdb_data {
 typedef struct tdb_data {

+ 4 - 4
ccan/tdb2/traverse.c

@@ -1,7 +1,7 @@
- /* 
+ /*
    Trivial Database 2: traverse function.
    Trivial Database 2: traverse function.
    Copyright (C) Rusty Russell 2010
    Copyright (C) Rusty Russell 2010
-   
+
    This library is free software; you can redistribute it and/or
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    License as published by the Free Software Foundation; either
@@ -74,7 +74,7 @@ TDB_DATA tdb_firstkey(struct tdb_context *tdb)
 	default:
 	default:
 		return tdb_null;
 		return tdb_null;
 	}
 	}
-}		
+}
 
 
 /* We lock twice, not very efficient.  We could keep last key & tinfo cached. */
 /* We lock twice, not very efficient.  We could keep last key & tinfo cached. */
 TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA key)
 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:
 	default:
 		return tdb_null;
 		return tdb_null;
 	}
 	}
-}		
+}