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


C++ Make函数代码示例

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


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

示例1: modes

sk_sp<SkFlattenable> SkMergeImageFilter::CreateProc(SkReadBuffer& buffer) {
    Common common;
    if (!common.unflatten(buffer, -1)) {
        return nullptr;
    }

    const int count = common.inputCount();
    bool hasModes = buffer.readBool();
    if (hasModes) {
        SkAutoSTArray<4, SkXfermode::Mode> modes(count);
        SkAutoSTArray<4, uint8_t> modes8(count);
        if (!buffer.readByteArray(modes8.get(), count)) {
            return nullptr;
        }
        for (int i = 0; i < count; ++i) {
            modes[i] = (SkXfermode::Mode)modes8[i];
            buffer.validate(SkIsValidMode(modes[i]));
        }
        if (!buffer.isValid()) {
            return nullptr;
        }
        return Make(common.inputs(), count, modes.get(), &common.cropRect());
    }
    return Make(common.inputs(), count, nullptr, &common.cropRect());
}
开发者ID:alphan102,项目名称:gecko-dev,代码行数:25,代码来源:SkMergeImageFilter.cpp

示例2: main

int main()
{
    Make('i', 'i');
    Make('i', 'u');
    Make('u', 'i');
    Make('i', 'i');
}
开发者ID:CCJY,项目名称:coliru,代码行数:7,代码来源:main.cpp

示例3: TakeIt

TokenPtr SLScanner::ScanMinusOp()
{
    std::string spell;
    spell += TakeIt();

    if (Is('-'))
        return Make(Tokens::UnaryOp, spell, true);
    else if (Is('='))
        return Make(Tokens::AssignOp, spell, true);

    return Make(Tokens::BinaryOp, spell);
}
开发者ID:LukasBanana,项目名称:HLSLTranslator,代码行数:12,代码来源:SLScanner.cpp

示例4: Make

void Make(int p,int u,int v,int c){
	if (u==v) return;
	if (level[u]>level[v]){
		int k=g[father[u]][u];
		w[k][p]=max(w[k][p],cost[k]-c);
		Make(p,father[u],v,c);
	}else{
		int k=g[father[v]][v];
		w[k][p]=max(w[k][p],cost[k]-c);
		Make(p,u,father[v],c);
	}
}
开发者ID:TRYang,项目名称:acm,代码行数:12,代码来源:sgu_206.cpp

示例5: Make

void Make(long l, long r, Set& s) {
    if (l == r) {
        long t = s.Value();
        if (t > best)
            ID = l, best = t;
        return;
    }
    Set L, R;
    long mid = (l + r) >> 1;
    Add(s, L, l, mid);
    Add(s, R, mid + 1, r);
    Make(l, mid, R);
    Make(mid + 1, r, L);
}
开发者ID:qscqesze,项目名称:acm-icpc,代码行数:14,代码来源:1961.cpp

示例6: MainLineIterate

static void MainLineIterate(typePos *Position)
    {
    int va, v2, cp;
    uint32 m;
    (Position->Dyn + 1)->move = MoveNone;
    Mobility(Position);
    if (!RobboTotalBaseScore(Position, &va))
        {
        if (VerboseRobboBases)
			{
			Send("info string Failure in MainLine\n");

#ifdef Log
			if (WriteLog)
				{
				log_file = fopen(log_filename, "a");
				fprintf(log_file, "info string Failure in MainLine\n");
				close_log();
				}
#endif
			}

        (Position->Dyn + 1)->move = MoveNone;
       Position->StackHeight = 0;
        return;
        }
    if (!RobboMove(Position, &m, &v2, &cp))
        {
        (Position->Dyn + 1)->move = MoveNone;
       Position->StackHeight = 0;
        return;
        }
    if (va == dDraw)
        {
       Position->StackHeight = 0;
        Make(Position, m);
       Position->StackHeight = 1;
        Undo(Position, m);
        return;
        }
    m &= 0x7fff;
   Position->StackHeight = 0;
    Make(Position, m);
   Position->StackHeight = 1;
    MainLineIterate(Position);
    Undo(Position, m);
   Position->StackHeight = 1;
    }
开发者ID:Censor,项目名称:Firenzina,代码行数:48,代码来源:robbo_glue.c

示例7: Make

ArrayData* ProxyArray::SetInt(ArrayData* ad, int64_t k,
                                         const Variant& v, bool copy) {
  ad = copy ? Make(innerArr(ad)) : ad;
  auto r = innerArr(ad)->set(k, v, innerArr(ad)->hasMultipleRefs());
  assert(!copy);
  return reseatable(ad, r);
}
开发者ID:aripringle,项目名称:hhvm,代码行数:7,代码来源:proxy-array.cpp

示例8: MakeForLocalSpace

