• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ outdata函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: scanner_chessboard_data

static void scanner_chessboard_data(struct parport *port, int mode)
{
	int count;

	/* initial weirdness here for 620P - seems to go quite fast,
	 * just ignore it! */

	for (count = 0; count < 2; count++)
	{
		/* Wiggle data lines (4 times) while strobing C1 */
		/* 33 here for *30P, 55 for *20P */
		if (mode == INITMODE_20P)
			outdata(port, 0x55);
		else
			outdata(port, 0x33);
		outcont(port, HOSTBUSY, HOSTBUSY);	
		usleep(10);
		outcont(port, 0, HOSTBUSY);	
		usleep(10);
		outcont(port, HOSTBUSY, HOSTBUSY);	
		usleep(10);

		if (mode == INITMODE_20P)
			outdata(port, 0xaa);
		else
			outdata(port, 0xcc);
		outcont(port, HOSTBUSY, HOSTBUSY);	
		usleep(10);
		outcont(port, 0, HOSTBUSY);	
		usleep(10);
		outcont(port, HOSTBUSY, HOSTBUSY);	
		usleep(10);
	}
}
开发者ID:Distrotech,项目名称:sane-backends,代码行数:34,代码来源:canon_pp-io.c


示例2: error

void TypedefDeclaration::toObjFile(int multiobj)
{
    //printf("TypedefDeclaration::toObjFile('%s')\n", toChars());

    if (type->ty == Terror)
    {   error("had semantic errors when compiling");
        return;
    }

    if (global.params.symdebug)
        toDebug(this);

    type->genTypeInfo(NULL);

    TypeTypedef *tc = (TypeTypedef *)type;
    if (type->isZeroInit() || !tc->sym->init)
        ;
    else
    {
        enum_SC scclass = SCglobal;
        if (isInstantiated())
            scclass = SCcomdat;

        // Generate static initializer
        toInitializer();
        sinit->Sclass = scclass;
        sinit->Sfl = FLdata;
        sinit->Sdt = Initializer_toDt(tc->sym->init);
        out_readonly(sinit);
        outdata(sinit);
    }
}
开发者ID:mnembrini,项目名称:dmd,代码行数:32,代码来源:toobj.c


示例3: strlen

elem *Module::toEfilename()
{   elem *efilename;

    if (!sfilename)
    {
	dt_t *dt = NULL;
	char *id;
	int len;

	id = srcfile->toChars();
	len = strlen(id);
	dtdword(&dt, len);
	dtabytes(&dt,TYnptr, 0, len + 1, id);

	sfilename = symbol_generate(SCstatic,type_fake(TYdarray));
	sfilename->Sdt = dt;
	sfilename->Sfl = FLdata;
#if ELFOBJ
	sfilename->Sseg = CDATA;
#endif
#if MACHOBJ
	// Because of PIC and CDATA being in the _TEXT segment, cannot
	// have pointers in CDATA
	sfilename->Sseg = DATA;
#endif
	outdata(sfilename);
    }

    efilename = el_var(sfilename);
    return efilename;
}
开发者ID:Geod24,项目名称:dnet,代码行数:31,代码来源:glue.c


示例4: dtxoff

void TypeInfoTupleDeclaration::toDt(dt_t **pdt)
{
    //printf("TypeInfoTupleDeclaration::toDt() %s\n", tinfo->toChars());
    dtxoff(pdt, Type::typeinfotypelist->toVtblSymbol(), 0, TYnptr); // vtbl for TypeInfoInterface
    dtsize_t(pdt, 0);                        // monitor

    assert(tinfo->ty == Ttuple);

    TypeTuple *tu = (TypeTuple *)tinfo;

    size_t dim = tu->arguments->dim;
    dtsize_t(pdt, dim);                      // elements.length

    dt_t *d = NULL;
    for (size_t i = 0; i < dim; i++)
    {   Parameter *arg = tu->arguments->tdata()[i];
        Expression *e = arg->type->getTypeInfo(NULL);
        e = e->optimize(WANTvalue);
        e->toDt(&d);
    }

    Symbol *s;
    s = static_sym();
    s->Sdt = d;
    outdata(s);

    dtxoff(pdt, s, 0, TYnptr);              // elements.ptr
}
开发者ID:spott,项目名称:dmd,代码行数:28,代码来源:typinf.c


