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


C++ PF函数代码示例

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


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

示例1: Shell_GetOemInfo

void Shell_GetOemInfo()
{
	memset(&g_OemInfo, 0, sizeof(OemInfo));
	Boot_ReadOemInfo(&g_OemInfo);
	PF(DL_MAIN, ("\tTestMode = %s.\n", g_OemInfo.m_isTestMode ? "TURE" : "FALSE"));
	PF(DL_MAIN, ("\tisDefaultPrintf = %s.\n", g_OemInfo.m_isDefaultPrintf ? "TURE" : "FALSE"));
}
开发者ID:SzAllen,项目名称:Iap2,代码行数:7,代码来源:Shell.c

示例2: MACH

void   Flow::CorrectFlow(FP T, FP p, FP ref_val, FixedValue fv) {
    FP res_p = 1.0, res_t = 1.0;
    int iter=0;
    if(fv == FV_MACH) {
       do {
           MACH(ref_val);
           t0 = T/TAU();
           p0 = p/PF();
           res_p = fabs((p0-p/PF())/p0);
           res_t = fabs((t0-T/TAU())/t0);
           Wg(ref_val*Asound());
           iter++;
         } while ((res_p > 0.0001 || res_t > 0.0001) && iter < 100);
       /*
       MACH(ref_val);
       t0 = T/TAU();
       p0 = p/PF();
       */
    } else if(fv == FV_VELOCITY) {
       do {
           MACH(ref_val/Asound());
           t0 = T/TAU();
           p0 = p/PF();
           res_p = fabs((p0-p/PF())/p0);
           res_t = fabs((t0-T/TAU())/t0);
           Wg(ref_val);
           iter++;
         } while ((res_p > 0.0001 || res_t > 0.0001) && iter < 100);
    }
}
开发者ID:yundantianchang,项目名称:OpenHyperFLOW2D,代码行数:30,代码来源:flow.cpp

示例3: parse_new_syntax

static void
parse_new_syntax(struct tokenlist *tl)
{

	vsb_printf(tl->sb, "Please change \"%.*s\" to \"return(%.*s)\".\n",
	    PF(tl->t), PF(tl->t));
	vcc_ErrWhere(tl, tl->t);
}
开发者ID:smallvil,项目名称:Cache-Terminator,代码行数:8,代码来源:vcc_action.c

示例4: vcc_ParseRoundRobinDirector

void
vcc_ParseRoundRobinDirector(struct vcc *tl)
{
	struct token *t_field, *t_be;
	int nelem;
	struct fld_spec *fs;
	const char *first;
	char *p;

	fs = vcc_FldSpec(tl, "!backend", NULL);

	Fc(tl, 0, "\nstatic const struct vrt_dir_round_robin_entry "
	    "vdrre_%.*s[] = {\n", PF(tl->t_dir));

	for (nelem = 0; tl->t->tok != '}'; nelem++) {	/* List of members */
		first = "";
		t_be = tl->t;
		vcc_ResetFldSpec(fs);

		SkipToken(tl, '{');
		Fc(tl, 0, "\t{");

		while (tl->t->tok != '}') {	/* Member fields */
			vcc_IsField(tl, &t_field, fs);
			ERRCHK(tl);
			if (vcc_IdIs(t_field, "backend")) {
				vcc_ParseBackendHost(tl, nelem, &p);
				ERRCHK(tl);
				AN(p);
				Fc(tl, 0, "%s .host = VGC_backend_%s",
				    first, p);
			} else {
				ErrInternal(tl);
			}
			first = ", ";
		}
		vcc_FieldsOk(tl, fs);
		if (tl->err) {
			VSB_printf(tl->sb,
			    "\nIn member host specification starting at:\n");
			vcc_ErrWhere(tl, t_be);
			return;
		}
		Fc(tl, 0, " },\n");
		vcc_NextToken(tl);
	}
	Fc(tl, 0, "};\n");
	Fc(tl, 0,
	    "\nstatic const struct vrt_dir_round_robin vgc_dir_priv_%.*s = {\n",
	    PF(tl->t_dir));
	Fc(tl, 0, "\t.name = \"%.*s\",\n", PF(tl->t_dir));
	Fc(tl, 0, "\t.nmember = %d,\n", nelem);
	Fc(tl, 0, "\t.members = vdrre_%.*s,\n", PF(tl->t_dir));
	Fc(tl, 0, "};\n");
}
开发者ID:BabyOnlineSG,项目名称:pkg-varnish,代码行数:55,代码来源:vcc_dir_round_robin.c

示例5: vcc_Function

