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

C++ CHECK_PTR函数代码示例

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

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



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

示例1: calloc

TypedList *new_TypedList( void )

{

  TypedList *result = ( TypedList * ) calloc( 1, sizeof( TypedList ) );
  CHECK_PTR(result);

  result->name = NULL; 
  result->type = NULL;
  result->n = -1;

  return result;

}
开发者ID:baltar,项目名称:spinpossible,代码行数:14,代码来源:memory.c


示例2: CHECK_PTR

bool SGFParser::exportSGFtoClipB(QString *str, Tree *tree)
{
	CHECK_PTR(tree);
	
	if (stream != NULL)
		delete stream;
	stream = new QTextStream(str, IO_WriteOnly);
	
	bool res = writeStream(tree);
	
	delete stream;
	stream = NULL;
	return res;
}
开发者ID:rd8,项目名称:qGo,代码行数:14,代码来源:sgfparser.cpp


示例3: boardHandler

StoneHandler::StoneHandler(BoardHandler *bh)
: boardHandler(bh)
{
	CHECK_PTR(boardHandler);
	
	stones = new QIntDict<Stone>(367);  // prime number larger than 361 (19*19)
	// TODO: Dynamic for different board size?
	stones->setAutoDelete(TRUE);
	
	groups = new QPtrList<Group>;
	groups->setAutoDelete(TRUE);
	
	workingOnNewMove = false;
}
开发者ID:rd8,项目名称:qGo,代码行数:14,代码来源:stonehandler.cpp


示例4: CHECK_PTR

void
SensorCard::displayNowHeader(Args& args)
{
	const char*	delimiter;

	delimiter = args.getDelimiter();
	CHECK_PTR(delimiter);

	printf("Chan. 1 Temperature now%s", delimiter);
	printf("Chan. 2 Temperature now%s", delimiter);
	printf("Irradiance now%s", delimiter);
	printf("Chan. 1 Value now%s", delimiter);
	printf("Chan. 2 Value now%s", delimiter);
}
开发者ID:gabn,项目名称:fslurp,代码行数:14,代码来源:sensor.cpp


示例5: xmp_files_close

bool xmp_files_close(XmpFilePtr xf, XmpCloseFileOptions options)
{
	CHECK_PTR(xf, false);
	RESET_ERROR;
	try {
		SXMPFiles *txf = (SXMPFiles*)xf;
		txf->CloseFile(options);
	}
	catch(const XMP_Error & e) {
		set_error(e);
		return false;
	}
	return true;
}
开发者ID:JanX2,项目名称:exempi,代码行数:14,代码来源:exempi.cpp


示例6: xmp_files_free

bool xmp_files_free(XmpFilePtr xf)
{
	CHECK_PTR(xf, false);
	RESET_ERROR;
	SXMPFiles *txf = (SXMPFiles*)xf;
	try {
		delete txf;
	}
	catch(const XMP_Error & e) {
		set_error(e);
		return false;
	}
	return true;
}
开发者ID:JanX2,项目名称:exempi,代码行数:14,代码来源:exempi.cpp


示例7: CHECK_PTR

QGCache::QGCache( int maxCost, uint size, KeyType kt, bool caseSensitive,
		  bool copyKeys )
{
    keytype = kt;
    lruList = new QCList;
    CHECK_PTR( lruList );
    lruList->setAutoDelete( TRUE );
    copyk   = ((keytype == AsciiKey) && copyKeys);
    dict    = new QCDict( size, kt, caseSensitive, FALSE );
    CHECK_PTR( dict );
    mCost   = maxCost;
    tCost   = 0;
#if defined(DEBUG)
    lruList->inserts	  = 0;
    lruList->insertCosts  = 0;
    lruList->insertMisses = 0;
    lruList->finds	  = 0;
    lruList->hits	  = 0;
    lruList->hitCosts	  = 0;
    lruList->dumps	  = 0;
    lruList->dumpCosts	  = 0;
#endif
}
开发者ID:kthxbyte,项目名称:QT2-Linaro,代码行数:23,代码来源:qgcache.cpp


示例8: xmp_files_open_new

