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


C++ DPrint函数代码示例

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


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

示例1: DPrint

//=================================================================================================
void DAllocTracer::reportLeaks()
{
	if(m_NbAllocs <= 1)
		DPrint("%i allocation performed.", m_NbAllocs);
	else
		DPrint("%i allocations performed.", m_NbAllocs);

	if(m_AllocMap.size())
	{
		u32 size = 0;
		
		for(std::map<void*, DS_Allocation>::iterator it = m_AllocMap.begin(); it != m_AllocMap.end(); it++)
		{
			DWarning("%s(%i): Memory leak of %i bytes found.", it->second.pFile, it->second.line, it->second.size);

			size += it->second.size;
			free(it->first);
		}
		
		if(m_AllocMap.size() == 1)
			DWarning("%i block of memory has not been freed (%i bytes).", m_AllocMap.size(), size);
		else
			DWarning("%i blocks of memory have not been freed (%i bytes).", m_AllocMap.size(), size);
	}
	else
		DPrint("No memory leak found.");
}
开发者ID:SeungMinChoi,项目名称:ejcharpenay,代码行数:28,代码来源:DAlloc.cpp

示例2: MGroupGetFSGroups

/*
 * HvB: Get all GroupNames that have a Fairshare target set
*/
int MGroupGetFSGroups()
{
    int           gindex;
    int		fsindex = 0;
    mgcred_t	*G;

    const char *FName = "MGroupGetFSGroups";

    DBG(5,fFS) DPrint("%s\n", FName);

    for (gindex = 0; gindex < MAX_MGROUP + MAX_MHBUF; gindex++)
    {
        G = &MGroup[gindex];

        if ((G == NULL) || (G->Name[0] == '\0') || (G->Name[0] == '\1'))
            continue;

        if (!strcmp(G->Name,ALL) || !strcmp(G->Name,"NOGROUP"))
            continue;

        if ( G->F.FSTarget > 0 )
        {
            DBG(5,fFS) DPrint("Found FSGroup %s(%f) with key %d \n", G->Name, G->F.FSTarget, G->Key);
            FSGroupKeys[fsindex++] = G->Key;
        }
    }
} /* MGroupGetFSGroups */
开发者ID:hocks,项目名称:TSCC,代码行数:30,代码来源:MGroup.c

示例3: MCPStoreSRList

int MCPStoreSRList(

  mckpt_t *CP,  /* I (utilized) */
  sres_t  *SRL) /* I */

  {
  int     srindex;
  sres_t *SR;

  const char *FName = "MCPStoreSRList";

  DBG(3,fCKPT) DPrint("%s(CP,SRL)\n",
    FName);

  if ((CP == NULL) || (SRL == NULL))
    return(FAILURE);

  for (srindex = 0;srindex < MAX_MSRES;srindex++)
    {
    SR = &SRes[srindex];

    if ((SR->TaskCount == 0) &&
        (SR->HostExpression[0] == '\0'))
      {
      DBG(9,fCKPT) DPrint("INFO:     skipping empty SR[%02d]\n",
        srindex);

      continue;
      }

    DBG(4,fCKPT) DPrint("INFO:     checkpointing SR '%s'\n",
      SR->Name);

/*
    MSRToString(SR,tmpLine);

    MCPStoreObj(CP->fp,mcpSRes,SR->Name,tmpLine);
*/

    /* checkpoint statistics and override values */

    /* FORMAT:      TYPE NAME TIME IDTME TOTME TCT ACCT STAR END */

    fprintf(CP->fp,"%-9s %20s %9ld %6.2f %6.2f %3d %14s %9ld %9ld\n",
      MCPType[mcpSRes],
      SR->Name,
      MSched.Time,
      SR->IdleTime,
      SR->TotalTime,
      OSRes[srindex].TaskCount,
      (OSRes[srindex].A != NULL) ? OSRes[srindex].A->Name : NONE,
      OSRes[srindex].StartTime,
      OSRes[srindex].EndTime);
    }  /* END for (srindex) */

  fflush(CP->fp);

  return(FAILURE);
  }  /* END MCPStoreSResList() */
开发者ID:ebasheer,项目名称:maui-scheduler,代码行数:59,代码来源:MCP.c

示例4: MGroupSecondary