static void
vcc_Function(struct vcc *tl)
{
	int m, i;

	vcc_NextToken(tl);
	ExpectErr(tl, ID);

	m = IsMethod(tl->t);
	if (m != -1) {
		assert(m < VCL_MET_MAX);
		tl->fb = tl->fm[m];
		if (tl->mprocs[m] == NULL) {
			(void)vcc_AddDef(tl, tl->t, SYM_SUB);
			vcc_AddRef(tl, tl->t, SYM_SUB);
			tl->mprocs[m] = vcc_AddProc(tl, tl->t);
		}
		tl->curproc = tl->mprocs[m];
		Fb(tl, 1, "  /* ... from ");
		vcc_Coord(tl, tl->fb, NULL);
		Fb(tl, 0, " */\n");
	} else {
		tl->fb = tl->fc;
		i = vcc_AddDef(tl, tl->t, SYM_SUB);
		if (i > 1) {
			VSB_printf(tl->sb,
			    "Function %.*s redefined\n", PF(tl->t));
			vcc_ErrWhere(tl, tl->t);
			return;
		}
		tl->curproc = vcc_AddProc(tl, tl->t);
		Fh(tl, 0, "static int VGC_function_%.*s (struct sess *sp);\n",
		    PF(tl->t));
		Fc(tl, 1, "\nstatic int\n");
		Fc(tl, 1, "VGC_function_%.*s (struct sess *sp)\n", PF(tl->t));
	}
	vcc_NextToken(tl);
	tl->indent += INDENT;
	Fb(tl, 1, "{\n");
	L(tl, vcc_Compound(tl));
	if (m == -1) {
		/*
		 * non-method subroutines must have an explicit non-action
		 * return in case they just fall through the bottom.
		 */
		Fb(tl, 1, "  return(0);\n");
	}
	Fb(tl, 1, "}\n");
	tl->indent -= INDENT;
	tl->fb = NULL;
	tl->curproc = NULL;
}
开发者ID:ambernetas,项目名称:varnish-cache,代码行数:52,代码来源:vcc_parse.c

示例6: vxp_expr_regex

static void
vxp_expr_regex(struct vxp *vxp, struct vex_rhs **prhs)
{
	const char *errptr;
	int erroff;

	/* XXX: Caseless option */

	AN(prhs);
	AZ(*prhs);
	if (vxp->t->tok != VAL) {
		VSB_printf(vxp->sb, "Expected regular expression got '%.*s' ",
		    PF(vxp->t));
		vxp_ErrWhere(vxp, vxp->t, -1);
		return;
	}
	AN(vxp->t->dec);
	ALLOC_OBJ(*prhs, VEX_RHS_MAGIC);
	AN(*prhs);
	(*prhs)->type = VEX_REGEX;
	(*prhs)->val_string = strdup(vxp->t->dec);
	(*prhs)->val_regex = VRE_compile(vxp->t->dec, vxp->vre_options,
	    &errptr, &erroff);
	if ((*prhs)->val_regex == NULL) {
		AN(errptr);
		VSB_printf(vxp->sb, "Regular expression error: %s ", errptr);
		vxp_ErrWhere(vxp, vxp->t, erroff);
		return;
	}
	vxp_NextToken(vxp);
}
开发者ID:Matt8109,项目名称:Varnish-Cache,代码行数:31,代码来源:vxp_parse.c

示例7: PF

FP Flow::Pg(FP NewPg) {
    FP TmpPI;
    if(NewPg >= P0()) return Pg();
    TmpPI = NewPg/P0();
    PF(TmpPI);
    return Pg();
}
开发者ID:yundantianchang,项目名称:OpenHyperFLOW2D,代码行数:7,代码来源:flow.cpp

示例8: List_AddTail

List* List_AddTail(List* pHead, List* pNode)
{
	List* pListNode = pHead;

	Assert(pNode);
	
	pNode->m_pNext = Null;
	if(pHead == Null)
	{
		pNode->m_pPre = Null;
		pHead = pNode;
		goto END;
	}

	//Get the tail node
	while(pListNode->m_pNext)
	{
		pListNode = pListNode->m_pNext;
		Assert(pListNode != pNode);
	}

	pListNode->m_pNext = pNode;
	
	pNode->m_pPre = pListNode;
END:
	PF(DL_LISTEX, ("List_AddTail(), count=%d\n", List_Count(pHead)));
	return pHead;
}
开发者ID:SzAllen,项目名称:Arch,代码行数:28,代码来源:List.c

示例9: ListFree

