Ejemplo n.º 1
0
void Row::writeFields(CFRecord& record)
{
	if(1 == in_block_position)
	{
		record.registerDelayedFilePointerSource(rt_DBCell); // For DBCell::dbRtrw 
	}

	record << rw << colMic << colMac << miyRw;
	record.reserveNunBytes(4); // reserved / unused
	unsigned short flags = 0x0100;
	SETBITS(flags, 0, 2, iOutLevel);
	SETBIT(flags, 4, fCollapsed);
	SETBIT(flags, 5, fDyZero);
	SETBIT(flags, 6, fUnsynced);
	SETBIT(flags, 7, fGhostDirty);
	record << flags;

	flags = 0;
	SETBITS(flags, 0, 11, ixfe_val);
	SETBIT(flags, 12, fExAsc);
	SETBIT(flags, 13, fExDes);
	SETBIT(flags, 14, fPhonetic);
	record << flags;

	if(1 == in_block_position)
	{
		record.registerDelayedFilePointerAndOffsetSource(record.getDataSize() + sizeof(unsigned short)/*size_short*/ + sizeof(CFRecordType::TypeId), rt_Blank); // For CELL container. All Cell containers will listen for rt_Blank
	}
}
Ejemplo n.º 2
0
int32 swNic_descRingCleanup(void){
	int i;
	swNic_txRxSwitch(0,0);
    /* cleanup Tx packet header descriptors */
    for (i=0; i<totalTxPkthdr; i++){
		struct rtl_pktHdr *ph;
		TxPkthdrRing[i]&= ~DESC_SWCORE_OWNED; //mark it own by CPU
		ph = (struct rtl_pktHdr *) (TxPkthdrRing[i] & ~ (0x3));
		if(ph){
			//has somthing send or sent...
			struct rtl_mBuf *m;
			uint32 rxDescIdx;
			rxDescIdx = ph->ph_rxdesc;
			ph->ph_rxdesc = totalRxPkthdr; 
			m=ph->ph_mbuf;
			assert(m);
			if((rxDescIdx<0 || rxDescIdx>=totalRxPkthdr)){
				//came from protocol stack or fwd engine
				SETBITS(m->m_flags, MBUF_USED);
				mBuf_freeMbufChain(m);
			}
		}
		TxPkthdrRing[i] &= 0x3;//clean desc on Rx Pkthdr ring
  }	

    /* cleanup Rx packet header descriptors */
    for (i=0; i<totalRxPkthdr; i++){
		struct rtl_pktHdr *ph;
		struct rtl_mBuf *m;
		RxPkthdrRing[i]&= ~DESC_SWCORE_OWNED; //mark it own by CPU
		RxMbufRing[i]&= ~DESC_SWCORE_OWNED;
		ph = (struct rtl_pktHdr *) (RxPkthdrRing[i] & ~ (0x3));
		m = (struct rtl_mBuf *)(RxMbufRing[i] & ~ (0x3));
		ph->ph_mbuf=m;
		m->m_pkthdr=ph;
		RxPkthdrRing[i] &= 0x3;//clean desc on Rx Pkthdr ring
		RxMbufRing[i]&=0x3;
		assert(ph);
		ph->ph_rxdesc = -1; 
		m->m_next=NULL;
		SETBITS(ph->ph_flags, PKTHDR_USED);
		SETBITS(m->m_flags, MBUF_USED|MBUF_PKTHDR);
		mBuf_freeMbufChain(ph->ph_mbuf);
    }
    	
    /////////////////////////////////////////////////	
    /* Initialize index of current Rx pkthdr descriptor */
    rxMbufIndex = rxPhdrIndex = txDoneIndex = txFreeIndex = 0;
	REG32(CPURMDCR) = 0;
	REG32(CPURPDCR) = 0;
	REG32(CPUTPDCR) = 0;	
	return SUCCESS;
}
Ejemplo n.º 3
0
void BookBool::writeFields(CFRecord& record)
{
	unsigned short flags = 0;
	SETBIT(flags, 0, fNoSaveSup);
	SETBIT(flags, 2, fHasEnvelope);
	SETBIT(flags, 3, fEnvelopeVisible);
	SETBIT(flags, 4, fEnvelopeInitDone);
	
	unsigned char grUpdateLinks_num;

	if(grUpdateLinks == std::wstring (L"userSet"))
	{
		grUpdateLinks_num = 0;
	}
	else if(grUpdateLinks == std::wstring (L"never"))
	{
		grUpdateLinks_num = 1;
	}
	else if(grUpdateLinks == std::wstring (L"always"))
	{
		grUpdateLinks_num = 2;
	}
	else
	{
		throw;// EXCEPT::LE::AttributeDataWrong(L"grUpdateLinks", record.getTypeString().c_str(), grUpdateLinks);
	}
	SETBITS(flags, 5, 6, grUpdateLinks_num);
	SETBIT(flags, 8, fHideBorderUnselLists);
	record << flags;
}
Ejemplo n.º 4
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPathTrack::EnableAlternatePath( void )
{
	if ( m_paltpath != NULL )
	{
		SETBITS( m_spawnflags, SF_PATH_ALTERNATE );
	}
}
Ejemplo n.º 5
0
void MQencoder::FLUSH()
{
    SETBITS();
    C <<= CT;
    BYTEOUT();
    C <<= CT;
    BYTEOUT();
    if (*BP != 0xFF)
    {
#ifdef QMDEBUG
        std::cout << " OUT: " << std::setw(2) << std::setfill(' ')<< std::hex << (int)*BP << std::dec;
#endif
        codedBytes++;
        BP += 1;
        *BP = 0xFF;
    }
    //HERE: Optionally remove trailing 0x7FFF pairs following the leading 0xFF
#ifdef QMDEBUG
    std::cout << " OUT: " << std::setw(2) << std::setfill(' ')<< std::hex << (int)*BP << std::dec;
#endif
    codedBytes++;
    BP += 1;
    *BP = 0xAC;
    //codedBytes++;
    BP += 1;
}
Ejemplo n.º 6
0
//-----------------------------------------------------------------------------
bool CBaseDoor::CreateVPhysics( )
{
	if ( !FClassnameIs( this, "func_water" ) )
	{
		//normal door
		// NOTE: Create this even when the door is not solid to support constraints.
		VPhysicsInitShadow( false, false );
	}
	else
	{
		// special contents
		AddSolidFlags( FSOLID_VOLUME_CONTENTS );
		SETBITS( m_spawnflags, SF_DOOR_SILENT );	// water is silent for now

		IPhysicsObject *pPhysics = VPhysicsInitShadow( false, false );
		fluidparams_t fluid;
		
		Assert( CollisionProp()->GetCollisionAngles() == vec3_angle );
		fluid.damping = 0.01f;
		fluid.surfacePlane[0] = 0;
		fluid.surfacePlane[1] = 0;
		fluid.surfacePlane[2] = 1;
		fluid.surfacePlane[3] = CollisionProp()->GetCollisionOrigin().z + CollisionProp()->OBBMaxs().z - 1;
		fluid.currentVelocity.Init(0,0,0);
		fluid.torqueFactor = 0.1f;
		fluid.viscosityFactor = 0.01f;
		fluid.pGameData = static_cast<void *>(this);
		
		//FIXME: Currently there's no way to specify that you want slime
		fluid.contents = CONTENTS_WATER;
		
		physenv->CreateFluidController( pPhysics, &fluid );
	}
	return true;
}
Ejemplo n.º 7
0
BOOL
CHyperLink:: ModifyLinkStyle( DWORD dwRemove, DWORD dwAdd,
                             BOOL bApply /* =TRUE */ )
{
   // Check if we are adding and removing the same style.
   if ( (dwRemove & dwAdd) != 0 )
      return( FALSE );

   // Remove old styles and set the new ones
   CLEARBITS( m_dwStyle, dwRemove );
   SETBITS( m_dwStyle, dwAdd );

   if ( bApply && mIs_hWnd( GetSafeHwnd( ) ) )
   {
      // If possible, APPLY the new styles on the fly.
      if ( BITSET( dwAdd, StyleUnderline ) ||
           BITSET( dwRemove, StyleUnderline ) )
      {
         SwitchUnderline( );
      }

      if ( BITSET( dwAdd, StyleAutoSize ) )
         AdjustWindow( );

      if ( BITSET( dwRemove, StyleUseHover ) )
         Invalidate( );
   }

   return( TRUE );
}
Ejemplo n.º 8
0
/**
 * Initialisieren der Sequencer-Boards
 */