sk_sp<SkFlattenable> SkPictureImageFilter::CreateProc(SkReadBuffer& buffer) {
    sk_sp<SkPicture> picture;
    SkRect cropRect;

    if (buffer.isCrossProcess() && SkPicture::PictureIOSecurityPrecautionsEnabled()) {
        buffer.validate(!buffer.readBool());
    } else {
        if (buffer.readBool()) {
            picture = SkPicture::MakeFromBuffer(buffer);
        }
    }
    buffer.readRect(&cropRect);
    PictureResolution pictureResolution;
    if (buffer.isVersionLT(SkReadBuffer::kPictureImageFilterResolution_Version)) {
        pictureResolution = kDeviceSpace_PictureResolution;
    } else {
        pictureResolution = (PictureResolution)buffer.readInt();
    }

    if (kLocalSpace_PictureResolution == pictureResolution) {
        //filterLevel is only serialized if pictureResolution is LocalSpace
        SkFilterQuality filterQuality;
        if (buffer.isVersionLT(SkReadBuffer::kPictureImageFilterLevel_Version)) {
            filterQuality = kLow_SkFilterQuality;
        } else {
            filterQuality = (SkFilterQuality)buffer.readInt();
        }
        return MakeForLocalSpace(picture, cropRect, filterQuality);
    }
    return Make(picture, cropRect);
}
开发者ID:hxsong-GitHub,项目名称:skia,代码行数:31,代码来源:SkPictureImageFilter.cpp

示例9: SK_IMAGEFILTER_UNFLATTEN_COMMON

sk_sp<SkFlattenable> SkMatrixConvolutionImageFilter::CreateProc(SkReadBuffer& buffer) {
    SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
    SkISize kernelSize;
    kernelSize.fWidth = buffer.readInt();
    kernelSize.fHeight = buffer.readInt();
    const int count = buffer.getArrayCount();

    const int64_t kernelArea = sk_64_mul(kernelSize.width(), kernelSize.height());
    if (!buffer.validate(kernelArea == count)) {
        return nullptr;
    }
    SkAutoSTArray<16, SkScalar> kernel(count);
    if (!buffer.readScalarArray(kernel.get(), count)) {
        return nullptr;
    }
    SkScalar gain = buffer.readScalar();
    SkScalar bias = buffer.readScalar();
    SkIPoint kernelOffset;
    kernelOffset.fX = buffer.readInt();
    kernelOffset.fY = buffer.readInt();
    TileMode tileMode = (TileMode)buffer.readInt();
    bool convolveAlpha = buffer.readBool();
    return Make(kernelSize, kernel.get(), gain, bias, kernelOffset, tileMode,
                convolveAlpha, common.getInput(0), &common.cropRect());
}
开发者ID:alphan102,项目名称:gecko-dev,代码行数:25,代码来源:SkMatrixConvolutionImageFilter.cpp

示例10: Make

sk_sp<SkFlattenable> SkToSRGBColorFilter::CreateProc(SkReadBuffer& buffer) {
    auto data = buffer.readByteArrayAsData();
    if (data) {
        return Make(SkColorSpace::Deserialize(data->data(), data->size()));
    }
    return nullptr;
}
开发者ID:molikto,项目名称:Skia,代码行数:7,代码来源:SkToSRGBColorFilter.cpp

示例11: Make

sk_sp<SkFont> SkFont::Testing_CreateFromPaint(const SkPaint& paint) {
    uint32_t flags = 0;
    if (paint.isVerticalText()) {
        flags |= kVertical_Flag;
    }
    if (paint.isEmbeddedBitmapText()) {
        flags |= kEmbeddedBitmaps_Flag;
    }
    if (paint.getFlags() & SkPaint::kGenA8FromLCD_Flag) {
        flags |= kGenA8FromLCD_Flag;
    }
    if (paint.isFakeBoldText()) {
        flags |= kEmbolden_Flag;
    }

    if (SkPaint::kFull_Hinting == paint.getHinting()) {
        flags |= kEnableByteCodeHints_Flag;
    }
    if (paint.isAutohinted()) {
        flags |= kEnableAutoHints_Flag;
    }
    if (paint.isSubpixelText() || paint.isLinearText()) {
        // this is our default
    } else {
        flags |= kUseNonlinearMetrics_Flag;
    }

    MaskType maskType = SkFont::kBW_MaskType;
    if (paint.isAntiAlias()) {
        maskType = paint.isLCDRenderText() ? kLCD_MaskType : kA8_MaskType;
    }

    return Make(sk_ref_sp(paint.getTypeface()), paint.getTextSize(), paint.getTextScaleX(),
                paint.getTextSkewX(), maskType, flags);
}
开发者ID:C-Tillion,项目名称:skia,代码行数:35,代码来源:SkFont.cpp