PRIVATE
void
ListFree( void * unit )
{
   int done = FALSE;

   LIST_UNIT * lu;

   ALLOC_UNIT * t   = NULL;
   ALLOC_UNIT * tbl = NULL;

   WAIT_FOR_LOCK( LIST_MUTEX );

   for( t = GLOBAL_ALLOC_TABLE; t; t = (ALLOC_UNIT *)tbl -> prev )
      tbl = t;

   if( !tbl )
   {
      DBG(PF( "Error freeing list structure.\n" ));
      RELEASE_LOCK( LIST_MUTEX );
      return;
   }

   lu = (LIST_UNIT *)( (int) unit - sizeof( int ) );

   if( lu -> check != ALLOC_USED_FLAG )
   {
      ERROR( "Free of a corrupt list node from allocation table." );
      RELEASE_LOCK( LIST_MUTEX );
      return;
   }

   do
   {
      if ( (unit >= tbl -> min) && (unit < tbl -> max) )
      {
         tbl -> avail++;

         lu -> check = ALLOC_FREE_FLAG;

         lu -> ptr_a = NULL;
         lu -> ptr_b = NULL;
         lu -> ptr_c = NULL;

         done = TRUE;

         break;
      }
      else
      {
         tbl = (ALLOC_UNIT *)tbl -> next;
      }

   } while( tbl && !done );

   if ( !done )
      ERROR( "Couldn't find list in allocation table\n" );

   RELEASE_LOCK( LIST_MUTEX );
}
开发者ID:FreeFalcon,项目名称:freefalcon-central,代码行数:60,代码来源:lists.c

示例10: PF

void CCopyBlock::BuildBlockTagsList(char* ModelClass, char* BlockName, BOOL FromDatalib, CSVector& List)
  {
  int Cnt = 0;
  List.SetSize(16);
  Strng Section;
  Section.Set("%s(%s)", BlockName, ModelClass);
  char Buff[16384];
  CProfINIFile PF(FromDatalib ? CfgFiles() : PrjFiles(), (char*)CopyBlkFileName);
  CheckCopyBlockVer(PF);
  DWORD dw = PF.RdSection(Section(), Buff, sizeof(Buff));
  ASSERT(dw<sizeof(Buff)-2); //section too large!!!
  char* p = Buff;
  while (p[0])
    {
    int len = strlen(p);
    char* Nextp = p;
    Nextp += (len + 1);
    char* pp = strchr(p, '=');
    if (pp)
      {
      if (Cnt>=List.GetSize())
        List.SetSize(List.GetSize()+8);
      pp[0] = 0;
      char* pValue = &pp[1];
      char* ppp = strchr(p, '.');
      if (ppp)
        List[Cnt].Set("x%s (%s)", ppp, pValue);
      else
        List[Cnt].Set("%s (%s)", p, pValue);
      Cnt++;
      }
    p = Nextp;
    }
  List.SetSize(Cnt);
  }
开发者ID:abcweizhuo,项目名称:Test3,代码行数:35,代码来源:COPYBLK.CPP

示例11: Shell_GetTempPwdEmail

void Shell_GetTempPwdEmail(uint8_t *seed)
{
	uint8 buff[SECTOR_SIZE] = {0};
	
	PwdMgr_GetTempPwdEmail(buff, seed);

	PF(DL_MAIN, ("Email = %s; Pwd=%s; isTempPwd=%d.\n", buff, &buff[256], g_pNvd->m_isTempPsw));		
}
开发者ID:SzAllen,项目名称:Iap2,代码行数:8,代码来源:Shell.c

示例12: vcc_ParseBackend

void
vcc_ParseBackend(struct vcc *tl)
{
	struct token *t_first, *t_be;
	struct symbol *sym;
	char vgcname[MAX_BACKEND_NAME + 20];

	t_first = tl->t;
	vcc_NextToken(tl);		/* ID: backend */

	vcc_ExpectCid(tl);		/* ID: name */
	ERRCHK(tl);

	if (tl->t->e - tl->t->b > MAX_BACKEND_NAME) {
		VSB_printf(tl->sb,
		    "Name of %.*s too long (max %d, is %zu):\n",
		    PF(t_first), MAX_BACKEND_NAME,
		    (size_t)(tl->t->e - tl->t->b));
		vcc_ErrWhere(tl, tl->t);
		return;
	}

	t_be = tl->t;
	vcc_NextToken(tl);

	sprintf(vgcname, "vgc_backend_%.*s", PF(t_be));
	Fh(tl, 0, "\nstatic struct director *%s;\n", vgcname);

	sym = VCC_HandleSymbol(tl, t_be, BACKEND, "%s", vgcname);
	ERRCHK(tl);

	vcc_ParseHostDef(tl, t_be, vgcname);
	ERRCHK(tl);

	if (tl->err) {
		VSB_printf(tl->sb,
		    "\nIn %.*s specification starting at:\n", PF(t_first));
		vcc_ErrWhere(tl, t_first);
		return;
	}

	if (tl->default_director == NULL || vcc_IdIs(t_be, "default")) {
		tl->default_director = sym->rname;
		tl->t_default_director = t_be;
	}
}
开发者ID:kivikakk,项目名称:varnish-cache,代码行数:46,代码来源:vcc_backend.c

