您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CErr1函数代码示例

51自学网 2021-06-01 19:58:13
  C++
这篇教程C++ CErr1函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CErr1函数的典型用法代码示例。如果您正苦于以下问题:C++ CErr1函数的具体用法?C++ CErr1怎么用?C++ CErr1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CErr1函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: EndTry

static int EndTry( void ){    int         parent_scope;    TREEPTR     expr;    TREEPTR     func;    TREEPTR     tree;    TYPEPTR     typ;    int         expr_type;    DropBreakLabel();           /* _leave jumps to this label */    parent_scope = BlockStack->parent_index;    tree = LeafNode( OPR_TRY );    tree->op.st.try_index = BlockStack->try_index;    tree->op.st.parent_scope = parent_scope;    AddStmt( tree );    if( (CurToken == T__EXCEPT) || (CurToken == T___EXCEPT) ) {        NextToken();        BlockStack->block_type = T__EXCEPT;        BlockStack->break_label = NextLabel();        Jump( BlockStack->break_label );        DeadCode = 0;        tree = LeafNode( OPR_EXCEPT );        tree->op.st.try_sym_handle = DummyTrySymbol();        tree->op.st.parent_scope = parent_scope;        AddStmt( tree );        CompFlags.exception_filter_expr = 1;        expr = RValue( BracketExpr() );        CompFlags.exception_filter_expr = 0;        CompFlags.exception_handler = 1;        typ = TypeOf( expr );        expr_type = DataTypeOf( typ );        if( expr_type != TYPE_VOID ) {            if( expr_type > TYPE_ULONG ) {                CErr1( ERR_EXPR_MUST_BE_INTEGRAL );            }        }        func = VarLeaf( SymGetPtr( SymExcept ), SymExcept );        func->op.opr = OPR_FUNCNAME;        expr = ExprNode( NULL, OPR_PARM, expr );        expr->expr_type = typ;        expr->op.result_type = typ;        tree = ExprNode( func, OPR_CALL, expr );        tree->expr_type = GetType( TYPE_VOID );        AddStmt( tree );        return( 1 );    } else if( (CurToken == T__FINALLY) || (CurToken == T___FINALLY) ) {        CompFlags.in_finally_block = 1;        NextToken();        BlockStack->block_type = T__FINALLY;        DeadCode = 0;        tree = LeafNode( OPR_FINALLY );        tree->op.st.try_sym_handle = DummyTrySymbol();        tree->op.st.parent_scope = parent_scope;        AddStmt( tree );        return( 1 );    }    return( 0 );}
开发者ID:hubei,项目名称:open-watcom,代码行数:58,


示例2: pragInlineDepth

// #pragma inline_depth n// #pragma inline_depth( n )    -- MS compatible//// Used to set the depth, up to which, inlining of functions will take place.// "n" must be number 0:255//static void pragInlineDepth(    // PROCESS #pragma inline_depth    void ){    unsigned num;    if( grabNum( &num ) && num <= MAX_INLINE_DEPTH ) {        CgBackSetInlineDepth( num );    } else {        CErr1( ERR_PRAG_INLINE_DEPTH );    }}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:17,


示例3: pragTemplateDepth

// #pragma template_depth n// #pragma template_depth( n )//// Used to set the depth, up to which, function templates will be expandedstatic void pragTemplateDepth(    // PROCESS #pragma template_depth    void ){    unsigned num;    if( grabNum( &num ) ) {        TemplateSetDepth( num );    } else {        CErr1( ERR_PRAG_TEMPLATE_DEPTH );    }}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:15,


示例4: pragInitialize