示例5: visit

        void visit(TypeInfoDeclaration *tid)
        {
            //printf("TypeInfoDeclaration::toObjFile(%p '%s') protection %d\n", tid, tid->toChars(), tid->protection);

            if (multiobj)
            {
                obj_append(tid);
                return;
            }

            Symbol *s = toSymbol(tid);
            s->Sclass = SCcomdat;
            s->Sfl = FLdata;

            TypeInfo_toDt(&s->Sdt, tid);

            dt_optimize(s->Sdt);

            // See if we can convert a comdat to a comdef,
            // which saves on exe file space.
            if (s->Sclass == SCcomdat &&
                dtallzeros(s->Sdt))
            {
                s->Sclass = SCglobal;
                dt2common(&s->Sdt);
            }

            outdata(s);
            if (tid->isExport())
                objmod->export_symbol(s, 0);
        }
开发者ID:CodeAlchemist-T,项目名称:dmd,代码行数:31,代码来源:toobj.c


示例6: assert

symbol *except_gentables()
{
    //printf("except_gentables()\n");
    if (OUREH)
    {
        // BUG: alloca() changes the stack size, which is not reflected
        // in the fixed eh tables.
        assert(!usedalloca);

        char name[13+5+1];
        static int tmpnum;
        sprintf(name,"_HandlerTable%d",tmpnum++);

        symbol *s = symbol_name(name,SCstatic,tsint);
        symbol_keep(s);
        symbol_debug(s);

        except_fillInEHTable(s);

        outdata(s);                 // output the scope table

        objmod->ehtables(funcsym_p,funcsym_p->Ssize,s);
    }
    return NULL;
}
开发者ID:Govelius,项目名称:dmd,代码行数:25,代码来源:eh.c


示例7: win64_pdata

void win64_pdata(Symbol *sf)
{
//    return; // doesn't work yet

    //printf("win64_pdata()\n");
    assert(config.exe == EX_WIN64);

    // Generate the pdata name, which is $pdata$funcname
    size_t sflen = strlen(sf->Sident);
    char *pdata_name = (char *)alloca(7 + sflen + 1);
    assert(pdata_name);
    memcpy(pdata_name, "$pdata$", 7);
    memcpy(pdata_name + 7, sf->Sident, sflen + 1);      // include terminating 0

    symbol *spdata = symbol_name(pdata_name,SCstatic,tsint);
    symbol_keep(spdata);
    symbol_debug(spdata);

    symbol *sunwind = win64_unwind(sf);

    /* 3 pointers are emitted:
     *  1. pointer to start of function sf
     *  2. pointer past end of function sf
     *  3. pointer to unwind data
     */

    dt_t **pdt = &spdata->Sdt;
    pdt = dtxoff(pdt,sf,0,TYint);       // Note the TYint, these are 32 bit fixups
    pdt = dtxoff(pdt,sf,retoffset + retsize,TYint);
    pdt = dtxoff(pdt,sunwind,0,TYint);

    spdata->Sseg = symbol_iscomdat(sf) ? MsCoffObj::seg_pdata_comdat(sf) : MsCoffObj::seg_pdata();
    spdata->Salignment = 4;
    outdata(spdata);
}
开发者ID:AlexBezzubenko,项目名称:dmd,代码行数:35,代码来源:pdata.c


示例8: objc_getMethVarName

