Exemple #1
0
int
bits_clear (
    BITS *bits,
    long bit)
{
    int
        index,                          /*  Number of index block            */
        section;                        /*  Number of section in index       */
    dbyte
        bit_nbr;                        /*  Number of bit in section         */
    int
        feedback = 0;


    ASSERT (bits);

    if (bit >= 0 && bit < BIT_MAXBITS)
      {
        locate_bit  (bits, bit, &index, &section, &bit_nbr);
        get_section (bits, index, section, section_data, TRUE);
        section_data [bit_nbr / 8] &= 255 - (1 << (bit_nbr % 8));
        put_section (bits, index, section, section_data);
      }
    else
        feedback = -1;
    return (feedback);
}
Exemple #2
0
int
bits_clear (
    BITS *bits,
    long bit)
{
    int
        index,                          /*  Number of index block            */
        section;                        /*  Number of section in index       */
    dbyte
        bit_nbr;                        /*  Number of bit in section         */

    ASSERT (bits);

    locate_bit  (bits, bit, &index, &section, &bit_nbr);
    get_section (bits, index, section, section_data, TRUE);
    section_data [bit_nbr / 8] &= 255 - (1 << (bit_nbr % 8));
    put_section (bits, index, section, section_data);

    return 0;
}