void io_sequencer_init(void)
{
    // Led-Array-Pins auf ausgabg
    SETBITS(SEQUENCER_DDR, BIT(SEQUENCER_PD_LED1) | BIT(SEQUENCER_PD_LED2));

    // Leds aus
    CLEARBITS(SEQUENCER_PORT, BIT(SEQUENCER_PD_LED1) | BIT(SEQUENCER_PD_LED2));
}
Ejemplo n.º 9
0
void CondFmtStructure::store(CFRecord& record)
{
	record << ccf;
	unsigned short flags = 0;
	SETBIT(flags, 0, fToughRecalc);
	SETBITS(flags, 1, 15, nID);
	record << flags;
	record << refBound << sqref;
}
Ejemplo n.º 10
0
 static void printEnable(uint16_t area, bool on)
 {
   uint8_t index = AREA_INDEX(area);
   if (index < sizeof(bitmasks)) {
     uint8_t bitmask = AREA_BITMASK(area);
     if (on) {
       SETBITS(bitmasks[index], bitmask);
     } else {
       CLEARBITS(bitmasks[index], bitmask);
     }
   }
 }
Ejemplo n.º 11
0
void Text::writeFields(CFRecord& record)
{
	unsigned short flags1 = 0;
	unsigned short flags2 = 0;

	SETBIT(flags1,  0, fAutoColor);
	SETBIT(flags1,  1, fShowKey);
	SETBIT(flags1,  2, fShowValue);
	SETBIT(flags1,  4, fAutoText);
	SETBIT(flags1,  5, fGenerated);
	SETBIT(flags1,  6, fDeleted);
	SETBIT(flags1,  7, fAutoMode);
	SETBIT(flags1, 11, fShowLabelAndPerc);
	SETBIT(flags1, 12, fShowPercent);
	SETBIT(flags1, 13, fShowBubbleSizes);
	SETBIT(flags1, 14, fShowLabel);

	SETBITS(flags2, 0, 3, dlp);
	SETBITS(flags2, 14, 15, iReadingOrder);

	record << at  << vat << wBkgMode << rgbText << x << y << dx << dy << flags1 << icvText << flags2 << trot;
}
Ejemplo n.º 12
0
void LbsDropData::store(CFRecord& record)
{
	unsigned short flags = 0;
	SETBITS(flags, 0, 1, wStyle);
	SETBIT(flags, 3, fFiltered);

	record << flags << cLine << dxMin << str;

	if(0 != (str.getStructSize() & 1))
	{
		record.reserveNunBytes(1); // padding
	}
}
Ejemplo n.º 13
0
// setup timer/compare module to trigger every 5ms (at 200Hz)
void sw_setup_timer(void)
{
	// prescaler to 8
	SETBITS(TCCR1B, BIT(CS11));

	// auto-clear the counter on output-compare match
	SETBIT(TCCR1B, WGM12);

	// set output-compare-value
	OCR1A = SW_TIMING_ENABLE_CT;

	// enable output-compare interrupt (timer 0, compare A)
	SETBIT(TIMSK1, OCIE1A);
}
Ejemplo n.º 14
0
static int tfa9890_modify(FAR struct tfa9890_dev_s *priv, uint16_t reg,
                                    uint16_t mask, uint16_t s, uint16_t offset)
{
    int val = tfa9890_reg_read(priv, reg);

    if (val < 0)
    {
        lldbg("reg_read failed for 0x%02x rv = %d\n", reg, val);
        return val;
    }

    val = SETBITS(val, mask << offset, s << offset);
    return tfa9890_reg_write(priv, reg, val);
}
Ejemplo n.º 15
0
/*
 * Die Peripherie initialisieren
 */