Symbol *objc_getMethVarRef(const char *s, size_t len)
{
    objc_hasSymbols = true;

    StringValue *sv = objc_smethVarRefTable->update(s, len);
    Symbol *refsymbol = (Symbol *) sv->ptrvalue;
    if (refsymbol == NULL)
    {
        // create data
        dt_t *dt = NULL;
        Symbol *sselname = objc_getMethVarName(s, len);
        dtxoff(&dt, sselname, 0, TYnptr);

        // find segment
        int seg = objc_getSegment(SEGselrefs);

        // create symbol
        static size_t selcount = 0;
        char namestr[42];
        sprintf(namestr, "L_OBJC_SELECTOR_REFERENCES_%lu", selcount);
        refsymbol = symbol_name(namestr, SCstatic, type_fake(TYnptr));

        refsymbol->Sdt = dt;
        refsymbol->Sseg = seg;
        outdata(refsymbol);
        sv->ptrvalue = refsymbol;

        ++selcount;
    }
    return refsymbol;
}
开发者ID:Angeldude,项目名称:dmd,代码行数:31,代码来源:objc_glue.c


示例9: error

symbol *except_gentables()
{
    //printf("except_gentables()\n");
    if (config.ehmethod == EH_DM)
    {
        // BUG: alloca() changes the stack size, which is not reflected
        // in the fixed eh tables.
        if (Alloca.size)
            error(NULL, 0, 0, "cannot mix core.std.stdlib.alloca() and exception handling in %s()", funcsym_p->Sident);

        char name[13+5+1];
        static int tmpnum;
        sprintf(name,"_HandlerTable%d",tmpnum++);

        symbol *s = symbol_name(name,SCstatic,tsint);
        symbol_keep(s);
        symbol_debug(s);

        except_fillInEHTable(s);

        outdata(s);                 // output the scope table

        objmod->ehtables(funcsym_p,funcsym_p->Ssize,s);
    }
    return NULL;
}
开发者ID:TungstenHeart,项目名称:dmd,代码行数:26,代码来源:eh.c


示例10: runCountingCL95CMS

void runCountingCL95CMS (double lifetime, int observed, double bkg, double bkgStat, double bkgSys, double scaleSys)
{
  cout << "=== running  runCountingCL95CMS->" << lifetime 
       << ' ' << bkg << ' ' << bkgStat << ' ' << bkgSys
       << ' ' << scaleSys
       << ' ' << observed << endl;

  gSystem->Load("cl95cms_new_C.so");


  double bkgerrStat = bkgStat/bkg;
  double bkgerrSys = bkg*sqrt(bkgerrStat*bkgerrStat + bkgSys*bkgSys);
  bkgerrStat = bkgStat;

  double cl95NoSys = CL95 (1.,0.,1.,0.,bkg,bkgerrStat,observed, false, 0);     
  std::cout << "CL95(" << 1.<<','<<0.<<','<<1.<<','<<0.<<','<<bkg<<','<<bkgerrStat<<','<<observed<<','<< false<<','<< 0 << ") = " << cl95NoSys << std::endl;
  double cl95Sys = CL95 (1.,0.,1.,scaleSys,bkg,bkgerrSys,observed, false, 0); 
  std::cout << "CL95(" << 1.<<','<<0.<<','<<1.<<','<<scaleSys<<','<<bkg<<','<<bkgerrSys<<','<<observed<<','<< false<<','<< 0 << ") = " << cl95Sys << std::endl;
  // std::vector<double> result = CLA(1.,0.,1.,0.0001,bkg,bkgerrStat, 0);
  std::vector<double> result = CLA(1.,0.,1.,scaleSys,bkg,bkgerrSys, 0);

  char buffer[10000];
  sprintf (buffer, "lifetime: %6.3e  bkg: %5.3f observed: %3i limNoSys %5.3f limit: %5.3f expectedmean: %5.3f rms1sigma:  %5.3f %5.3f rms2sigma: %5.3f %5.3f  expectedmed: %5.3f qtile1sigma: %5.3f %5.3f qtile2sigma: %5.3f %5.3f",
 	   lifetime, bkg, observed, cl95NoSys, cl95Sys, 
	   result[5], result[6], result[7], result[8], result[9], 
	   result[0], result[1], result[2], result[3], result[4]); 
  ofstream outdata ("lifetimePoinrCL95CMS_out.txt", ios_base::app);
    outdata << buffer << endl;
  outdata.close();
  return;
}
开发者ID:allenji,项目名称:StoppedHSCP,代码行数:31,代码来源:runCountingCL95CMS.C


