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


C++ CHECK_PTR函数代码示例

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


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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例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


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