/* HvB */
int MGroupSecondary(
  char *UName,    /* I */
  mjob_t  *J)     /* O */

  {
  int		i; 
  int		gindex;

  struct	group *sec_grp;

  const char *FName = "MGroupSecondary";

  DBG(5,fFS) DPrint("%s(%s)\n",
    FName,
    (UName != NULL) ? UName : "NULL"); 
  
  /*
    MGroupGetFSGroups();
  */

  i=0;
  while ( FSGroupKeys[i] != -1 )
    {
    DBG(5,fFS) DPrint("Checking if user(%s)  is member of group(%s)\n", UName, MGroup[FSGroupKeys[i]].Name);
    if ( (sec_grp = getgrnam(MGroup[FSGroupKeys[i]].Name)) != NULL )
      {
      gindex=0;
      while ( sec_grp->gr_mem[gindex] )
        {
        if ( !strcmp(sec_grp->gr_mem[gindex], UName) )
          {
          DBG(5,fFS) DPrint("Setting Group credentials for user %s to %s\n", UName, sec_grp->gr_name);
          if ( MGroupAdd(sec_grp->gr_name, &J->Cred.G) == FAILURE )
            {
            DBG(1,fPBS) DPrint("ERROR:    cannot add secondary group for job %s (Name: %s)\n",
            J->Name,
            sec_grp->gr_name);

            return(FAILURE);
            }
          else
            {
                return(SUCCESS);
            }
          } /* if !strcmp */
        else
          {
          gindex++;
          }
        } /* while sec_grp */
      } /* if sec_grp */ 

    i++;

    } /* while FSGroupKeys[i] */

  return(SUCCESS);

  } /* MGroupSecondary */
开发者ID:ebasheer,项目名称:maui-scheduler,代码行数:60,代码来源:MGroup.c

示例5: MAcctLoadCP

int MAcctLoadCP(

    mgcred_t *AS, char *Buf)

{
    char tmpHeader[MAX_MNAME];
    char AName[MAX_MNAME];

    char *ptr;

    mgcred_t *A;

    long CkTime;

    mxml_t *E = NULL;

    const char *FName = "MAcctLoadCP";

    DBG(4, fCKPT) DPrint("%s(AS,%s)\n", FName, (Buf != NULL) ? Buf : "NULL");

    if (Buf == NULL) return (FAILURE);

    /* FORMAT:  <HEADER> <GID> <CKTIME> <GSTRING> */

    /* load CP header */

    sscanf(Buf, "%s %s %ld", tmpHeader, AName, &CkTime);

    if (((long)MSched.Time - CkTime) > MCP.CPExpirationTime) return (SUCCESS);

    if (AS == NULL) {
        if (MAcctAdd(AName, &A) != SUCCESS) {
            DBG(5, fCKPT)
            DPrint("ALERT:    cannot load CP account '%s'\n", AName);

            return (FAILURE);
        }
    } else {
        A = AS;
    }

    if ((ptr = strchr(Buf, '<')) == NULL) {
        return (FAILURE);
    }

    MXMLFromString(&E, ptr, NULL, NULL);

    MOFromXML((void *)A, mxoAcct, E);

    MXMLDestroyE(&E);

    return (SUCCESS);
} /* END MAcctLoadCP() */
开发者ID:TempleHPC,项目名称:maui-scheduler,代码行数:53,代码来源:MAcct.c

示例6: UIShowGrid

int UIShowGrid(

  char *RBuffer,  /* I */
  char *Buffer,   /* O */
  int   FLAGS,    /* I */
  char *Auth,     /* I */
  long *BufSize)  /* I */

  {
  int  sindex;
  char GStat[MAX_MNAME];

  const char *FName = "UIShowGrid";

  DBG(3,fUI) DPrint("%s(RBuffer,Buffer,%d,%s,BufSize)\n",
    FName,
    FLAGS,
    Auth);

  MUSScanF(RBuffer,"%x%s",
    sizeof(GStat),
    GStat);

  /* determine statistics type requested */

  for (sindex = 0;MStatType[sindex] != 0;sindex++)
    {
    if (!strcasecmp(MStatType[sindex],GStat))
      break;
    }  /* END for (sindex) */

  if (MStatType[sindex] == NULL)
    {
    DBG(2,fUI) DPrint("INFO:     invalid stat type '%s' requested\n",
      GStat);

    sprintf(Buffer,"ERROR:  invalid statistics type requested\n");

    strcat(Buffer,"\nvalid statistics types:\n");

    for (sindex = 0;MStatType[sindex] != 0;sindex++)
      {
      strcat(Buffer,MStatType[sindex]);
      strcat(Buffer,"\n");
      }  /* END for (sindex) */

    return(FAILURE);
    }  /* END if (MStatType[sindex] == NULL) */

  MStatBuildGrid(sindex,Buffer,0);

  return(SUCCESS);
  }  /* END UIShowGrid() */
