// ! BACKWARDS COMPATIBILITY ! Override masks for inventory types that
// no longer can have restricted permissions.  This takes care of previous
// version landmarks that could have had no copy/mod/transfer bits set.
void LLPermissions::initMasks(LLInventoryType::EType type)
{
	if (LLInventoryType::cannotRestrictPermissions(type))
	{
		initMasks(PERM_ALL, PERM_ALL, PERM_ALL, PERM_ALL, PERM_ALL);
	}
}
Пример #2
0
/**
 * Initialize X connection, establish grab.
 */
Display* initX(const char* keyName, int keyModifier, int* keyCode) {
	KeySym sym = XStringToKeysym(keyName);
	if (sym == NoSymbol) {
		fprintf(stderr, "ERROR: Unknown key: %s\n", keyName);
		exit(2);
	}

	Display* display = XOpenDisplay(NULL);
	if (display == NULL) {
		fprintf(stderr, "ERROR: Could not open display.\n");
		exit(3);
	}
	
	*keyCode = XKeysymToKeycode(display, sym);

	Window rootWindow = DefaultRootWindow(display);

	initMasks(display);
	Bool detectableAutoRepeatSupported;
	XkbSetDetectableAutoRepeat(display, True, &detectableAutoRepeatSupported);
	if (!detectableAutoRepeatSupported) {
		fprintf(stderr, "ERROR: Detectable auto repeat is not supported.\n");
		exit(4);
	}

	// Grab
	grabKey(display, rootWindow, *keyCode, keyModifier);

	// Enable events
	XAllowEvents(display, AsyncBoth, CurrentTime);
	XSelectInput(display, rootWindow, KeyPressMask | KeyReleaseMask);

	return display;
}
Пример #3
0
/*df*D9C9T9U9**************************************************/
result_t optMasks(const char * pNxtChar) {
  /*Parse short cuts for setting up for calibration tests
   * See help section
   */
  result_t retResult=SUCCESS;

  pNxtChar+=2;
  switch (*pNxtChar) {
  case 'p': initMasks();//pressure
    debugMasks[MASK_INDX_SensorsMngXxx] |= ( eDbgConsoleAccess|eDbgSnrsMng_Prsr|eDbgSnrsMng_PrsrCalbr);
    break;
  case 'd': initMasks(); //default
    debugMasks[MASK_INDX_SystemMngXxx]=eDbgAll_errEvt;
    debugMasks[MASK_INDX_DataMngM]=eDbgDataMng_sdmsAction|eDbgAll_errEvt;
    debugMasks[MASK_INDX_SensorsMngM]=eDbgSnsrMng_Output|eDbgAll_errEvt;
    //  debugMasks[MASK_INDX_SensorsMngXxx]=eDbgAll_errEvt;
    //  debugMasks[MASK_INDX_SensorsAdcHwM]=eDbgAll_errEvt;
    debugMasks[MASK_INDX_RadioSend]=eDbgRadio_Send|eDbgAll_errEvt;//|eDbgRadio_FramerReceive;
    debugMasks[MASK_INDX_RouteInM]=eDbgRouteIn_RxAll|eDbgAll_errEvt;
    //  debugMasks[MASK_INDX_HALHwStateSondeM]=eDbgAll_errEvt;
    //  debugMasks[MASK_INDX_FlashSerial]=eDbgAll_errEvt;
    break;
  case 'e': initMasks();break;//error only
  case 'm': initMasks();
    debugMasks[MASK_INDX_SystemMngXxx] |= (eDbgConsoleAccess|eDbgSysMngXxx_PwrMin);  
    debugMasks[MASK_INDX_RadioSend]    |= (eDbgRadio_Send);            
    break;
  case 'M': initMasks();
    debugMasks[MASK_INDX_SystemMngXxx] |= (eDbgConsoleAccess);  
    debugMasks[MASK_INDX_RadioLinkLayer]|=(eDbgRadio_RmApiDiscard|eDbgRadio_RmApiRxOctet|eDbgRadio_RmApiTxOctet);
    debugMasks[MASK_INDX_RadioSend]     |=(eDbgRadio_Send|eDbgRadio_ATrsp|eDbgRadio_Cntl);
    break;
  case 's': initMasks();//standard
    debugMasks[MASK_INDX_SystemMngXxx] |= (eDbgConsoleAccess);  
    debugMasks[MASK_INDX_RadioLinkLayer]|=(eDbgRadio_RmApiMng|eDbgRadio_RmApiDiscard);
    debugMasks[MASK_INDX_RadioSend]    |= (eDbgRadio_Send);  
    break;
  case 'S': initMasks();
    debugMasks[MASK_INDX_SystemMngXxx] |= (eDbgConsoleAccess);  
    debugMasks[MASK_INDX_RadioSend]       |=(eDbgRadio_Send);            
    debugMasks[MASK_INDX_HALHwStateSondeM]|=(eDbgPwrMng);  
    break;
  default:
    //print Help
    Serial.print(
   "\n\r d  default"
   "\n\r p  pressure calbriation"
   "\n\r e  errors"
   "\n\r m  minimal basic comms+ insufficient power"
   "\n\r M  Maximal comms"
   "\n\r s  standard comms + comms cntl"
   "\n\r S  Standard comms + power"
     );
    break;
  }
  return retResult;
} //readIntEeprom
Пример #4
0
void BloomFilter::init(bool build, int32_t nv, ...)
{
  if( BFBuild ) {
    return;
  }

  I( !BFBuild );

  va_list argL;
  va_start(argL, nv);

  BFBuild = true;

  nVectors = nv;
  vSize = new int[nVectors];
  vBits = new int[nVectors];

  for(int32_t i = 0; i < nVectors; i++) {
    vBits[i] = va_arg(argL, int); // # of bits from the address
    vSize[i] = va_arg(argL, int); // # of entries in the corresponding vector
  }

  va_end(argL);

  vMask = new unsigned[nVectors];
  rShift = new int[nVectors];
  countVec = new int*[nVectors];
  nonZeroCount = new int[nVectors];
  
  for(int32_t i = 0; i < nVectors; i++) {
    
    countVec[i] = new int[vSize[i]];
    for(int32_t j = 0; j < vSize[i]; j++) {
      countVec[i][j] = 0;
    }
    
    nonZeroCount[i] = 0;
  }

  nElements = 0;
  
  timingHistVec = 0;
  initMasks();
  
  desc = new char[128];
  desc[0] = 0;
  for(int32_t i = 0; i < nVectors; i++) 
    sprintf(desc + strlen(desc), "[%d, %d]", vBits[i], vSize[i]);
}
Пример #5
0
void Board::initStartPosition()
{
    initMasks();
    initAttacks();

    wKing = 1 << 3;
    wQueens = 1 << 4;
    wRooks = 1 | (1 << 7);
    wBishops = (1 << 2) | (1 << 5);
    wKnights = (1 << 1) | (1 << 6);
    wPawns = 0x000000000000FF00;
    wPieces = wKing | wQueens | wRooks | wBishops | wKnights | wPawns;

    bKing = 1ULL << 59;
    bQueens = 1ULL << 60;
    bRooks = (1ULL << 63) | (1ULL << 56);
    bBishops = (1ULL << 61) | (1ULL << 58);
    bKnights = (1ULL << 62) | (1ULL << 57);
    bPawns = 0x00FF000000000000;
    bPieces = bKing | bQueens | bRooks | bBishops | bKnights | bPawns;

    allPieces = wPieces | bPieces;
}