// forms: #pragma initialize [before/after]* priority////  where priority is://      - number 0 - 255//      - library (32)//      - program (64)//// The pragma is used to set the initialize priority for the module ( when// it occurs at file scope) or to specify an initialization function to// be called (when it occurs within a function).//// The function must be previously declared to have no parameters and to// be static.//static void pragInitialize(     // #pragma initialize ...    void ){    int adjust;                 // - before/after adjustment    unsigned priority;          // - initialization priority    unsigned test;    adjust = 0;    for( ; ; ) {        /* allow "before before library" */        if( PragRecog( "after" ) ) {            ++adjust;        } else if( PragRecog( "before" ) ) {            --adjust;        } else {            break;        }    }    priority = INIT_PRIORITY_PROGRAM;    if( CurToken == T_CONSTANT ) {        test = U32Fetch( Constant64 );        if( test <= 255 ) {            priority = test;        } else {            CErr1( ERR_PRAG_INITIALIZE_PRIORITY );        }    } else if( PragRecog( "library" ) ) {        priority = INIT_PRIORITY_LIBRARY;    } else if( PragRecog( "program" ) ) {        priority = INIT_PRIORITY_PROGRAM;    } else {        CErr1( ERR_PRAG_INITIALIZE_PRIORITY );    }    NextToken();    priority += adjust;    if( priority > 255 ) {        CErr1( ERR_PRAG_INITIALIZE_PRIORITY );        priority = INIT_PRIORITY_PROGRAM;    }    CompInfo.init_priority = priority;}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:55,


示例5: defineFSRegistration

