本文整理汇总了C++中Internal函数的典型用法代码示例。如果您正苦于以下问题:C++ Internal函数的具体用法?C++ Internal怎么用?C++ Internal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Internal函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: mgl_wcslen
//-----------------------------------------------------------------------------
float mglFont::Width(const wchar_t *str,int font) const
{
if(GetNumGlyph()==0 || !str || *str==0) return 0;
float ww=0,w=0;
size_t size = mgl_wcslen(str)+1;
if(parse)
{
unsigned *wcs = new unsigned[size], *buf=wcs;
memcpy(wcs,str,size*sizeof(wchar_t));
Convert(str, wcs);
for(size_t i=0;wcs[i];i++) if(wcs[i]=='\n') // parse '\n' symbol
{
wcs[i]=0; w = Puts(buf,0,0,1.,0x10|font,'k','k'); // find width
buf=wcs+i+1; if(w>ww) ww=w;
}
w = Puts(buf,0,0,1.,0x10|font,'k','k');
if(w<ww) w=ww;
delete []wcs;
}
else
{
int s = (font/MGL_FONT_BOLD)&3;
for(size_t i=0;i<size;i++)
{
long j = str[i]!=' ' ? Internal(str[i]) : Internal('!');
if(j==-1) continue;
w+= GetWidth(s,j)/fact[s];
}
}
return w;
}
开发者ID:nickjhathaway,项目名称:mathgl,代码行数:32,代码来源:font.cpp
示例2: CE_SetNumArg
void CE_SetNumArg (CodeEntry* E, long Num)
/* Set a new numeric argument for the given code entry that must already
** have a numeric argument.
*/
{
char Buf[16];
/* Check that the entry has a numerical argument */
CHECK (E->Flags & CEF_NUMARG);
/* Make the new argument string */
if (E->Size == 2) {
Num &= 0xFF;
xsprintf (Buf, sizeof (Buf), "$%02X", (unsigned) Num);
} else if (E->Size == 3) {
Num &= 0xFFFF;
xsprintf (Buf, sizeof (Buf), "$%04X", (unsigned) Num);
} else {
Internal ("Invalid instruction size in CE_SetNumArg");
}
/* Replace the argument by the new one */
CE_SetArg (E, Buf);
/* Use the new numerical value */
E->Num = Num;
}
开发者ID:Aliandrana,项目名称:cc65,代码行数:27,代码来源:codeent.c
示例3: FORMAT
void Logger::Error(const char *in, ...)
{
string str;
FORMAT(str);
Internal(str, "ERROR", FG_RED);
}
开发者ID:spigwitmer,项目名称:opengrind,代码行数:7,代码来源:logger.cpp
示例4: File
Logger::Logger(std::string path)
{
string dir = path.substr(0, path.find_last_of("/"));
m_File = new File(dir);
m_File->mkdir();
// Logger is borked if this happens
if (!m_File->open(path, FileAccessMode_Write))
{
printf("%s\n", m_File->get_last_error().c_str());
assert(0);
return;
}
UseColors(true);
ShowTraces(true);
#if DEBUG
ShowDebug(true);
#else
ShowDebug(false);
#endif
// time_t raw = time(NULL);
// char sTime[25];
// strftime(sTime, 25, "%m/%d/%Y @ %H:%M:%S", localtime(&raw));
Internal(string("# ") + Nepgear::FullName + " log started", "", FG_INVALID, false, false);
}
开发者ID:spigwitmer,项目名称:opengrind,代码行数:29,代码来源:logger.cpp
示例5: Start
void Start()
{
Internal("Http::Start","()");
if (enabled && !ctx)
{
// Try listening on the configured port number (8080 by default)
// and advance foward until one is available
for (int i = 0; i<100; ++i)
{
string j = print_string(port+i);
const char *options[3] = { "listening_ports", j.c_str(), NULL};
ctx = mg_start(&callback, NULL, options);
if (ctx)
break;
}
const char *option = NULL;
if (ctx)
option = mg_get_option(ctx,"listening_ports");
if (option)
{
Info("Listening for HTTP connections on port ",option);
}
else
{
Info("Not listening for HTTP connections.");
}
}
}
开发者ID:sherief,项目名称:regal,代码行数:32,代码来源:RegalHttp.cpp
示例6: Cleanup
void Cleanup()
{
Internal("Logging::Cleanup","()");
initialized = false;
if (logOutput)
fileClose(&logOutput);
#if !REGAL_NO_JSON
if (jsonOutput)
{
fprintf(jsonOutput,"%s","{} ] }\n");
fileClose(&jsonOutput);
}
#endif
#if REGAL_LOG_ONCE
delete uniqueMutex;
uniqueMutex = NULL;
#endif
delete buffer;
delete bufferMutex;
buffer = NULL;
bufferMutex = NULL;
}
开发者ID:achienbsi,项目名称:regal,代码行数:27,代码来源:RegalLog.cpp
示例7: MacExpandStart
void MacExpandStart (Macro* M)
/* Start expanding a macro */
{
MacExp* E;
/* Check the argument */
PRECONDITION (M && (M->Style != MAC_STYLE_DEFINE || DisableDefines == 0));
/* We cannot expand an incomplete macro */
if (M->Incomplete) {
Error ("Cannot expand an incomplete macro");
return;
}
/* Don't allow too many nested macro expansions - otherwise it is possible
* to force an endless loop and assembler crash.
*/
if (MacExpansions >= MAX_MACEXPANSIONS) {
Error ("Too many nested macro expansions");
return;
}
/* Create a structure holding expansion data */
E = NewMacExp (M);
/* Call the apropriate subroutine */
switch (M->Style) {
case MAC_STYLE_CLASSIC: StartExpClassic (E); break;
case MAC_STYLE_DEFINE: StartExpDefine (E); break;
default: Internal ("Invalid macro style: %d", M->Style);
}
}
开发者ID:AntiheroSoftware,项目名称:cc65,代码行数:32,代码来源:macro.c
示例8: GetBranchCond
bc_t GetBranchCond (opc_t OPC)
/* Get the condition for the conditional branch in OPC */
{
switch (OPC) {
case OP65_BCC: return BC_CC;
case OP65_BCS: return BC_CS;
case OP65_BEQ: return BC_EQ;
case OP65_BMI: return BC_MI;
case OP65_BNE: return BC_NE;
case OP65_BPL: return BC_PL;
case OP65_BVC: return BC_VC;
case OP65_BVS: return BC_VS;
case OP65_JCC: return BC_CC;
case OP65_JCS: return BC_CS;
case OP65_JEQ: return BC_EQ;
case OP65_JMI: return BC_MI;
case OP65_JNE: return BC_NE;
case OP65_JPL: return BC_PL;
case OP65_JVC: return BC_VC;
case OP65_JVS: return BC_VS;
default:
Internal ("GetBranchCond: Invalid opcode: %d", OPC);
return 0;
}
}
开发者ID:Aliandrana,项目名称:cc65,代码行数:25,代码来源:opcodes.c
示例9: Internal
IndexReader::IndexReader(){
//Constructor.
//Func - Creates an instance of IndexReader
//Pre - true
//Post - An instance has been created with writeLock = NULL
_internal = _CLNEW Internal(NULL, this);
}
开发者ID:AlanForeverAi,项目名称:WizQTClient,代码行数:7,代码来源:IndexReader.cpp
示例10: MakeLongBranch
opc_t MakeLongBranch (opc_t OPC)
/* Return the long version of the given branch. If the branch is already
** a long branch, return the opcode unchanged.
*/
{
switch (OPC) {
case OP65_BCC:
case OP65_JCC: return OP65_JCC;
case OP65_BCS:
case OP65_JCS: return OP65_JCS;
case OP65_BEQ:
case OP65_JEQ: return OP65_JEQ;
case OP65_BMI:
case OP65_JMI: return OP65_JMI;
case OP65_BNE:
case OP65_JNE: return OP65_JNE;
case OP65_BPL:
case OP65_JPL: return OP65_JPL;
case OP65_BVC:
case OP65_JVC: return OP65_JVC;
case OP65_BVS:
case OP65_JVS: return OP65_JVS;
case OP65_BRA:
case OP65_JMP: return OP65_JMP;
default:
Internal ("MakeLongBranch: Invalid opcode: %d", OPC);
return 0;
}
}
开发者ID:Aliandrana,项目名称:cc65,代码行数:29,代码来源:opcodes.c
示例11: MakeShortBranch
opc_t MakeShortBranch (opc_t OPC)
/* Return the short version of the given branch. If the branch is already
** a short branch, return the opcode unchanged.
*/
{
switch (OPC) {
case OP65_BCC:
case OP65_JCC: return OP65_BCC;
case OP65_BCS:
case OP65_JCS: return OP65_BCS;
case OP65_BEQ:
case OP65_JEQ: return OP65_BEQ;
case OP65_BMI:
case OP65_JMI: return OP65_BMI;
case OP65_BNE:
case OP65_JNE: return OP65_BNE;
case OP65_BPL:
case OP65_JPL: return OP65_BPL;
case OP65_BVC:
case OP65_JVC: return OP65_BVC;
case OP65_BVS:
case OP65_JVS: return OP65_BVS;
case OP65_BRA:
case OP65_JMP: return (CPUIsets[CPU] & CPU_ISET_65SC02)? OP65_BRA : OP65_JMP;
default:
Internal ("MakeShortBranch: Invalid opcode: %d", OPC);
return 0;
}
}
开发者ID:Aliandrana,项目名称:cc65,代码行数:29,代码来源:opcodes.c
示例12: GetInverseBranch
opc_t GetInverseBranch (opc_t OPC)
/* Return a branch that reverse the condition of the branch given in OPC */
{
switch (OPC) {
case OP65_BCC: return OP65_BCS;
case OP65_BCS: return OP65_BCC;
case OP65_BEQ: return OP65_BNE;
case OP65_BMI: return OP65_BPL;
case OP65_BNE: return OP65_BEQ;
case OP65_BPL: return OP65_BMI;
case OP65_BVC: return OP65_BVS;
case OP65_BVS: return OP65_BVC;
case OP65_JCC: return OP65_JCS;
case OP65_JCS: return OP65_JCC;
case OP65_JEQ: return OP65_JNE;
case OP65_JMI: return OP65_JPL;
case OP65_JNE: return OP65_JEQ;
case OP65_JPL: return OP65_JMI;
case OP65_JVC: return OP65_JVS;
case OP65_JVS: return OP65_JVC;
default:
Internal ("GetInverseBranch: Invalid opcode: %d", OPC);
return 0;
}
}
开发者ID:Aliandrana,项目名称:cc65,代码行数:25,代码来源:opcodes.c
示例13: GetInsnSize
unsigned GetInsnSize (opc_t OPC, am_t AM)
/* Return the size of the given instruction */
{
/* Get the opcode desc and check the size given there */
const OPCDesc* D = &OPCTable[OPC];
if (D->Size != 0) {
return D->Size;
}
/* Check the addressing mode. */
switch (AM) {
case AM65_IMP: return 1;
case AM65_ACC: return 1;
case AM65_IMM: return 2;
case AM65_ZP: return 2;
case AM65_ZPX: return 2;
case AM65_ABS: return 3;
case AM65_ABSX: return 3;
case AM65_ABSY: return 3;
case AM65_ZPX_IND: return 2;
case AM65_ZP_INDY: return 2;
case AM65_ZP_IND: return 2;
default:
Internal ("Invalid addressing mode");
return 0;
}
}
开发者ID:Aliandrana,项目名称:cc65,代码行数:27,代码来源:opcodes.c
示例14: SizeOf
unsigned SizeOf (const Type* T)
/* Compute size of object represented by type array. */
{
switch (UnqualifiedType (T->C)) {
case T_VOID:
return 0; /* Assume voids have size zero */
case T_SCHAR:
case T_UCHAR:
return SIZEOF_CHAR;
case T_SHORT:
case T_USHORT:
return SIZEOF_SHORT;
case T_INT:
case T_UINT:
return SIZEOF_INT;
case T_PTR:
case T_FUNC: /* Maybe pointer to function */
return SIZEOF_PTR;
case T_LONG:
case T_ULONG:
return SIZEOF_LONG;
case T_LONGLONG:
case T_ULONGLONG:
return SIZEOF_LONGLONG;
case T_ENUM:
return SIZEOF_INT;
case T_FLOAT:
return SIZEOF_FLOAT;
case T_DOUBLE:
return SIZEOF_DOUBLE;
case T_STRUCT:
case T_UNION:
return ((SymEntry*) T->A.P)->V.S.Size;
case T_ARRAY:
if (T->A.L == UNSPECIFIED) {
/* Array with unspecified size */
return 0;
} else {
return T->A.L * SizeOf (T + 1);
}
default:
Internal ("Unknown type in SizeOf: %04lX", T->C);
return 0;
}
}
开发者ID:josch1710,项目名称:cc65,代码行数:59,代码来源:datatype.c
示例15: GetModelName
const char* GetModelName (O65Model M)
/* Map the model to its name. */
{
if (M < 0 || M >= O65_MODEL_COUNT) {
Internal ("O65 Model %d not found", M);
}
return NameTable[M];
}
开发者ID:AntiheroSoftware,项目名称:cc65,代码行数:8,代码来源:model.c
示例16: WarnPragma
static void WarnPragma (StrBuf* B)
/* Enable/disable warnings */
{
long Val;
int Push;
/* A warning name must follow */
IntStack* S = GetWarning (B);
if (S == 0) {
return;
}
/* Comma follows */
if (!GetComma (B)) {
return;
}
/* Check for the "push" or "pop" keywords */
switch (ParsePushPop (B)) {
case PP_NONE:
Push = 0;
break;
case PP_PUSH:
Push = 1;
break;
case PP_POP:
/* Pop the old value and bail out */
PopInt (S);
return;
case PP_ERROR:
/* Bail out */
return;
default:
Internal ("Invalid result from ParsePushPop");
}
/* Boolean argument follows */
if (HasStr (B, "true") || HasStr (B, "on")) {
Val = 1;
} else if (HasStr (B, "false") || HasStr (B, "off")) {
Val = 0;
} else if (!SB_GetNumber (B, &Val)) {
Error ("Invalid pragma argument");
return;
}
/* Set/push the new value */
if (Push) {
PushInt (S, Val);
} else {
IS_Set (S, Val);
}
}
开发者ID:PanchoManera,项目名称:cc65,代码行数:58,代码来源:pragma.c
示例17: SegDump
void SegDump (void)
/* Dump the segments and it's contents */
{
unsigned I, J;
unsigned long Count;
unsigned char* Data;
for (I = 0; I < CollCount (&SegmentList); ++I) {
Segment* Seg = CollAtUnchecked (&SegmentList, I);
printf ("Segment: %s (%lu)\n", GetString (Seg->Name), Seg->Size);
for (J = 0; J < CollCount (&Seg->Sections); ++J) {
Section* S = CollAtUnchecked (&Seg->Sections, J);
unsigned J;
Fragment* F = S->FragRoot;
printf (" Section:\n");
while (F) {
switch (F->Type) {
case FRAG_LITERAL:
printf (" Literal (%u bytes):", F->Size);
Count = F->Size;
Data = F->LitBuf;
J = 100;
while (Count--) {
if (J > 75) {
printf ("\n ");
J = 3;
}
printf (" %02X", *Data++);
J += 3;
}
printf ("\n");
break;
case FRAG_EXPR:
printf (" Expression (%u bytes):\n", F->Size);
printf (" ");
DumpExpr (F->Expr, 0);
break;
case FRAG_SEXPR:
printf (" Signed expression (%u bytes):\n", F->Size);
printf (" ");
DumpExpr (F->Expr, 0);
break;
case FRAG_FILL:
printf (" Empty space (%u bytes)\n", F->Size);
break;
default:
Internal ("Invalid fragment type: %02X", F->Type);
}
F = F->Next;
}
}
}
}
开发者ID:cc65,项目名称:cc65,代码行数:58,代码来源:segments.c
示例18: CheckAssertions
void CheckAssertions (void)
/* Check all assertions */
{
unsigned I;
/* Walk over all assertions */
for (I = 0; I < CollCount (&Assertions); ++I) {
const LineInfo* LI;
const char* Module;
unsigned Line;
/* Get the assertion */
Assertion* A = CollAtUnchecked (&Assertions, I);
/* Ignore assertions that shouldn't be handled at link time */
if (!AssertAtLinkTime (A->Action)) {
continue;
}
/* Retrieve the relevant line info for this assertion */
LI = CollConstAt (&A->LineInfos, 0);
/* Get file name and line number from the source */
Module = GetSourceName (LI);
Line = GetSourceLine (LI);
/* If the expression is not constant, we're not able to handle it */
if (!IsConstExpr (A->Expr)) {
Warning ("Cannot evaluate assertion in module `%s', line %u",
Module, Line);
} else if (GetExprVal (A->Expr) == 0) {
/* Assertion failed */
const char* Message = GetString (A->Msg);
switch (A->Action) {
case ASSERT_ACT_WARN:
case ASSERT_ACT_LDWARN:
Warning ("%s(%u): %s", Module, Line, Message);
break;
case ASSERT_ACT_ERROR:
case ASSERT_ACT_LDERROR:
Error ("%s(%u): %s", Module, Line, Message);
break;
default:
Internal ("Invalid assertion action (%u) in module `%s', "
"line %u (file corrupt?)",
A->Action, Module, Line);
break;
}
}
}
}
开发者ID:eakmeister,项目名称:cc65,代码行数:57,代码来源:asserts.c
示例19: GetExportVal
long GetExportVal (const Export* E)
/* Get the value of this export */
{
if (E->Expr == 0) {
/* OOPS */
Internal ("`%s' is an undefined external", GetString (E->Name));
}
return GetExprVal (E->Expr);
}
开发者ID:Aliandrana,项目名称:snesdev,代码行数:9,代码来源:exports.c
示例20: Internal
void
Parser::onPop()
{
Internal("Regal::Json::Parser::onPop","()");
if (depth)
--depth;
else
current = parent[current];
}
开发者ID:RobertBeckebans,项目名称:regal,代码行数:10,代码来源:RegalJson.cpp
注:本文中的Internal函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论