XmpFilePtr xmp_files_open_new(const char *path, XmpOpenFileOptions options)
{
	CHECK_PTR(path, NULL);
	RESET_ERROR;
	SXMPFiles *txf = NULL;
	try {
		txf = new SXMPFiles(path, XMP_FT_UNKNOWN, options);
	}
	catch(const XMP_Error & e) {
		set_error(e);
	}

	return (XmpFilePtr)txf;
}
开发者ID:JanX2,项目名称:exempi,代码行数:14,代码来源:exempi.cpp


示例9: calloc

BfsHashEntry *new_BfsHashEntry( void )

{

  BfsHashEntry *result = ( BfsHashEntry * ) calloc( 1, sizeof( BfsHashEntry ) );
  CHECK_PTR(result);

  result->bfs_node = NULL;

  result->next = NULL;

  return result;

}
开发者ID:JackDanny,项目名称:cours-M2-IARF,代码行数:14,代码来源:memory.c


示例10: calloc

EasyTemplate *new_EasyTemplate( NormOperator *op )

{

  EasyTemplate *result = ( EasyTemplate * ) calloc( 1, sizeof( EasyTemplate ) );
  CHECK_PTR(result);

  result->op = op;

  result->prev = NULL;
  result->next = NULL;

  return result;

}
开发者ID:aeolus-project,项目名称:metis,代码行数:15,代码来源:memory.c


示例11: input_parser

/*******************************************************************************************
 * NAME :             input_parse
 *
 * DESCRIPTION :      Parses the input from a file of the cnf sat form.
 *
 * INPUTS :
 *      PARAMETERS :   
 *          FILE              *fp     file
 *          INPUT             *input  input
 *
 * OUTPUTS :
 *      RETURN : 1 on success, -1 on failure/error
 */
int input_parser(FILE *fp, INPUT *input)
{
  int i, file_size, *nbvar, *nbclauses, **data, *clause_lengths, *pos_val_sums, *neg_val_sums;
  char *line;

  // Finding the size of the file in bytes.
  file_size = get_file_size(fp);

  // Pass over comments.
  line = parse_comments(fp, file_size);

  nbvar = malloc(sizeof(int)); // ndicates variables will be from [-1, -nbvar] and [1, nbvar].
  CHECK_PTR(nbvar);
  *nbvar = 0;

  nbclauses = malloc(sizeof(int)); // indicates the number of rows (clauses), indicated by the number of zeros.
  CHECK_PTR(nbclauses);
  *nbclauses = 0;

  if (parse_cnf_header(line, nbvar, nbclauses) != 1) { return -1; }

  data = malloc(sizeof(int*) * (*nbclauses));
  CHECK_PTR(data);

  clause_lengths = malloc(sizeof(int) * (*nbclauses));
  CHECK_PTR(clause_lengths);

  pos_val_sums = malloc(sizeof(int) * ((*nbvar)));
  CHECK_PTR(pos_val_sums);

  neg_val_sums = malloc(sizeof(int) * ((*nbvar)));
  CHECK_PTR(neg_val_sums);

  // Load array with 0s.
  for (i = 0; i < *nbvar; i++)
  {
    pos_val_sums[i] = 0;
    neg_val_sums[i] = 0;
  }

  // Loops over all clauses. 
  if (parse_clauses(fp, file_size, data, nbclauses, clause_lengths, pos_val_sums, neg_val_sums) != 1) { return -1; }  

  // Load values into structs.
  input->data           = data;
  input->nbclauses      = *nbclauses; 
  input->nbvars         = *nbvar;
  input->clause_lengths = clause_lengths;
  input->pos_val_sums   = pos_val_sums;
  input->neg_val_sums   = neg_val_sums;

  free(nbvar);
  free(nbclauses);

  return 1;
}
开发者ID:N-Thomas,项目名称:sat,代码行数:69,代码来源:input.c


示例12: calloc

PlOperator *new_PlOperator( char *name )

{

  PlOperator *result = ( PlOperator * ) calloc( 1, sizeof( PlOperator ) );
  CHECK_PTR(result);

  if ( name ) {
    result->name = new_Token(strlen(name)+1);
    CHECK_PTR(result->name);
    strcpy(result->name, name);
  } else {
    result->name = NULL;
  }

  result->params = NULL;
  result->preconds = NULL;
  result->effects = NULL;
  result->number_of_real_params = 0;
  result->next = NULL;

  return result;

}
开发者ID:jotajota05,项目名称:AI_USB,代码行数:24,代码来源:memory.c


示例13: CHECK_PTR

QMenuData::QMenuData()
{
    actItem = -1;				// no active menu item
    mitems = new QMenuItemList;			// create list of menu items
    CHECK_PTR( mitems );
    mitems->setAutoDelete( TRUE );
    parentMenu = 0;				// assume top level
    isPopupMenu = FALSE;
    isMenuBar = FALSE;
    mouseBtDn = FALSE;
    badSize = TRUE;
    avoid_circularity = 0;
    actItemDown = FALSE;
    d = new QMenuDataData;
}
开发者ID:opieproject,项目名称:qte-opie,代码行数:15,代码来源:qmenudata.cpp


示例14: qDebug

void RS_Engine::start(bool autoplay)
{
    qDebug("start");
    ASSERT( !autoplay );

    CHECK_PTR( timer );
    if( timer->isActive() )
    {
        timer->stop();
    }

    new_block();
    updateUI();
    timer->start(1000);
}
开发者ID:MageCraft,项目名称:pyfreecell,代码行数:15,代码来源:rs_engine.cpp


示例15: xmp_files_check_file_format

XmpFileType xmp_files_check_file_format(const char *filePath)
{
	CHECK_PTR(filePath, XMP_FT_UNKNOWN);
	RESET_ERROR;

	XmpFileType file_type = XMP_FT_UNKNOWN;
	try {
		file_type = (XmpFileType)SXMPFiles::CheckFileFormat(filePath);	
	}
	catch(const XMP_Error & e) {
		set_error(e);
		return XMP_FT_UNKNOWN;
	}
	return file_type;
}
开发者ID:JanX2,项目名称:exempi,代码行数:15,代码来源:exempi.cpp


示例16: xmp_new

XmpPtr xmp_new(const char *buffer, size_t len)
{
	CHECK_PTR(buffer, NULL);
	RESET_ERROR;

	SXMPMeta *txmp;
	try {
		txmp = new SXMPMeta(buffer, len);
	}
	catch(const XMP_Error & e) {
		set_error(e);
		txmp = 0;
	}
	return (XmpPtr)txmp;
}
开发者ID:JanX2,项目名称:exempi,代码行数:15,代码来源:exempi.cpp


示例17: qDebug

/** Execute the bottomUp operator */
void INode::execBottomUp()
{
#ifdef DEBUGMSG
  qDebug("#*  INode::execBottomUp(%s)(%p): Start\n", (const char *) name(), this);
#endif
  if (analysis()->error()) {
    status(BU_ABORTED);
    return;
  }

  execState(BU);
  CHECK_PTR(this->sNode());
  if (sNode_)
    sNode_->execBottomUpOp(this);       //start BU
}
开发者ID:BackupTheBerlios,项目名称:geoaida,代码行数:16,代码来源:inode.cpp


示例18: Julia

void DrawView::changeToJulia()
  {
  if ( last_fract != FJulia )
    {
    last_fract = FJulia;
    if ( fract != NULL )
      {
      delete fract;
      }
    fract = new Julia();
    CHECK_PTR( fract );
    resetOnChange();
    param_1 = JULIA_X;
    param_2 = JULIA_Y;
    }
  }
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:16,代码来源:drawview.C


示例19: r3_route_createl

route * r3_route_createl(const char * path, int path_len) {
    route * info = zmalloc(sizeof(route));
    CHECK_PTR(info);
    info->path = (char*) path;
    info->path_len = path_len;
    info->request_method = 0; // can be (GET || POST)

    info->data = NULL;

    info->host = NULL; // required host name
    info->host_len = 0;

    info->remote_addr_pattern = NULL;
    info->remote_addr_pattern_len = 0;
    return info;
}
开发者ID:RickySu,项目名称:r3,代码行数:16,代码来源:node.c


示例20: Mandel

void DrawView::changeToMandel()
  {
  if ( last_fract != FMandel )
    {
    last_fract = FMandel;
    if ( fract != NULL )
      {
      delete fract;
      }
    fract = new Mandel();
    CHECK_PTR( fract );
    resetOnChange();
    param_1 = 0.0;
    param_2 = 0.0;
    }
  }
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:16,代码来源:drawview.C



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ CHECK_RC函数代码示例发布时间:2022-05-30
下一篇:
C++ CHECK_POINTER函数代码示例发布时间: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