当前位置: 首页>>代码示例>>C++>>正文


C++ CErr1函数代码示例

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


在下文中一共展示了CErr1函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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,代码来源:cstmt.c

示例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,代码来源:cpragma.c

示例3: pragTemplateDepth

// #pragma template_depth n
// #pragma template_depth( n )
//
// Used to set the depth, up to which, function templates will be expanded
static 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,代码来源:cpragma.c

示例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,代码来源:cpragma.c

示例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,代码来源:cmdlnx86.c

示例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,代码来源:cmac2.c

示例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,代码来源:analtype.c

示例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,代码来源:cinfo.c

示例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,代码来源:pcheader.c

示例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,代码来源:cmacadd.c

示例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,代码来源:fold.c

示例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,代码来源:asmstmt.c

示例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,代码来源:cdinit.c

示例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,代码来源:cmdlnany.c

示例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,代码来源:cmac2.c


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