示例13: Shell_BleEnable

void Shell_BleEnable(Bool isEnable)
{
	g_pBle->m_isActiveNew = isEnable;
	
	//Nvd_Write(g_pNvd);
	
	PF(DL_MAIN, ("isBleEnable = %d\n", g_pBle->m_isActiveNew));	
}
开发者ID:SzAllen,项目名称:Iap2,代码行数:8,代码来源:Shell.c

示例14: UpdateData

void CFindTagDlg::OnFind() 
  {
  UpdateData(TRUE);
  bPrevAutoAccess = m_AutoAccess;
  gs_pPrj->m_bGrfPromptForZoom = m_ZoomPrompt;
  gs_pPrj->m_bGrfMoveCursor = m_MoveCursor;
  gs_pPrj->m_bGrfRegExpOn = m_RegExpOn;
  gs_pPrj->bDoGrfAutoAccess = m_AutoAccess;
  BOOL bChanged = 0;
  CString sCurSel;
  int nIndex = m_TagCombo.GetCurSel();
  if (nIndex==CB_ERR)
    {
    m_TagCombo.GetWindowText(sCurSel);
    if (sCurSel.GetLength()>0 && m_TagCombo.FindStringExact(-1, (const char*)sCurSel)==CB_ERR)
      {
      bChanged = 1;
      m_TagCombo.InsertString(0, (const char*)sCurSel);
      //m_TagCombo.SetCurSel(0);
      }
    }
  else
    {
    m_TagCombo.GetLBText(nIndex, sCurSel);
    if (nIndex>0)
      {
      bChanged = 1;
      m_TagCombo.DeleteString(nIndex);
      m_TagCombo.InsertString(0, (const char*)sCurSel);
      //m_TagCombo.SetCurSel(0);
      }
    }
  sFindTag = sCurSel;

  if (bChanged && sFindTag.GetLength()>0)
    {//list changed, save it...
    char Buff[8192];
    CProfINIFile PF(PrjIniFile());
    int Pos = 0;
    for (int i=0; i<16 && i<m_TagCombo.GetCount(); i++)
      {
      CString FindTxt;
      m_TagCombo.GetLBText(i, FindTxt);
      int Len = FindTxt.GetLength();
      if (Len>0)
        {
        sprintf(&Buff[Pos], "Find_%02d=%s", i, (const char*)FindTxt);
        Pos = Pos + 8 + Len;
        Buff[Pos++] = 0;
        }
      }
    Buff[Pos++] = 0;
    Buff[Pos++] = 0;
    PF.WrSection("FindTags", Buff);
    }
  bTrendFind = 0;
  EndDialog(IDOK);
  }
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:58,代码来源:CHNGTAG.CPP

示例15: vcc_ParseDirector

void
vcc_ParseDirector(struct vcc *tl)
{
	struct token *t_first;
	int isfirst;

	t_first = tl->t;
	vcc_NextToken(tl);		/* ID: director | backend */

	vcc_ExpectCid(tl);		/* ID: name */
	ERRCHK(tl);
	if (tl->t->e - tl->t->b > 64) {
		VSB_printf(tl->sb,
		    "Name of %.*s too long (max 64, is %zu):\n",
		    PF(t_first), (size_t)(tl->t->e - tl->t->b));
		vcc_ErrWhere(tl, tl->t);
		return;
	}
	tl->t_dir = tl->t;
	vcc_NextToken(tl);


	isfirst = tl->ndirector;
	if (vcc_IdIs(t_first, "backend")) {
		vcc_ParseSimpleDirector(tl);
	} else {
		VSB_printf(tl->sb,
		    "\ndirectors are now in VMOD.directors\n");
		vcc_ErrWhere(tl, t_first);
		return;
	}
	if (tl->err) {
		VSB_printf(tl->sb,
		    "\nIn %.*s specification starting at:\n", PF(t_first));
		vcc_ErrWhere(tl, t_first);
		return;
	}

	if (isfirst == 1 || vcc_IdIs(tl->t_dir, "default")) {
		tl->defaultdir = tl->ndirector - 1;
		tl->t_defaultdir = tl->t_dir;
	}

	tl->t_dir = NULL;
}
开发者ID:conmame,项目名称:Varnish-Cache,代码行数:45,代码来源:vcc_backend.c


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