示例11: error

void StructDeclaration::toObjFile(int multiobj)
{
    //printf("StructDeclaration::toObjFile('%s')\n", toChars());

    if (type->ty == Terror)
    {   error("had semantic errors when compiling");
        return;
    }

    if (multiobj && !hasStaticCtorOrDtor())
    {   obj_append(this);
        return;
    }

    // Anonymous structs/unions only exist as part of others,
    // do not output forward referenced structs's
    if (!isAnonymous() && members)
    {
        if (global.params.symdebug)
            toDebug();

        type->getTypeInfo(NULL);        // generate TypeInfo

        if (1)
        {
            // Generate static initializer
            toInitializer();
            if (isInstantiated())
            {
                sinit->Sclass = SCcomdat;
            }
            else
            {
                sinit->Sclass = SCglobal;
            }

            sinit->Sfl = FLdata;
            toDt(&sinit->Sdt);
            dt_optimize(sinit->Sdt);
            out_readonly(sinit);    // put in read-only segment
            outdata(sinit);
        }

        // Put out the members
        for (size_t i = 0; i < members->dim; i++)
        {
            Dsymbol *member = (*members)[i];
            /* There might be static ctors in the members, and they cannot
             * be put in separate obj files.
             */
            member->toObjFile(multiobj);
        }

        if (xeq && xeq != xerreq)
            xeq->toObjFile(multiobj);
        if (xcmp && xcmp != xerrcmp)
            xcmp->toObjFile(multiobj);
    }
}
开发者ID:sjh2014,项目名称:dmd,代码行数:59,代码来源:toobj.c


示例12: nteh_gentables

void nteh_gentables(Symbol *sfunc)
{
    symbol *s = s_table;
    symbol_debug(s);
#if MARS
    //except_fillInEHTable(s);
#else
    /* NTEH table for C.
     * The table consists of triples:
     *  parent index
     *  filter address
     *  handler address
     */
    unsigned fsize = 4;             // target size of function pointer
    DtBuilder dtb;
    int sz = 0;                     // size so far

    for (block *b = startblock; b; b = b->Bnext)
    {
        if (b->BC == BC_try)
        {
            block *bhandler;

            dtb.dword(b->Blast_index);  // parent index

            // If try-finally
            if (b->numSucc() == 2)
            {
                dtb.dword(0);           // filter address
                bhandler = b->nthSucc(1);
                assert(bhandler->BC == BC_finally);
                // To successor of BC_finally block
                bhandler = bhandler->nthSucc(0);
            }
            else // try-except
            {
                bhandler = b->nthSucc(1);
                assert(bhandler->BC == BC_filter);
                dtb.coff(bhandler->Boffset);    // filter address
                bhandler = b->nthSucc(2);
                assert(bhandler->BC == BC_except);
            }
            dtb.coff(bhandler->Boffset);        // handler address
            sz += 4 + fsize * 2;
        }
    }
    assert(sz != 0);
    s->Sdt = dtb.finish();
#endif

    outdata(s);                 // output the scope table
#if MARS
    nteh_framehandler(sfunc, s);
#endif
    s_table = NULL;
}
开发者ID:klickverbot,项目名称:dmd,代码行数:56,代码来源:nteh.c


示例13: outdata

/**
 * Implements svn_read_fn_t to read to data into Subversion.
 * @param baton     an Inputer object for the callback
 * @param buffer    the buffer for the read data
 * @param len       on input the buffer len, on output the number of read bytes
 * @return a subversion error or SVN_NO_ERROR
 */
