Jim Tcl
Check-in [fc6a281ba4]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improve comments for JimResetHashTable()

and Jim_FreeHashTable()

Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk |
Files: files | file ages | folders
SHA1: fc6a281ba4556e8c47953221863e2bfc1e3264d8
User & Date: steveb@workware.net.au 2019-11-08 04:20:59
Context
2019-11-08
09:28
appveyor.yml: explicitly build with ssl

Using only --full will ignore ssl if the ssl library isn't found. By enabling it explicitly, we will get an error if not found. check-in: 764b0fce06 user: steveb@workware.net.au tags: trunk,

04:20
Improve comments for JimResetHashTable()

and Jim_FreeHashTable()

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: fc6a281ba4 user: steveb@workware.net.au tags: trunk,

2019-11-06
07:42
build: improve build for shared objects

Rather than listing the build rules for each shared object (loadable module) in the Makefile template, generate the build rules in configure.

Also, if an extension is configured as a module, any automatic dependencies required by the extension are configured as modules by default.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: b5c6f1bdf0 user: steveb@workware.net.au tags: trunk,

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to jim.c.

723
724
725
726
727
728
729

730





731
732
733
734
735
736
737
...
895
896
897
898
899
900
901
902


903
904
905
906
907
908
909
    while (len--)
        h += (h << 3) + *buf++;
    return h;
}

/* ----------------------------- API implementation ------------------------- */


/* reset a hashtable already initialized */





static void JimResetHashTable(Jim_HashTable *ht)
{
    ht->table = NULL;
    ht->size = 0;
    ht->sizemask = 0;
    ht->used = 0;
    ht->collisions = 0;
................................................................................
        }
        prevHe = he;
        he = he->next;
    }
    return JIM_ERR;             /* not found */
}

/* Destroy an entire hash table and leave it ready for reuse */


int Jim_FreeHashTable(Jim_HashTable *ht)
{
    unsigned int i;

    /* Free all the elements */
    for (i = 0; ht->used > 0; i++) {
        Jim_HashEntry *he, *nextHe;







>
|
>
>
>
>
>







 







|
>
>







723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
...
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
    while (len--)
        h += (h << 3) + *buf++;
    return h;
}

/* ----------------------------- API implementation ------------------------- */

/*
 * Reset a hashtable already initialized.
 * The table data should already have been freed.
 *
 * Note that type and privdata are not initialised
 * to allow the now-empty hashtable to be reused
 */
static void JimResetHashTable(Jim_HashTable *ht)
{
    ht->table = NULL;
    ht->size = 0;
    ht->sizemask = 0;
    ht->used = 0;
    ht->collisions = 0;
................................................................................
        }
        prevHe = he;
        he = he->next;
    }
    return JIM_ERR;             /* not found */
}

/* Remove all entries from the hash table
 * and leave it empty for reuse
 */
int Jim_FreeHashTable(Jim_HashTable *ht)
{
    unsigned int i;

    /* Free all the elements */
    for (i = 0; ht->used > 0; i++) {
        Jim_HashEntry *he, *nextHe;