本文整理匯總了C++中Emit函數的典型用法代碼示例。如果您正苦於以下問題:C++ Emit函數的具體用法?C++ Emit怎麽用?C++ Emit使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Emit函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: dec_DynamicSet
void dec_DynamicSet(u32 regbase,u32 offs=0)
{
if (offs==0)
Emit(shop_jdyn,reg_pc_dyn,mk_reg((Sh4RegType)regbase));
else
Emit(shop_jdyn,reg_pc_dyn,mk_reg((Sh4RegType)regbase),mk_imm(offs));
}
示例2: DskBlkRd
// From FigEdit.
ushort DskBlkRd(ushort page)
{
// SerialFlashReadBlock(ushort block, byte *dest);
ushort next=0;
next=VDskFind(VDskEmptyBlk,gVideoBuff);
ushort phys=-2;
phys=VDskRead(page,gVideoBuff);
if(phys==next)
Cls(); // return an empty screen if it was an empty block.
PrintAt(1,20+1);
DotHex(page);
Emit('@');
DotHex(phys);
Emit('!');
DotHex(next);
#if _DEBUGFLASHID__
PrintAt(0,kMaxEditHeight+2);
DotHex(VDskBaseBlock());
Emit(' ');
DotHex(SerialFlashID());
Emit('!');
DotHex(next);
#endif
return next;
}
示例3: EmitCharSet
static void EmitCharSet(ParseInfo *info, AReOpcode *set, WideCharSet *wset,
ABool complement, int flags)
{
int i;
int len;
len = A_SET_SIZE + 2 + WideSetLen(wset) * 2;
while (info->bufInd + len > info->bufLen) {
if (!GrowOutputBuffer(info))
return;
}
if (complement) {
for (i = 0; i < A_SET_SIZE; i++)
info->buf[info->bufInd++] = set[i] ^ 0xffff;
} else {
for (i = 0; i < A_SET_SIZE; i++)
info->buf[info->bufInd++] = set[i];
}
Emit(info, WideSetLen(wset));
Emit(info, flags | ((info->flags & A_RE_NOCASE) ? A_WS_IGNORE_CASE : 0) |
(complement ? A_WS_COMPLEMENT : 0));
for (i = 0; i < WideSetLen(wset); i++) {
Emit(info, WideSetLo(wset, i));
Emit(info, WideSetHi(wset, i));
}
}
示例4: Subject
View::View()
: Subject()
, MouseEventsDispatcher()
, KeyboardEventsDispatcher()
, camera_()
, lights_manager_()
, view_settings_()
, selection_set_()
, view_adapter_(nullptr)
, model_(nullptr)
, operator_(nullptr)
{
try
{
view_adapter_.reset(new OpenGLViewAdapter(*this));
}
catch(CustomExp e)
{
throw e;
}
// Inform observers to set default width and height
Emit(ViewEvent::WINDOW_RESIZE, WindowResizeInfo(800, 600));
// Inform observers to apply all viewer settings
Emit(ViewEvent::VIEWER_SETTINGS_CHANGE);
}
示例5: Emit
void RegExpMacroAssemblerIrregexp::CheckCharacter(uint32_t c, Label* on_equal) {
if (c > MAX_FIRST_ARG) {
Emit(BC_CHECK_4_CHARS, 0);
Emit32(c);
} else {
Emit(BC_CHECK_CHAR, c);
}
EmitOrLink(on_equal);
}
示例6: PrintUsage
int PrintUsage(bool bFull)
{
Emit(IDS_SDL_USAGE);
if (bFull != false)
{
Emit(IDS_SDL_USAGE_EX);
}
return 1;
}
示例7: main
int main(int argc, char* argv[])
{
LPTSTR szInputFile = NULL;
LPTSTR szOutputFile = NULL;
LPTSTR szQueryString = NULL;
LPTSTR szFormInput = NULL;
LPTSTR szErrorLog = NULL;
LPTSTR szContentType = NULL;
LPTSTR szVerb = NULL;
BOOL bNoLogo = FALSE;
HINSTANCE hInstResource=LoadLocResDll(szClStencilUIDll,TRUE);
_AtlBaseModule.AddResourceInstance(hInstResource);
if (argc < 3)
{
CStringA str;
Emit(str, IDS_INVALID_ARGS);
PrintUsage(str);
return 1;
}
CoInitialize(NULL);
if (!GetParameters(argc, argv, &szInputFile, &szOutputFile, &szQueryString, &szFormInput, &szErrorLog, &szContentType, &szVerb, &bNoLogo))
{
return 1;
}
CStringA strHeader;
if (bNoLogo == FALSE)
{
Emit(strHeader, IDS_HEADER);
printf((LPCSTR) strHeader);
}
_Module.Init(NULL, GetModuleHandle(NULL));
CSProcExtension extension;
if (!extension.Initialize())
{
CStringA str;
Emit(str, IDS_INIT_FAILED);
printf((LPCSTR) str);
_Module.Term();
return 1;
}
if (!extension.DispatchStencilCall(szInputFile, szOutputFile, szQueryString, szErrorLog, szFormInput, szContentType, szVerb))
printf("%s\n", (LPCSTR) extension.m_strErr);
extension.Uninitialize();
_Module.Term();
CoUninitialize();
return 0;
}
示例8: Emit
// [C]
const Register& CodeEmitter::Call(
const Type& outy,
const Operand& callee,
const Operand& arg1) {
auto& v1 = module_.NewValues();
Emit(*new(zone()) ValuesI(ValuesType::Intern(arg1.type()), v1, arg1));
auto& out = NewRegister();
Emit(*new(zone()) CallI(outy, out, callee, v1));
return out;
}
示例9: TestForth
void TestForth(void)
{
Cls();
ForthCopyBootStrap();
Emit('T');
Emit('F');
//KeyHeart();
//ForthDumpVars();
// @TODO, we can't show the results yet.
//ForthDumpVars();
}
示例10: g_main_context_iteration
void
ManualTimeSource::SetCurrentTime (TimeSpan current_time)
{
this->current_time = current_time;
#if PAL_GTK_WINDOWING
g_main_context_iteration (g_main_context_default (), false);
#endif
Emit (TimeSource::TickEvent);
Emit (TimeSource::TickEvent);
Emit (TimeSource::TickEvent);
}
示例11: temp
//////////////////////////////////////////////////////////////////////////
//
// Class ReadStmt
//
void ReadStmt::Gen( int b, int a, bool bASM )
{
if ( bASM ) GenMovLineno( m_lineno );
Expr* pExpr = m_pExpr->Gen();
Temp temp( m_pExpr->m_pType );
Emit( temp.ToString() + " = " + pExpr->ToString() );
Emit( "read " + temp.ToString() );
delete pExpr;
}
示例12: SetProgress
void
BitmapImage::PixmapComplete ()
{
MoonPixbuf *pixbuf;
SetProgress (1.0);
if (!loader) {
if (!moon_error)
moon_error = new MoonError (MoonError::EXCEPTION, 4001, "no loader");
goto failed;
}
loader->Close (moon_error == NULL ? &moon_error : NULL);
if (moon_error)
goto failed;
if (!(pixbuf = loader->GetPixbuf ())) {
moon_error = new MoonError (MoonError::EXCEPTION, 4001, "failed to create image data");
goto failed;
}
SetPixelWidth (pixbuf->GetWidth ());
SetPixelHeight (pixbuf->GetHeight ());
// PixelFormat has been dropped and only Pbgra32 is supported
// http://blogs.msdn.com/silverlight_sdk/archive/2009/07/01/breaking-changes-document-errata-silverlight-3.aspx
// not clear if '3' channel is still supported (converted to 4) in SL3
if (pixbuf->GetNumChannels () == 4) {
SetBitmapData (premultiply_rgba (pixbuf), true);
} else {
SetBitmapData (expand_rgb_to_argb (pixbuf), true);
}
Invalidate ();
delete loader;
loader = NULL;
if (HasHandlers (ImageOpenedEvent))
Emit (ImageOpenedEvent, new RoutedEventArgs ());
return;
failed:
ImageErrorEventArgs *args = NULL;
if (HasHandlers (ImageFailedEvent))
args = new ImageErrorEventArgs (*moon_error);
CleanupLoader ();
if (args)
Emit (ImageFailedEvent, args);
}
示例13: PrintUsage
void PrintUsage(LPCSTR lpszErrorText)
{
CStringA strBuffer;
if (lpszErrorText && *lpszErrorText)
{
Emit(strBuffer, IDS_ERROR, lpszErrorText);
printf((LPCSTR) strBuffer);
}
Emit(strBuffer, IDS_USAGE);
printf((LPCSTR) strBuffer);
}
示例14: ParseParen
/* Parse a parenthised expression, optionally followed by a repetition
specifier. */
static void ParseParen(ParseInfo *info)
{
int oldBufInd;
int oldMustStr;
int oldMustStrBack;
int groupNum;
int oldMinLen;
int oldMaxLen;
oldBufInd = info->bufInd;
oldMustStr = info->mustStr;
oldMustStrBack = info->mustStrBack;
oldMinLen = info->minLen;
oldMaxLen = info->maxLen;
/* Initialize only to satisfy stupid C compilers. */
groupNum = 0;
/* Skip '('. */
info->str++;
/* Check end of expression. */
if (info->str == info->strEnd) {
AGenerateError(info, ErrUnmatchedLparen);
return;
}
groupNum = info->numParen++;
Emit(info, A_LPAREN);
Emit(info, groupNum);
/* Parse the expression inside parentheses. */
ParseAlternatives(info);
Emit(info, A_RPAREN);
Emit(info, groupNum);
if (groupNum < 10)
info->parenFlags |= 1 << groupNum;
/* Unexpected end of expression? */
if (info->str == info->strEnd || *info->str != ')')
AGenerateError(info, ErrUnmatchedLparen);
else {
/* Skip ')'. */
info->str++;
}
ParseRepetition(info, oldMinLen, oldMaxLen, info->bufInd - oldBufInd,
oldMustStr, oldMustStrBack);
}
示例15: EmitR
void ToolCodeGen::EmitR(ToolCodeSnip *snip)
{
sInt i;
sInt out,in;
if(!(snip->Flags & TCS_GENERATED))
{
snip->Flags |= TCS_GENERATED;
if(snip->Flags & TCS_ADD)
{
for(i=0;i<snip->InputCount;i++)
{
EmitR(snip->Inputs[i]);
if(i>0)
Emit(snip);
}
}
else
{
for(i=0;i<snip->InputCount;i++)
EmitR(snip->Inputs[i]);
Emit(snip);
}
}
out = TCG_DISCARD;
if(snip->Flags & TCS_LOAD)
{
if(snip->OutputCID==sCID_GENSCENE || snip->OutputCID==sCID_GENFXCHAIN)
out = TCG_POINTER;
else
out = TCG_KEEP;
}
for(i=0;i<snip->OutputCount;i++)
{
if(snip->Outputs[i]->CodeObject && snip->Outputs[i]->CodeObject->GetClass()==sCID_TOOL_PAGEOP)
{
in = ((PageOp *)snip->Outputs[i]->CodeObject)->Class->InputFlags;
if((in&0xf0) && snip->Outputs[i]->Inputs[0]!=snip)
in = in>>4;
in = in&15;
if(in==SCFU_MOD && out==TCG_KEEP)
Emit(" Copy();\n");
if(in==SCFU_MOD && out==TCG_POINTER)
{
Emit("// error here\n");
Error = 1;
}
}
}