svn_error_t *Inputer::read(void *baton, char *buffer, apr_size_t *len)
{
  JNIEnv *env = JNIUtil::getEnv();
  // An object of our class is passed in as the baton.
  Inputer *that = (Inputer*)baton;

  // The method id will not change during the time this library is
  // loaded, so it can be cached.
  static jmethodID mid = 0;
  if (mid == 0)
    {
      jclass clazz = env->FindClass(JAVA_PACKAGE"/InputInterface");
      if (JNIUtil::isJavaExceptionThrown())
        return SVN_NO_ERROR;

      mid = env->GetMethodID(clazz, "read", "([B)I");
      if (JNIUtil::isJavaExceptionThrown() || mid == 0)
        return SVN_NO_ERROR;

      env->DeleteLocalRef(clazz);
      if (JNIUtil::isJavaExceptionThrown())
        return SVN_NO_ERROR;
    }

  // Allocate a Java byte array to read the data.
  jbyteArray data = JNIUtil::makeJByteArray((const signed char*)buffer,
                                            *len);
  if (JNIUtil::isJavaExceptionThrown())
    return SVN_NO_ERROR;

  // Read the data.
  jint jread = env->CallIntMethod(that->m_jthis, mid, data);
  if (JNIUtil::isJavaExceptionThrown())
    return SVN_NO_ERROR;

  // Put the Java byte array into a helper object to retrieve the
  // data bytes.
  JNIByteArray outdata(data, true);
  if (JNIUtil::isJavaExceptionThrown())
    return SVN_NO_ERROR;

  // Catch when the Java method tells us it read too much data.
  if (jread > (jint) *len)
    jread = -1;

  // In the case of success copy the data back to the Subversion
  // buffer.
  if (jread > 0)
    memcpy(buffer, outdata.getBytes(), jread);

  // Copy the number of read bytes back to Subversion.
  *len = jread;

  return SVN_NO_ERROR;
}
开发者ID:aosm,项目名称:subversion,代码行数:62,代码来源:Inputer.cpp


示例14: nteh_gentables

void nteh_gentables()
{
    symbol *s = s_table;
    symbol_debug(s);
#if MARS
    //except_fillInEHTable(s);
#else
    /* NTEH table for C.
     * The table consists of triples:
     *  parent index
     *  filter address
     *  handler address
     */
    unsigned fsize = 4;             // target size of function pointer
    dt_t **pdt = &s->Sdt;
    int sz = 0;                     // size so far

    for (block *b = startblock; b; b = b->Bnext)
    {
        if (b->BC == BC_try)
        {   dt_t *dt;
            block *bhandler;

            pdt = dtdword(pdt,b->Blast_index);  // parent index

            // If try-finally
            if (list_nitems(b->Bsucc) == 2)
            {
                pdt = dtdword(pdt,0);           // filter address
                bhandler = list_block(list_next(b->Bsucc));
                assert(bhandler->BC == BC_finally);
                // To successor of BC_finally block
                bhandler = list_block(bhandler->Bsucc);
            }
            else // try-except
            {
                bhandler = list_block(list_next(b->Bsucc));
                assert(bhandler->BC == BC_filter);
                pdt = dtcoff(pdt,bhandler->Boffset);    // filter address
                bhandler = list_block(list_next(list_next(b->Bsucc)));
                assert(bhandler->BC == BC_except);
            }
            pdt = dtcoff(pdt,bhandler->Boffset);        // handler address
            sz += 4 + fsize * 2;
        }
    }
    assert(sz != 0);
#endif

    outdata(s);                 // output the scope table
#if MARS
    nteh_framehandler(s);
#endif
    s_table = NULL;
}
开发者ID:spott,项目名称:dmd,代码行数:55,代码来源:nteh.c


示例15: type_alloc

/*************************************
 * Create a reference to another dt.
 */
void DtBuilder::dtoff(dt_t *dt, unsigned offset)
{
    type *t = type_alloc(TYint);
    t->Tcount++;
    Symbol *s = symbol_calloc("internal");
    s->Sclass = SCstatic;
    s->Sfl = FLextern;
    s->Sflags |= SFLnodebug;
    s->Stype = t;
    s->Sdt = dt;
    outdata(s);

    xoff(s, offset);
}
开发者ID:bitwise-github,项目名称:dmd,代码行数:17,代码来源:dt.c


