# HG changeset patch # User Matti Hamalainen # Date 1455488930 -7200 # Node ID be62e4abe3a9d8287523d4a068fd5fa8568e93aa # Parent 29a080678091e074cefc9d83b6398a741721bc43 Rename a structure member. diff -r 29a080678091 -r be62e4abe3a9 sidlib.c --- a/sidlib.c Sun Feb 14 20:38:09 2016 +0200 +++ b/sidlib.c Mon Feb 15 00:28:50 2016 +0200 @@ -455,25 +455,25 @@ th_free_r(&dbh->pindex); // Get size of db - for (node = dbh->nodes, dbh->n = 0; node != NULL; node = node->next) - dbh->n++; + for (node = dbh->nodes, dbh->nnodes = 0; node != NULL; node = node->next) + dbh->nnodes++; // Check number of nodes - if (dbh->n > 0) + if (dbh->nnodes > 0) { size_t i; // Allocate memory for index-table - dbh->pindex = (SIDLibSLDBNode **) th_malloc(sizeof(SIDLibSLDBNode *) * dbh->n); + dbh->pindex = (SIDLibSLDBNode **) th_malloc(sizeof(SIDLibSLDBNode *) * dbh->nnodes); if (dbh->pindex == NULL) return THERR_MALLOC; // Get node-pointers to table - for (i = 0, node = dbh->nodes; node && i < dbh->n; node = node->next) + for (i = 0, node = dbh->nodes; node && i < dbh->nnodes; node = node->next) dbh->pindex[i++] = node; // Sort the indexes - qsort(dbh->pindex, dbh->n, sizeof(SIDLibSLDBNode *), si_sldb_compare_nodes); + qsort(dbh->pindex, dbh->nnodes, sizeof(SIDLibSLDBNode *), si_sldb_compare_nodes); } return THERR_OK; @@ -495,7 +495,7 @@ } dbh->nodes = NULL; - dbh->n = 0; + dbh->nnodes = 0; th_free_r(&dbh->pindex); th_free(dbh); @@ -509,7 +509,7 @@ memcpy(&keyItem.hash, hash, sizeof(th_md5hash_t)); key = &keyItem; - item = bsearch(&key, dbh->pindex, dbh->n, sizeof(dbh->pindex[0]), si_sldb_compare_nodes); + item = bsearch(&key, dbh->pindex, dbh->nnodes, sizeof(dbh->pindex[0]), si_sldb_compare_nodes); return (item != NULL) ? *item : NULL; } diff -r 29a080678091 -r be62e4abe3a9 sidlib.h --- a/sidlib.h Sun Feb 14 20:38:09 2016 +0200 +++ b/sidlib.h Mon Feb 15 00:28:50 2016 +0200 @@ -35,7 +35,7 @@ { SIDLibSLDBNode *nodes, **pindex; - size_t n; + size_t nnodes; } SIDLibSLDB;