void io_init(void)
{
	// Mux-Lines auf Ausgang
	SETBITS(MUX_DDR, BIT(MUX_PIN0) | BIT(MUX_PIN1) | BIT(MUX_PIN2));

	// Sync-Timer-Pin auf Ausgang
	SETBIT(TIMER_DDR, TIMER_PIN);

	// Initialisieren der Parameter-Boards
	io_parameter_init();

	// Initialisieren der Sequencer-Boards
	io_sequencer_init();

	// Initialisieren des Selektorrades
	io_selector_init();
}
Ejemplo n.º 16
0
// setup pins & ports for communicating with the sidewinder device
void sw_setup_lines(void)
{
	// time-line as output & high
	SETBIT(SW_TIMING_DDR, SW_TIMING_P);
	SETBIT(SW_TIMING_PORT, SW_TIMING_P);

	// indicator lines as out
	SETBIT(SW_RCVINDI_DDR, SW_RCVINDI_P);
	SETBIT(SW_CLKINDI_DDR, SW_CLKINDI_P);


	// clock- & data-line as input
	CLEARBIT(SW_CLK_DDR, SW_CLK_P);
	CLEARBIT(SW_DTA_DDR, SW_DTA_P);

	// enable rising edge detection for INT5
	SETBITS(EICRB, BIT(ISC51) | BIT(ISC50));
}
Ejemplo n.º 17
0
static void led_setonoff(unsigned int bits)
{
  led_clrbits(CLRBITS(bits));
  led_setbits(SETBITS(bits));
}
Ejemplo n.º 18
0
void StyleXF::store(CFRecord& record)
{
	_UINT32 flags = 0;
	
	SETBITS(flags, 0, 2, alc);
	SETBIT(flags, 3, fWrap);
	SETBITS(flags, 4, 6, alcV);
	SETBIT(flags, 7, fJustLast);
	SETBITS(flags, 8, 15, trot);
	SETBITS(flags, 16, 19, cIndent);
	SETBIT(flags, 20, fShrinkToFit);
	SETBITS(flags, 22, 23, iReadOrder);
	record << flags;

	flags = 0;
	SETBITS(flags, 0, 3, border.dgLeft);
	SETBITS(flags, 4, 7, border.dgRight);
	SETBITS(flags, 8, 11, border.dgTop);
	SETBITS(flags, 12, 15, border.dgBottom);
	SETBITS(flags, 16, 22, border.icvLeft);
	SETBITS(flags, 23, 29, border.icvRight);
	SETBITS(flags, 30, 31, border.grbitDiag);
	record << flags;

	flags = 0;
	SETBITS(flags, 0, 6, border.icvTop);
	SETBITS(flags, 7, 13, border.icvBottom);
	SETBITS(flags, 14, 20, border.icvDiag);
	SETBITS(flags, 21, 24, border.dgDiag);
	SETBITS(flags, 26, 31, fill.fls);
	record << flags;

	_UINT16 flags2 = 0;
	SETBITS(flags2, 0, 6, fill.icvFore);
	SETBITS(flags2, 7, 13, fill.icvBack);
	record << flags2;
}
Ejemplo n.º 19
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPathTrack::DisablePath( void )
{
	SETBITS( m_spawnflags, SF_PATH_DISABLED );
}
Ejemplo n.º 20
0
    BYTES(0, 0, 0, 0),		/* 7A */
    BYTES(0, 0, 0, 0),		/* 7B */
    BYTES(0, 0, 0, 0),		/* 7C */
    BYTES(0, 0, 0, 0),		/* 7D */
    BYTES(0, 0, 0, 0),		/* 7E */
    BYTES(0, 0, 0, 0),		/* 7F */
};