示例12: switch

int cPath::NextStep(int *px,int *py,int *cx,int *cy)
{
	int move=CONTINUE;

	switch(dir)
	{
		case D_N:	(*py)-=STEP_LENGTH;						break;
		case D_S:	(*py)+=STEP_LENGTH;						break;
		case D_E:	(*px)+=STEP_LENGTH;						break;
		case D_O:	(*px)-=STEP_LENGTH;						break;
		case D_NE:(*py)-=STEP_LENGTH; (*px)+=STEP_LENGTH; break;
		case D_NO:(*py)-=STEP_LENGTH; (*px)-=STEP_LENGTH; break;
		case D_SE:(*py)+=STEP_LENGTH; (*px)+=STEP_LENGTH; break;
		case D_SO:(*py)+=STEP_LENGTH; (*px)-=STEP_LENGTH; break;
	}

	//Calculate next cell
	if( (((*px)%32)==0) && (((*py)%32)==0))
	{
		x = (*px)>>5; *cx = x;
		y = (*py)>>5; *cy = y;

		if((nxf==-1) && (nyf==-1))
		{
			move=NextCell();
		}
		else//if((nxf>=0) || (nyf>=0))
		{
			AStar->EndPathfinder();
			delete AStar;
			AStar = NULL;
			Make(world,*cx,*cy,nxf,nyf);
			//move=CONTINUE;
		}
	}
开发者ID:marcelgozalbo,项目名称:MVJ2D,代码行数:35,代码来源:cPath.cpp

示例13: rde_ot_intern2

long int
rde_ot_intern2 (RDE_STATE p,
		const char* operator,
		Tcl_Obj* detail1,
		Tcl_Obj* detail2)
{
    long int id;
    Tcl_DString buf;

    TRACE (("rde_ot_intern2 (%p, '%s' %p = '%s', %p = '%s')", p, operator,
	    detail1, Tcl_GetString(detail1)
	    detail2, Tcl_GetString(detail2)));
    if (IsCached (p, detail1, &id)) {
	return id;
    }

    TRACE (("INTERNALIZE"));

    /* Create a list of operator + detail1 + detail2.
     * Using a DString.
     */

    Tcl_DStringInit (&buf);
    Tcl_DStringAppendElement (&buf, operator);
    Tcl_DStringAppendElement (&buf, Tcl_GetString (detail1));
    Tcl_DStringAppendElement (&buf, Tcl_GetString (detail2));

    id = Make (p, detail1, Tcl_DStringValue (&buf));

    Tcl_DStringFree (&buf);
    return id;
}
开发者ID:EchoOfSoul,项目名称:tcllib,代码行数:32,代码来源:ot.c

示例14: ASSERT_VALID

void CUniformResourceLocator::Copy( const CUniversalNamingConvention& source )
{
   ASSERT_VALID( this );

   Empty();

   ProtocolName = "file";
   MachineName  = source.ServerName;
   PathName     = source.ShareName;
   PathName    += "/";
   PathName    += source.PathName;

   /*
   ** Now go through PathName to make sure it has /'s instead of \'s
   */

   int location_of_slash = 0;

   while( location_of_slash < PathName.GetLength() )
   {
      if ( PathName[ location_of_slash ] == '\\' )
      {
         PathName.SetAt( location_of_slash, '/' );
      }

      location_of_slash++;
   }

   Make();
}
开发者ID:DimeSPb,项目名称:ecuExplorer,代码行数:30,代码来源:CURL.CPP

示例15: PERFD

uint64 PERFD (typePOS* POSITION, int n)
{
  int i;
  uint64 TOTAL = 0, TIME;
  typeMoveList LM[256], *lm;
  DrawBoard (POSITION);
  TIME = GetClock();
  Mobility (POSITION);
  if (IN_CHECK)
    lm = EvasionMoves (POSITION, LM, 0xffffffffffffffff);
  else
    {
      lm = CaptureMoves (POSITION, LM, POSITION->OccupiedBW);
      lm = OrdinaryMoves (POSITION, lm);
    }
  for (i = 0; i < lm - LM; i++)
    {
      Make (POSITION, LM[i].move);
      Mobility (POSITION);
      if (!ILLEGAL)
	{
	  printf ("%s ",Notate (LM[i].move, STRING1[POSITION->cpu]));
	  PERFT (POSITION, n - 1);
	  TOTAL += CNT[n - 1];
	}
      Undo (POSITION, LM[i].move);
    }
  printf ("TOTAL %lld  moves %ld  time: %lld us\n",
	  TOTAL, lm - LM, GetClock() - TIME);
  return TOTAL;
}
开发者ID:Censor,项目名称:Ivanhoe,代码行数:31,代码来源:perft.c


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