示例16: symbol_name

Symbol *Module::gencritsec()
{
    Symbol *s;
    type *t;

    t = Type::tint32->toCtype();
    s = symbol_name("critsec", SCstatic, t);
    s->Sfl = FLdata;
    /* Must match D_CRITICAL_SECTION in phobos/internal/critical.c
     */
    dtnzeros(&s->Sdt, PTRSIZE + (I64 ? os_critsecsize64() : os_critsecsize32()));
    outdata(s);
    return s;
}
开发者ID:sgraf812,项目名称:dmd,代码行数:14,代码来源:glue.c


示例17: assert

Symbol *objc_getModuleInfo()
{
    assert(!objc_smoduleInfo); // only allow once per object file
    objc_hasSymbols = true;

    dt_t *dt = NULL;

    Symbol* symbol = symbol_name("L_OBJC_LABEL_CLASS_$", SCstatic, type_allocn(TYarray, tschar));
    symbol->Sdt = dt;
    symbol->Sseg = objc_getSegment(SEGmodule_info);
    outdata(symbol);

    objc_getImageInfo(); // make sure we also generate image info

    return objc_smoduleInfo;
}
开发者ID:Angeldude,项目名称:dmd,代码行数:16,代码来源:objc_glue.c


示例18: outdata

QByteArray Decrypter::decrypt(QByteArray &indata)
{        
    int size = indata.size();
    QByteArray outdata(size, 0x0);

    unsigned char* datain = reinterpret_cast<unsigned char*>(indata.data());
    unsigned char* dataout = reinterpret_cast<unsigned char*>(outdata.data());
    unsigned long numBlocks = size / 16;

    _crypt.Decrypt(datain, dataout, numBlocks);

    int i = outdata.indexOf(QByteArray::fromHex("FD").data());
    outdata.remove(i, size);

    return outdata;
}
开发者ID:BFeri92,项目名称:OpenGOO,代码行数:16,代码来源:decrypter.cpp


示例19: symbol_name

Symbol *Module::gencritsec()
{
    Symbol *s;
    type *t;

    t = Type::tint32->toCtype();
    s = symbol_name("critsec", SCstatic, t);
    s->Sfl = FLdata;
    /* Must match D_CRITICAL_SECTION in phobos/internal/critical.c
     */
    dtnzeros(&s->Sdt, PTRSIZE + os_critsecsize());
#if ELFOBJ || MACHOBJ // Burton
    s->Sseg = DATA;
#endif
    outdata(s);
    return s;
}
开发者ID:Geod24,项目名称:dnet,代码行数:17,代码来源:glue.c


示例20: obj_append

void TypeInfoDeclaration::toObjFile(int multiobj)
{
    Symbol *s;
    unsigned sz;
    Dsymbol *parent;

    //printf("TypeInfoDeclaration::toObjFile(%p '%s') protection %d\n", this, toChars(), protection);

    if (multiobj)
    {
        obj_append(this);
        return;
    }

    s = toSymbol();
    sz = type->size();

    parent = this->toParent();
    s->Sclass = SCcomdat;
    s->Sfl = FLdata;

    toDt(&s->Sdt);

    dt_optimize(s->Sdt);

    // See if we can convert a comdat to a comdef,
    // which saves on exe file space.
    if (s->Sclass == SCcomdat &&
        s->Sdt->dt == DT_azeros &&
        s->Sdt->DTnext == NULL)
    {
        s->Sclass = SCglobal;
        s->Sdt->dt = DT_common;
    }

#if ELFOBJ || MACHOBJ // Burton
    if (s->Sdt && s->Sdt->dt == DT_azeros && s->Sdt->DTnext == NULL)
        s->Sseg = UDATA;
    else
        s->Sseg = DATA;
#endif
    outdata(s);
    if (isExport())
        obj_export(s,0);
}
开发者ID:spott,项目名称:dmd,代码行数:45,代码来源:typinf.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ outer函数代码示例发布时间:2022-05-30
下一篇:
C++ outc函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap