michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #if !defined(XP_UNIX) && !defined(XP_OS2) michael@0: michael@0: int ffs( unsigned int i) michael@0: { michael@0: int rv = 1; michael@0: michael@0: if (!i) return 0; michael@0: michael@0: while (!(i & 1)) { michael@0: i >>= 1; michael@0: ++rv; michael@0: } michael@0: michael@0: return rv; michael@0: } michael@0: #endif