pub unsafe fn chash_resize(mut hash: *mut chash, mut size: libc::c_uint) -> libc::c_int {
    let mut cells: *mut *mut chashcell = 0 as *mut *mut chashcell;
    let mut indx: libc::c_uint = 0;
    let mut nindx: libc::c_uint = 0;
    let mut iter: *mut chashiter = 0 as *mut chashiter;
    let mut next: *mut chashiter = 0 as *mut chashiter;
    if (*hash).size == size {
        return 0i32;
    }
    cells = calloc(
        size as libc::size_t,
        ::std::mem::size_of::<*mut chashcell>() as libc::size_t,
    ) as *mut *mut chashcell;
    if cells.is_null() {
        return -1i32;
    }
    indx = 0i32 as libc::c_uint;
    while indx < (*hash).size {
        iter = *(*hash).cells.offset(indx as isize);
        while !iter.is_null() {
            next = (*iter).next;
            nindx = (*iter).func.wrapping_rem(size);
            (*iter).next = *cells.offset(nindx as isize);
            let ref mut fresh3 = *cells.offset(nindx as isize);
            *fresh3 = iter;
            iter = next
        }
        indx = indx.wrapping_add(1)
    }
    free((*hash).cells as *mut libc::c_void);
    (*hash).size = size;
    (*hash).cells = cells;
    return 0i32;
}
/* Resizes the hash table to the passed size. */
Resizes the hash table to the passed size.
Resizes the hash table to the passed size .
pub unsafe fn chash_resize(mut hash: *mut chash, mut size: libc::c_uint) -> libc::c_int {
    let mut cells: *mut *mut chashcell = 0 as *mut *mut chashcell;
    let mut indx: libc::c_uint = 0;
    let mut nindx: libc::c_uint = 0;
    let mut iter: *mut chashiter = 0 as *mut chashiter;
    let mut next: *mut chashiter = 0 as *mut chashiter;
    if (*hash).size == size {
        return 0i32;
    }
    cells = calloc(
        size as libc::size_t,
        ::std::mem::size_of::<*mut chashcell>() as libc::size_t,
    ) as *mut *mut chashcell;
    if cells.is_null() {
        return -1i32;
    }
    indx = 0i32 as libc::c_uint;
    while indx < (*hash).size {
        iter = *(*hash).cells.offset(indx as isize);
        while !iter.is_null() {
            next = (*iter).next;
            nindx = (*iter).func.wrapping_rem(size);
            (*iter).next = *cells.offset(nindx as isize);
            let ref mut fresh3 = *cells.offset(nindx as isize);
            *fresh3 = iter;
            iter = next
        }
        indx = indx.wrapping_add(1)
    }
    free((*hash).cells as *mut libc::c_void);
    (*hash).size = size;
    (*hash).cells = cells;
    return 0i32;
}
pub unsafe fn chash_resize ( mut hash : * mut chash , mut size : libc :: c_uint ) -> libc :: c_int { let mut cells : * mut * mut chashcell = 0 as * mut * mut chashcell ; let mut indx : libc :: c_uint = 0 ; let mut nindx : libc :: c_uint = 0 ; let mut iter : * mut chashiter = 0 as * mut chashiter ; let mut next : * mut chashiter = 0 as * mut chashiter ; if ( * hash ) . size == size { return 0i32 ; } cells = calloc ( size as libc :: size_t , :: std :: mem :: size_of :: < * mut chashcell > ( ) as libc :: size_t , ) as * mut * mut chashcell ; if cells . is_null ( ) { return - 1i32 ; } indx = 0i32 as libc :: c_uint ; while indx < ( * hash ) . size { iter = * ( * hash ) . cells . offset ( indx as isize ) ; while ! iter . is_null ( ) { next = ( * iter ) . next ; nindx = ( * iter ) . func . wrapping_rem ( size ) ; ( * iter ) . next = * cells . offset ( nindx as isize ) ; let ref mut fresh3 = * cells . offset ( nindx as isize ) ; * fresh3 = iter ; iter = next } indx = indx . wrapping_add ( 1 ) } free ( ( * hash ) . cells as * mut libc :: c_void ) ; ( * hash ) . size = size ; ( * hash ) . cells = cells ; return 0i32 ; }
Resizes the hash table to the passed size.
Resizes the hash table to the passed size .
hash
*mut chash
size
libc::c_uint
hash
*mut chash
size
libc::c_uint