Ignore:
Timestamp:
Jul 23, 1999, 5:54:34 PM (26 years ago)
Author:
cbratschi
Message:

ffs() implemented (Edgar Buerkle)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/treeview.c

    r295 r371  
    1 /* $Id: treeview.c,v 1.8 1999-07-12 15:58:49 cbratschi Exp $ */
     1/* $Id: treeview.c,v 1.9 1999-07-23 15:54:34 cbratschi Exp $ */
    22/* Treeview control
    33 *
     
    4242 */
    4343
    44 /* CB: todo
    45  - fix ffs();
    46 */
    47 
    4844#include <string.h>
    4945#include "winbase.h"
     
    14811477}
    14821478
     1479int ffs(int mask)
     1480{
     1481        int bit;
     1482
     1483        if (mask == 0)
     1484                return(0);
     1485        for (bit = 1; !(mask & 1); bit++)
     1486                mask >>= 1;
     1487        return(bit);
     1488}
    14831489
    14841490/* the method used below isn't the most memory-friendly, but it avoids
     
    15401546        for (i=0; i<infoPtr->uNumPtrsAlloced>>5; i++) {
    15411547                if (infoPtr->freeList[i]) {
    1542 // WHAT IS FFS? NOT IN VAC++ C LIBRARY!!!
    1543 //                      iItem=ffs (infoPtr->freeList[i])-1;
    1544 //
     1548                        iItem=ffs (infoPtr->freeList[i])-1;
     1549
    15451550                        tv_clear_bit(iItem,&infoPtr->freeList[i]);
    15461551                        iItem+=i<<5;
Note: See TracChangeset for help on using the changeset viewer.