#undef SETBITS

#define SETBITS(b0, b1, b2, b3, b4, b5, b6, b7) \
	(b0<<0)|(b1<<1)|(b2<<2)|(b3<<3)|(b4<<4)|(b5<<5)|(b6<<6)|(b7<<7)
	
STATIC CONST UBYTE locapsable[] =
{
    SETBITS(0, 0, 0, 0, 0, 0, 0, 0),	/* 00 - 07 */
    SETBITS(0, 0, 0, 0, 0, 0, 0, 0),	/* 08 - 0F */
    
    SETBITS(1, 1, 1, 1, 1, 1, 1, 1),	/* 10 - 17 */
    SETBITS(1, 1, 0, 0, 0, 0, 0, 0),	/* 18 - 1F */
    
    SETBITS(1, 1, 1, 1, 1, 1, 1, 1),	/* 20 - 27 */
    SETBITS(1, 0, 0, 0, 0, 0, 0, 0),	/* 28 - 2F */
    
    SETBITS(0, 1, 1, 1, 1, 1, 1, 1),	/* 30 - 37 */
    SETBITS(0, 0, 0, 0, 0, 0, 0, 0)	/* 38 - 3F */
};

STATIC CONST UBYTE hicapsable[] =
{
    SETBITS(0, 0, 0, 0, 0, 0, 0, 0),	/* 40 - 47 */
Ejemplo n.º 21
0
//-----------------------------------------------------------------------------
// Purpose: Turn the light off
//-----------------------------------------------------------------------------
void CLight::TurnOff( void )
{
	engine->LightStyle( m_iStyle, "a" );
	SETBITS( m_spawnflags, SF_LIGHT_START_OFF );
}