summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2012-09-11 13:26:36 +0800
committerDaniel Veillard <veillard@redhat.com>2012-09-11 13:26:36 +0800
commitf8e3db0445a1bc8cfe3f77326b07ec161482caa2 (patch)
treed58aad0a8629f897a8272b9a040a9416d46bb446 /hash.c
parent429d3a0aae2eda7ba9451f9c9f8523c61cc0368b (diff)
downloadlibxml2-f8e3db0445a1bc8cfe3f77326b07ec161482caa2.tar.gz
Big space and tab cleanup
Remove all space before tabs and space and tabs at end of lines.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/hash.c b/hash.c
index 15e1efe9..afabcb1a 100644
--- a/hash.c
+++ b/hash.c
@@ -83,7 +83,7 @@ xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name,
const xmlChar *name2, const xmlChar *name3) {
unsigned long value = 0L;
char ch;
-
+
#ifdef HASH_RANDOMIZATION
value = table->random_seed;
#endif
@@ -113,7 +113,7 @@ xmlHashComputeQKey(xmlHashTablePtr table,
const xmlChar *prefix3, const xmlChar *name3) {
unsigned long value = 0L;
char ch;
-
+
#ifdef HASH_RANDOMIZATION
value = table->random_seed;
#endif
@@ -169,10 +169,10 @@ xmlHashComputeQKey(xmlHashTablePtr table,
xmlHashTablePtr
xmlHashCreate(int size) {
xmlHashTablePtr table;
-
+
if (size <= 0)
size = 256;
-
+
table = xmlMalloc(sizeof(xmlHashTable));
if (table) {
table->dict = NULL;
@@ -180,11 +180,11 @@ xmlHashCreate(int size) {
table->nbElems = 0;
table->table = xmlMalloc(size * sizeof(xmlHashEntry));
if (table->table) {
- memset(table->table, 0, size * sizeof(xmlHashEntry));
+ memset(table->table, 0, size * sizeof(xmlHashEntry));
#ifdef HASH_RANDOMIZATION
table->random_seed = __xmlRandom();
#endif
- return(table);
+ return(table);
}
xmlFree(table);
}
@@ -230,7 +230,7 @@ xmlHashGrow(xmlHashTablePtr table, int size) {
#ifdef DEBUG_GROW
unsigned long nbElem = 0;
#endif
-
+
if (table == NULL)
return(-1);
if (size < 8)
@@ -242,7 +242,7 @@ xmlHashGrow(xmlHashTablePtr table, int size) {
oldtable = table->table;
if (oldtable == NULL)
return(-1);
-
+
table->table = xmlMalloc(size * sizeof(xmlHashEntry));
if (table->table == NULL) {
table->table = oldtable;
@@ -252,13 +252,13 @@ xmlHashGrow(xmlHashTablePtr table, int size) {
table->size = size;
/* If the two loops are merged, there would be situations where
- a new entry needs to allocated and data copied into it from
+ a new entry needs to allocated and data copied into it from
the main table. So instead, we run through the array twice, first
copying all the elements in the main array (where we can't get
conflicts) and then the rest, so we only free (and don't allocate)
*/
for (i = 0; i < oldsize; i++) {
- if (oldtable[i].valid == 0)
+ if (oldtable[i].valid == 0)
continue;
key = xmlHashComputeKey(table, oldtable[i].name, oldtable[i].name2,
oldtable[i].name3);
@@ -282,8 +282,8 @@ xmlHashGrow(xmlHashTablePtr table, int size) {
table->table[key].next = NULL;
xmlFree(iter);
} else {
- iter->next = table->table[key].next;
- table->table[key].next = iter;
+ iter->next = table->table[key].next;
+ table->table[key].next = iter;
}
#ifdef DEBUG_GROW
@@ -599,7 +599,7 @@ xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name,
entry->valid = 1;
- if (insert != NULL)
+ if (insert != NULL)
insert->next = entry;
table->nbElems++;
@@ -748,7 +748,7 @@ xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name,
* Returns the a pointer to the userdata
*/
void *
-xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name,
+xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name,
const xmlChar *name2, const xmlChar *name3) {
unsigned long key;
xmlHashEntryPtr entry;
@@ -821,14 +821,14 @@ typedef struct {
void *data;
} stubData;
-static void
-stubHashScannerFull (void *payload, void *data, const xmlChar *name,
+static void
+stubHashScannerFull (void *payload, void *data, const xmlChar *name,
const xmlChar *name2 ATTRIBUTE_UNUSED,
const xmlChar *name3 ATTRIBUTE_UNUSED) {
stubData *stubdata = (stubData *) data;
stubdata->hashscanner (payload, stubdata->data, (xmlChar *) name);
-}
-
+}
+
/**
* xmlHashScan:
* @table: the hash table
@@ -841,7 +841,7 @@ void
xmlHashScan(xmlHashTablePtr table, xmlHashScanner f, void *data) {
stubData stubdata;
stubdata.data = data;
- stubdata.hashscanner = f;
+ stubdata.hashscanner = f;
xmlHashScanFull (table, stubHashScannerFull, &stubdata);
}
@@ -866,7 +866,7 @@ xmlHashScanFull(xmlHashTablePtr table, xmlHashScannerFull f, void *data) {
if (table->table) {
for(i = 0; i < table->size; i++) {
- if (table->table[i].valid == 0)
+ if (table->table[i].valid == 0)
continue;
iter = &(table->table[i]);
while (iter) {
@@ -905,7 +905,7 @@ xmlHashScanFull(xmlHashTablePtr table, xmlHashScannerFull f, void *data) {
* the comparison is considered to match.
*/
void
-xmlHashScan3(xmlHashTablePtr table, const xmlChar *name,
+xmlHashScan3(xmlHashTablePtr table, const xmlChar *name,
const xmlChar *name2, const xmlChar *name3,
xmlHashScanner f, void *data) {
xmlHashScanFull3 (table, name, name2, name3,
@@ -926,7 +926,7 @@ xmlHashScan3(xmlHashTablePtr table, const xmlChar *name,
* the comparison is considered to match.
*/
void
-xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name,
+xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name,
const xmlChar *name2, const xmlChar *name3,
xmlHashScannerFull f, void *data) {
int i;