开发者ID:ebasheer,项目名称:maui-scheduler,代码行数:53,代码来源:OUserI.c

示例7: DPrint

		void IdStorage::Release(uint16_t id)
		{
			auto storageIdx = (id - ref) / 8;
			if (storageIdx < storageSize)
			{
				byte bitpos = ((id - ref) % 8);
				storage[storageIdx] -= (1 << (bitpos));
			}
#if defined DEBUG && defined DEBUG_ASSERT
			else
			{
				DPrint("Invalid storageIdx:"); DPrint(storageIdx); DPrint(" >= "); DPrintln(storageSize);
			}
#endif
		}
开发者ID:devel0,项目名称:SearchAThing.Arduino.Utils,代码行数:15,代码来源:IdStorage.cpp

示例8: DPrint

//
// Register container type
//
bool XFileSystem::RegisterContainer
    ( 
    XFSContainer *pContainer
    )
{
    m_pContainers[ m_nNumContainers++ ] = pContainer;

    DPrint( "XFileSystem::RegisterContainer : ext:\"" );
    DPrint( pContainer->m_pContainerExt );
    DPrint( "\", desc:\"" );
    DPrint( pContainer->m_pDescription );
    DPrint( "\" ...ok\n" );

    return true;
}
开发者ID:coderand,项目名称:oclf,代码行数:18,代码来源:xfs_exts.cpp

示例9: MCfgGetDVal

int MCfgGetDVal(

  char    *Buf,
  char   **CurPtr,
  const char *Parm,
  char    *IndexName,
  int     *Index,
  double  *Value,
  char   **SymTable)

  {
  char  ValLine[MAX_MLINE];
  char *ptr;

  int   rc;

  const char *FName = "MCfgGetDVal";

  DBG(7,fCONFIG) DPrint("%s(Buf,CurPtr,%s,%s,Index,Value,SymTable)\n",
    FName,
    Parm,
    (IndexName != NULL) ? IndexName : "NULL");

  if ((Buf == NULL) || (Value == NULL))
    return(FAILURE);

  ptr = Buf;

  if (CurPtr != NULL)
    ptr = MAX(ptr,*CurPtr);

  rc = MCfgGetVal(&ptr,Parm,IndexName,Index,ValLine,sizeof(ValLine),SymTable);

  if (CurPtr != NULL)
    *CurPtr = ptr;

  if (rc == FAILURE)
    return(FAILURE);

  *Value = strtod(ValLine,NULL);

  DBG(4,fCONFIG) DPrint("INFO:     %s[%d] set to %lf\n",
    Parm,
    (Index != NULL) ? *Index : 0,
    *Value);

  return(SUCCESS);
  }  /* END MCfgGetDVal() */
开发者ID:BradleyMorgan,项目名称:maui,代码行数:48,代码来源:MConfig.c

示例10: MTraceGetResourceVersion

int MTraceGetResourceVersion(

  char *Buffer,  /* I */
  int  *Version) /* O */

  {
  char *ptr;
  char  Line[MAX_MLINE];

  int   tmpI;

  const char *FName = "MTraceGetResourceVersion";

  DBG(3,fSIM) DPrint("%s(Buffer,Version)\n",
    FName);

  if ((Buffer == NULL) || (Version == NULL))
    {
    return(FAILURE);
    }

  if ((ptr = strstr(Buffer,TRACE_RESOURCE_VERSION_MARKER)) == NULL)
    {
    DBG(1,fSIM) DPrint("ALERT:    cannot locate trace version marker\n");

    *Version = -1;

    return(FAILURE);
    }

  ptr += (strlen(TRACE_RESOURCE_VERSION_MARKER) + 1);

  sscanf(ptr,"%64s",
    Line);

  tmpI = (int)strtol(Line,NULL,0);

  if (tmpI < 100)
    {
    *Version = -1;

    return(FAILURE);
    }

  *Version = tmpI;

  return(SUCCESS);
  }  /* END MTraceGetResourceVersion() */
开发者ID:BradleyMorgan,项目名称:maui,代码行数:48,代码来源:MTrace.c

示例11: MLocalCheckFairnessPolicy

int MLocalCheckFairnessPolicy(

    mjob_t *J, long StartTime, char *Message)

