Exemplo n.º 1
0
// Inline an optimized block that was only detected after it had been generated
// (e.g. a #repeat block). This is very easy in D6 - all we need to do is 
// translate any far returns to method returns
void Compiler::InlineOptimizedBlock(int nStart, int nStop)
{
	int i=nStart;
	while (i < nStop)
	{
		BYTECODE& bytecode=m_bytecodes[i];
		_ASSERTE(bytecode.isOpCode());
		int len = bytecode.instructionLength();
		
		switch(bytecode.byte)
		{
		case BlockCopy:
			// We must skip any nested blocks
			_ASSERTE(bytecode.target > i+len);
			i = bytecode.target;
			_ASSERTE(m_bytecodes[i-1].isReturn());
			break;

		case FarReturn:
			if (!IsInBlock())
				bytecode.byte = ReturnMessageStackTop;
			// Drop through

		default:
			i += len;
			break;
		};
	}
}
Exemplo n.º 2
0
int FrameBuffer::ExceptionFilter(unsigned int code, struct _EXCEPTION_POINTERS *ep)
{
	if (ep->ExceptionRecord->ExceptionCode != EXCEPTION_ACCESS_VIOLATION)
		return EXCEPTION_CONTINUE_SEARCH;

	if ((m_pEvenLines == NULL) || (m_pOddLines == NULL))
		return EXCEPTION_CONTINUE_SEARCH;

	char* pMemAddr = (char*) ep->ExceptionRecord->ExceptionInformation[1];
	if (IsInBlock(m_pEvenLines, 720*576, pMemAddr))
		return HandleAccess(m_pEvenLines, pMemAddr, ep->ExceptionRecord->ExceptionInformation[0]);

	if (IsInBlock(m_pOddLines, 720*576, pMemAddr))
		return HandleAccess(m_pOddLines, pMemAddr, ep->ExceptionRecord->ExceptionInformation[0]);

	return EXCEPTION_CONTINUE_SEARCH;
}
Exemplo n.º 3
0
void CSynBCGPEditCtrl::OnGetCharColor( TCHAR ch, int nOffset, COLORREF& clrText, COLORREF& clrBk )
{
	if (m_SynLanguage.GetCurLanguage() == SYN_INI)
	{
		if (ch == _T ('='))
		{
			clrText = m_clrSyn;
		}
	}
	if (m_bCheckColorTags)
	{

		TCHAR chOpen = _T ('<');
		TCHAR chClose = _T ('>');

		if (ch == chOpen || ch == chClose || ch == _T ('/'))
		{
			clrText = m_clrSyn;
		}
		else 
		{
			COLORREF clrDefaultBack = GetDefaultBackColor ();
			COLORREF clrDefaultTxt = GetDefaultTextColor ();
			int nBlockStart, nBlockEnd;
			if (!IsInBlock (nOffset, chOpen, chClose, nBlockStart, nBlockEnd))
			{
				clrText = clrDefaultTxt;
				clrBk = clrDefaultBack;
			}
			/*else if (GetCharAt (nBlockStart + 1) == _T ('%') && 
				GetCharAt (nBlockEnd - 1) == _T ('%'))
			{
				
			}*/
			else if (clrText == clrDefaultTxt && m_SynLanguage.GetCurLanguage() == SYN_XML)
			{
				if (ch == _T ('='))
				{
					//clrText = RGB (0, 0, 255);
				}
				else
				{
					clrText = m_clrSyn;
				}
			}
		}
	}
}