Something went wrong. Try again.
Cider Isn't Darwin Emulation, Really
Something went wrong. Try again.
1.3 kB · 63 lines
C++
at android
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364/*This file is part of Darling.
Copyright (C) 2012-2013 Lubos Dolezel
Darling is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.
Darling is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.
You should have received a copy of the GNU General Public Licensealong with Darling. If not, see <http://www.gnu.org/licenses/>.*/
#include "ToolUtils.h"
int BitTst(const void* bytePtr, long bitNum){ const long* v = static_cast<const long*>(bytePtr); return !!(*v & (1 << bitNum));}
void BitSet(void* bytePtr, long bitNum){ long* v = static_cast<long*>(bytePtr); *v |= (1 << bitNum);}
void BitClr(void* bytePtr, long bitNum){ long* v = static_cast<long*>(bytePtr); *v &= ~(1 << bitNum);}
long BitAnd(long v1, long v2){ return v1 & v2;}
long BitXor(long v1, long v2){ return v1 ^ v2;}
long BitNot(long v1){ return ~v1;}
long BitShift(long value, short count){ if (count >= 0) return value << count; else return value >> (-count);}