{
    const char *FName = "MLocalCheckFairnessPolicy";

    DBG(6, fSCHED)
    DPrint("%s(%s,%ld,Message)\n", FName, (J != NULL) ? J->Name : "NULL",
           (unsigned long)StartTime);

    /*
      if (ContribJobLengthFairnessPolicy(J,StartTime,Message) == FAILURE)
        {
        return(FAILURE);
        }
    */

    /*
      if (ContribASCBackgroundJobPolicy(J,StartTime,Message) == FAILURE)
        {
        return(FAILURE);
        }
    */

    /* all local policies passed */

    return (SUCCESS);
} /* END MLocalFairnessPolicy() */
开发者ID:TempleHPC,项目名称:maui-scheduler,代码行数:29,代码来源:MLocal.c

示例12: MLocalQueueScheduleIJobs

int MLocalQueueScheduleIJobs(

    int *Q, mpar_t *P)

{
    mjob_t *J;

    int jindex;

    if ((Q == NULL) || (P == NULL)) {
        return (FAILURE);
    }

    /* NOTE:  insert call to scheduling algorithm here */

    for (jindex = 0; Q[jindex] != -1; jindex++) {
        J = MJob[Q[jindex]];

        /* NYI */

        DBG(7, fSCHED) DPrint("INFO:     checking job '%s'\n", J->Name);
    } /* END for (jindex) */

    return (FAILURE);
} /* END MLocalQueueScheduleIJobs() */
开发者ID:TempleHPC,项目名称:maui-scheduler,代码行数:25,代码来源:MLocal.c

示例13: MCPLoadSys

int MCPLoadSys(

  mckpt_t  *CP,    /* I */
  char     *Line,  /* I */
  msched_t *S)     /* I (modified) */

  {
  char   TempName[MAX_MNAME];
  char   tmpLine[MAX_MLINE];
  long   CkTime;

  char  *ptr;

  const char *FName = "MCPLoadSys";

  DBG(4,fCKPT) DPrint("%s(CP,Line,S)\n",
    FName);

  /* FORMAT:   TY TM Name DATA */

  sscanf(Line,"%s %ld %s",
    TempName,
    &CkTime,
    tmpLine);

  if ((ptr = strchr(Line,'<')) == NULL)
    {
    return(FAILURE);
    }

  MOFromString((void *)S,mxoSys,ptr);

  return(SUCCESS);
  }  /* END MCPLoadSys() */
开发者ID:ebasheer,项目名称:maui-scheduler,代码行数:34,代码来源:MCP.c

示例14: MCPLoadSched

int MCPLoadSched(
 
  mckpt_t  *CP,
  char     *Line,
  msched_t *S)
 
  {
  char   TempName[MAX_MNAME];
  char   tmpLine[MAX_MLINE];
  long   CkTime;

  char  *ptr;
 
  const char *FName = "MCPLoadSched";
 
  DBG(4,fCKPT) DPrint("%s(CP,Line,S)\n",
    FName);
 
  /* FORMAT:   TY TM Name DATA */ 
 
  sscanf(Line,"%s %ld %s",
    TempName,
    &CkTime,
    tmpLine);

  if ((ptr = strchr(Line,'<')) == NULL)
    {
    return(FAILURE);
    }
 
  MSchedFromString(S,ptr);
 
  return(SUCCESS);
  }  /* END MCPLoadSched() */
开发者ID:ebasheer,项目名称:maui-scheduler,代码行数:34,代码来源:MCP.c

示例15: ContribAussieCheckReq

int ContribAussieCheckReq(

  job_t  *J,
  node_t *N,
  long    StartTime)

  {
  int    rindex;

  long   Overlap;

  res_t *R;

  DBG(4,fCONFIG) DPrint("ContribAussieCheckReq(%s,%s)\n",
    J->Name,
    N->Name);

  for (rindex = 0;rindex < MAX_RESERVATION;rindex++)
    {
    R = N->R[rindex];

    if (R == (res_t *)MAX_RES_DEPTH)
      continue;

    if (R == NULL)
      break;

    Overlap =
      MIN(R->EndTime,StartTime + J->SpecWCLimit[0]) -
      MAX(R->StartTime,StartTime);

    if (Overlap <= 0)
      {
      /* reservations do not overlap */

      continue;
      }

    if (R->J == NULL)
      {
      /* reservation is not a job reservation */

      continue;
      }

    if (((job_t *)R->J)->Cred.U != J->Cred.U)
      {
      /* users do not match */

      continue;
      }

    /* overlapping job reservation for same user found */

    return(FAILURE);
    }  /* END for (rindex) */

  return(SUCCESS);
  }  /* END ContribAussieCheckReq() */
开发者ID:BradleyMorgan,项目名称:maui,代码行数:59,代码来源:AussieCheckReq.c


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