static void defineFSRegistration( void ){    if( CompFlags.zo_switch_used ) {        CErr1( WARN_ZO_OBSOLETE );    }    CompFlags.rw_registration = TRUE;#if _CPU == 386    if( TargetSystem == TS_NT || TargetSystem == TS_OS2 ) {        CompFlags.fs_registration = TRUE;    }#endif}
开发者ID:andreiw,项目名称:open-watcom-v2,代码行数:12,


示例6: CppStackFini

void CppStackFini( void ){    struct cpp_info *cpp;    while( (cpp = CppStack) != NULL ) {        SetErrLoc( &cpp->src_loc );        CErr1( ERR_MISSING_CENDIF );        InitErrLoc();        CppStack = cpp->prev_cpp;        CMemFree( cpp );    }    CppStack = NULL;}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:13,


示例7: CErr1

bool TypeDefedNonAbstract       // REQUIRE DEFINED, NON-ABSTRACT TYPE    ( TYPE type                 // - the type    , PTREE expr                // - NULL or expression for error    , MSG_NUM msg_abstract      // - message when abstract    , MSG_NUM msg_undefed )     // - message when undefined{    bool retb;                  // - return: true ==> defined & non-abstract    expr = expr;    retb = false;    if( ! TypeDefined( type ) ) {        CErr1( msg_undefed );        InfClassDecl( type );    } else if( AbstractClassType( type ) ) {        CErr1( msg_abstract );        InfClassDecl( type );        ScopeNotePureFunctions( type );    } else {        retb = true;    }    return( retb );}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:22,


示例8: SetFarHuge

void SetFarHuge( SYMPTR sym, bool report ){    TYPEPTR             typ;    type_modifiers      attrib;    target_size         size;#if _CPU != 8086    /* unused parameters */ (void)report;#endif#if _CPU == 8086    if( sym->attribs.declspec == DECLSPEC_DLLIMPORT      || sym->attribs.declspec == DECLSPEC_DLLEXPORT ) {        sym->mods |= FLAG_FAR;    } else if( sym->mods & FLAG_EXPORT ) {        sym->mods |= FLAG_FAR;    }#endif    size = SizeOfArg( sym->sym_type );    if( TargetSwitches & BIG_DATA ) {        attrib = sym->mods;        if( (attrib & MASK_ALL_MEM_MODELS) == 0 ) {            if( size == 0 ) {   /* unspecified array size */                if( sym->attribs.stg_class == SC_EXTERN ) {                    typ = sym->sym_type;                    if( typ->decl_type == TYPE_ARRAY ) {                        attrib |= FLAG_FAR;                    }                }            } else if( size > DataThreshold ) {                attrib |= FLAG_FAR;            } else if( CompFlags.strings_in_code_segment && ( sym->mods & FLAG_CONST ) ) {                attrib |= FLAG_FAR;            }#if _CPU == 8086            if( (attrib & FLAG_FAR) && size > 0x10000 ) {                attrib &= ~FLAG_FAR;                attrib |= FLAG_HUGE;            }#endif            sym->mods = attrib;        }    }#if _CPU == 8086   if( report && size > 0x10000 && (sym->mods & FLAG_HUGE) == 0 ) {        SetErrLoc( &sym->src_loc );        CErr1( ERR_VAR_TOO_LARGE );        InitErrLoc();   }#endif}
开发者ID:ArmstrongJ,项目名称:open-watcom-v2,代码行数:51,


示例9: pchWarn

static void pchWarn( MSG_NUM msg ){    if( CompFlags.no_pch_warnings ) {        return;    }    if( CompFlags.fhr_switch_used ) {        return;    }    if( CompFlags.fhwe_switch_used ) {        CWarnDontCount( msg );    } else {        CErr1( msg );    }}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:14,


示例10: macroAllocSegment

static void macroAllocSegment(   // ALLOCATE MACRO SEGMENT    unsigned minimum )          // - minimum size req'd{    MACRO_SEG_LIST  *macroSegment;    if( minimum > MAC_SEGMENT_LIMIT ) {        CErr1( ERR_OUT_OF_MACRO_MEMORY );        CSuicide();    }    macroSegment = RingAlloc( &macroSegmentList, sizeof( MACRO_SEG_LIST ) );    MacroOffset =  macroSegment->segment;    macroSegmentLimit = MAC_SEGMENT_LIMIT;    ExtraRptIncrementCtr( macro_segments );}
开发者ID:jossk,项目名称:open-watcom-v2,代码行数:14,


示例11: CErr1

static void idiv64              // DO 64-BIT SIGNED DIVISION    ( signed_64 const * v1      // - top    , signed_64 const * v2      // - divisor    , signed_64* result         // - result    , signed_64* rem )          // - remainder{    if( v2->u._32[0] == 0     && v2->u._32[1] == 0 ) {        CErr1( ERR_DIVISION_BY_ZERO );        result->u._32[ I64HI32 ] = 0;        result->u._32[ I64LO32 ] = 1;        rem->u._32[ I64HI32 ] = 0;        rem->u._32[ I64LO32 ] = 0;    } else {        I64Div( v1, v2, result, rem );    }}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:17,


示例12: AsmStmt

void AsmStmt( void )/******************/{    int             too_many_bytes;    unsigned char   buff[ MAXIMUM_BYTESEQ + 32 ];    TOKEN           skip_token;    ppctl_t         old_ppctl;    old_ppctl = CompFlags.pre_processing;    // indicate that we are inside an __asm statement so scanner will    // allow tokens unique to the assembler. e.g. 21h    PPCTL_ENABLE_ASM();    NextToken();    AsmSysInit( buff );    too_many_bytes = 0;    if( CurToken == T_LEFT_BRACE ) {        NextToken();        for( ;; ) {             // grab assembler lines            GetAsmLine();            if( AsmCodeAddress > MAXIMUM_BYTESEQ ) {                if( ! too_many_bytes ) {                    CErr1( ERR_TOO_MANY_BYTES_IN_PRAGMA );                    too_many_bytes = 1;                }                // reset index to we don't overrun buffer                AsmCodeAddress = 0;            }            if( CurToken == T_RIGHT_BRACE )                break;            if( CurToken == T_EOF )                break;            NextToken();        }        skip_token = T_RIGHT_BRACE;    } else {        GetAsmLine();           // grab single assembler instruction        skip_token = T_NULL;    }    CompFlags.pre_processing = old_ppctl;    AsmSysMakeInlineAsmFunc( too_many_bytes );    AsmSysFini();    if( CurToken == skip_token ) {        NextToken();    }}
开发者ID:jossk,项目名称:open-watcom-v2,代码行数:46,


示例13: InitWCharArray

local void InitWCharArray( TYPEPTR typ ){    unsigned            len;    unsigned            i;    STRING_LITERAL      *str_lit;    unsigned            value;    unsigned short      *pwc;    unsigned long       size;    DATA_QUAD           dq;    dq.type = QDT_SHORT;    dq.flags = Q_DATA;/*      This function handles the initialization of statements like:  *//*              wchar_t  name[5] = L"abcd";  */    str_lit = GetLiteral();    if( !CompFlags.wide_char_string )        CErr1( ERR_TYPE_MISMATCH );    len = str_lit->length / sizeof(unsigned short);    if( typ->u.array->unspecified_dim ) {        typ->u.array->dimension = len;    }    size = typ->u.array->dimension;    if( len > size ) {        if( (len - size) > 1 ) {            CWarn1( WARN_LIT_TOO_LONG, ERR_LIT_TOO_LONG );        }        len = size;    }    pwc = (unsigned short *)str_lit->literal;    i = 0;    while( i < len ) {        value = *pwc++;        if( value != 0 ) CompFlags.non_zero_data = 1;        dq.u.long_values[0] = value;        GenDataQuad( &dq, sizeof( target_short ) );        ++i;    }    if( i < size ) {        ZeroBytes( (size - i) * sizeof(unsigned short) );    }    FreeLiteral( str_lit ); }
开发者ID:XVilka,项目名称:owp4v1copy,代码行数:44,


示例14: scanInputFile

static void scanInputFile(       // PROCESS NAME OF INPUT FILE    void ){    char filename[ _MAX_PATH ]; // - scanned file name    size_t len;                 // - length of file name    char const *fnm;            // - file name in command line    len = CmdScanFilename( &fnm );    ++CompInfo.compfile_max;    if( CompInfo.compfile_max == CompInfo.compfile_cur ) {        if( WholeFName == NULL ) {            stvcpy( filename, fnm, len );            StripQuotes( filename );            WholeFName = FNameAdd( filename );        } else {            CErr1( ERR_CAN_ONLY_COMPILE_ONE_FILE );        }    }}
开发者ID:andreiw,项目名称:open-watcom-v2,代码行数:19,


示例15: CElse

local void CElse( void ){    if( ( NestLevel == 0 ) || ( CppStack->cpp_type == PRE_ELSE ) ) {        CErr1( ERR_MISPLACED_ELSE );    } else {        if( NestLevel == SkipLevel ) {            --SkipLevel;                /* start skipping else part */            CppStack->processing = 0;        } else if( NestLevel == SkipLevel + 1 ) {            /* cpp_type will be PRE_ELIF if an elif was true */            if( CppStack->cpp_type == PRE_IF ) {        /* 19-sep-88 */                SkipLevel = NestLevel;  /* start including else part */                CppStack->processing = 1;            }        }        CppStack->cpp_type = PRE_ELSE;    }    PPNextToken();    WantEOL();}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:20,


示例16: CErr1

local DATA_QUAD_LIST *NewDataQuad( void ){    static DATA_QUAD_LIST   *DataQuadPtr;    DATA_QUAD_LIST          *dql;    if( DataQuadIndex >= (DATA_QUADS_PER_SEG - 1) ) {        if( DataQuadSegIndex == MAX_DATA_QUAD_SEGS ) {            CErr1( ERR_INTERNAL_LIMIT_EXCEEDED );            CSuicide();        }        ++DataQuadSegIndex;        DataQuadIndex = 0;        DataQuadPtr = FEmalloc( DATA_QUAD_SEG_SIZE );        DataQuadSegs[ DataQuadSegIndex ] = DataQuadPtr;    }    dql = DataQuadPtr;    ++DataQuadIndex;    ++DataQuadPtr;    return dql;}
开发者ID:XVilka,项目名称:owp4v1copy,代码行数:20,


示例17: CEndif

local void CEndif( void ){    if( NestLevel == 0 ) {        CErr1( ERR_MISPLACED_ENDIF );    } else {        struct cpp_info *cpp;        --NestLevel;        cpp = CppStack;        if( cpp->flist != SrcFile->src_flist ) {             CWarn2p( WARN_LEVEL_1, ERR_WEIRD_ENDIF_ENCOUNTER, FileIndexToCorrectName( cpp->src_loc.fno ) );        }        CppStack = cpp->prev_cpp;        CMemFree( cpp );    }    if( NestLevel < SkipLevel ) {        SkipLevel = NestLevel;    }    PPNextToken();    WantEOL();}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:21,


示例18: miscAnalysis

static void miscAnalysis( OPT_STORAGE *data ){#if _CPU == 8086    if( data->bd || data->zu ) {        if( TargetSwitches & SMART_WINDOWS ) {            CErr1( ERR_ZWS_MUST_HAVE_SS_DS_SAME );        }    }#endif    if( GET_CPU( CpuSwitches ) < CPU_386 ) {        /* issue warning message if /zf[f|p] or /zg[f|p] spec'd? */        TargetSwitches &= ~( FLOATING_FS | FLOATING_GS );    }    if( ! CompFlags.save_restore_segregs ) {        if( TargetSwitches & FLOATING_DS ) {            HW_CTurnOff( WatcallInfo.save, HW_DS );        }        if( TargetSwitches & FLOATING_ES ) {            HW_CTurnOff( WatcallInfo.save, HW_ES );        }        if( TargetSwitches & FLOATING_FS ) {            HW_CTurnOff( WatcallInfo.save, HW_FS );        }        if( TargetSwitches & FLOATING_GS ) {            HW_CTurnOff( WatcallInfo.save, HW_GS );        }    }    if( GET_FPU( CpuSwitches ) > FPU_NONE ) {        PreDefineStringMacro( "__FPI__" );    }#if _CPU == 386    if( ! CompFlags.register_conventions ) {        SetAuxStackConventions();    }#endif    if( data->zx ) {        HW_CTurnOff( WatcallInfo.save, HW_FLTS );    }}
开发者ID:andreiw,项目名称:open-watcom-v2,代码行数:39,


示例19: StoreInt64

local void StoreInt64( TYPEPTR typ ){    TREEPTR     tree;    DATA_QUAD   dq;    dq.type = typ->decl_type;    dq.flags = Q_DATA;    U32ToU64( 0, &dq.u.long64 );    if( CurToken != T_RIGHT_BRACE ) {        tree = SingleExpr();        tree = InitAsgn( typ, tree ); // as if we are assigning        if( tree->op.opr == OPR_PUSHINT || tree->op.opr == OPR_PUSHFLOAT ) {            CastConstValue( tree, typ->decl_type );            dq.u.long64 = tree->op.ulong64_value;        } else {            CErr1( ERR_NOT_A_CONSTANT_EXPR );        }        FreeExprTree( tree );        CompFlags.non_zero_data = 1;    }    GenDataQuad( &dq, sizeof( int64 ) );}
开发者ID:XVilka,项目名称:owp4v1copy,代码行数:22,


示例20: PragRegList

hw_reg_set *PragManyRegSets( void )/*********************************/{    int         i;    hw_reg_set  list;    hw_reg_set  *sets;    hw_reg_set  buff[ MAXIMUM_PARMSETS ];    list = PragRegList();    i = 0;    while( !HW_CEqual( list, HW_EMPTY ) && ( i != MAXIMUM_PARMSETS ) ) {        buff[ i++ ] = list;        list = PragRegList();    }    if( !HW_CEqual( list, HW_EMPTY ) ) {        CErr1( ERR_TOO_MANY_PARM_SETS );    }    HW_CAsgn( buff[ i ], HW_EMPTY );    i++;    i *= sizeof( hw_reg_set );    sets = (hw_reg_set *)CMemAlloc( i );    memcpy( sets, buff, i );    return( sets );}
开发者ID:jossk,项目名称:open-watcom-v2,代码行数:24,



注:本文中的CErr1函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CError函数代码示例
C++ CE_ASSERT函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。