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


C++ WARNMSG函数代码示例

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


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

示例1: load_slabdat_file

TbBool load_slabdat_file(struct SlabSet *slbset, long *scount)
{
  long total;
  unsigned char *buf;
  long fsize;
  long i,k,n;
  SYNCDBG(5,"Starting");
  fsize = 2;
  buf = load_data_file_to_buffer(&fsize, FGrp_StdData, "slabs.dat");
  if (buf == NULL)
    return false;
  i = 0;
  total = lword(&buf[i]);
  i += 2;
  // Validate total amount of indices
  if ((total < 0) || (total > (fsize-2)/(9*sizeof(short))))
  {
    total = (fsize-2)/(9*sizeof(short));
    WARNMSG("Bad amount of indices in Slab Set file; corrected to %ld.",total);
  }
  if (total > *scount)
  {
    WARNMSG("Only %d slabs supported, Slab Set file has %ld.",SLABSET_COUNT,total);
    total = *scount;
  }
  for (n=0; n < total; n++)
    for (k=0; k < 9; k++)
    {
      slbset[n].col_idx[k] = lword(&buf[i]);
      i += 2;
    }
  *scount = total;
  LbMemoryFree(buf);
  return true;
}
开发者ID:Loobinex,项目名称:keeperfx-unofficial,代码行数:35,代码来源:lvl_filesdk1.c

示例2: load_slabclm_file

TbBool load_slabclm_file(struct Column *cols, long *ccount)
{
  long total;
  unsigned char *buf;
  long fsize;
  long i,k;
  SYNCDBG(18,"Starting");
  fsize = 4;
  buf = load_data_file_to_buffer(&fsize, FGrp_StdData, "slabs.clm");
  if (buf == NULL)
    return false;
  i = 0;
  total = llong(&buf[i]);
  i += 4;
  // Validate total amount of columns
  if ((total < 0) || (total > (fsize-4)/sizeof(struct Column)))
  {
    total = (fsize-4)/sizeof(struct Column);
    WARNMSG("Bad amount of columns in Column Set file; corrected to %ld.",total);
  }
  if (total > *ccount)
  {
    WARNMSG("Only %d columns supported, Column Set file has %ld.",*ccount,total);
    total = *ccount;
  }
  for (k=0; k < total; k++)
  {
    LbMemoryCopy(&cols[k],&buf[i],sizeof(struct Column));
    i += sizeof(struct Column);
  }
  *ccount = total;
  LbMemoryFree(buf);
  return true;
}
开发者ID:Loobinex,项目名称:keeperfx-unofficial,代码行数:34,代码来源:lvl_filesdk1.c

示例3: save_game

/**
 * Saves the game state file (savegame).
 * @note fill_game_catalogue_entry() should be called before to fill level information.
 *
 * @param slot_num
 * @return
 */
TbBool save_game(long slot_num)
{
    char *fname;
    TbFileHandle handle;
    if (!save_game_save_catalogue())
        return false;
/*  game.version_major = VersionMajor;
    game.version_minor = VersionMinor;
    game.load_restart_level = get_loaded_level_number();*/
    fname = prepare_file_fmtpath(FGrp_Save, saved_game_filename, slot_num);
    handle = LbFileOpen(fname,Lb_FILE_MODE_NEW);
    if (handle == -1)
    {
        WARNMSG("Cannot open file to save, \"%s\".",fname);
        return false;
    }
    if (!save_game_chunks(handle,&save_game_catalogue[slot_num]))
    {
        LbFileClose(handle);
        WARNMSG("Cannot write to save file, \"%s\".",fname);
        return false;
    }
    LbFileClose(handle);
    return true;
}
开发者ID:ommmmmmm,项目名称:keeperfx,代码行数:32,代码来源:game_saves.c

示例4: initwglprocs

void initwglprocs()
   {
#ifdef _WIN32

   static int done=FALSE;

   if (!done)
      {
#ifdef GL_ARB_multitexture
      if ((glActiveTextureARB=(PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress("glActiveTextureARB"))==NULL ||
          (glClientActiveTextureARB=(PFNGLCLIENTACTIVETEXTUREARBPROC)wglGetProcAddress("glClientActiveTextureARB"))==NULL ||
          (glMultiTexCoord3fARB=(PFNGLMULTITEXCOORD3FARBPROC)wglGetProcAddress("glMultiTexCoord3fARB"))==NULL)
         WARNMSG("unsupported multi-texturing");
#endif

#if defined(GL_ARB_vertex_program) && defined(GL_ARB_fragment_program)
      if (glext_vp && glext_fp)
         if ((glGenProgramsARB=(PFNGLGENPROGRAMSARBPROC)wglGetProcAddress("glGenProgramsARB"))==NULL ||
             (glBindProgramARB=(PFNGLBINDPROGRAMARBPROC)wglGetProcAddress("glBindProgramARB"))==NULL ||
             (glProgramStringARB=(PFNGLPROGRAMSTRINGARBPROC)wglGetProcAddress("glProgramStringARB"))==NULL ||
             (glProgramEnvParameter4fARB=(PFNGLPROGRAMENVPARAMETER4FARBPROC)wglGetProcAddress("glProgramEnvParameter4fARB"))==NULL ||
             (glDeleteProgramsARB=(PFNGLDELETEPROGRAMSARBPROC)wglGetProcAddress("glDeleteProgramsARB"))==NULL ||
             (glGetProgramivARB=(PFNGLGETPROGRAMIVARBPROC)wglGetProcAddress("glGetProgramivARB"))==NULL)
            WARNMSG("unsupported shader programs");
#endif

      done=TRUE;
      }

#endif
   }
开发者ID:MarkusZoppelt,项目名称:QT-pythagoras-tree,代码行数:31,代码来源:gl.cpp

示例5: load_trapdoor_config_file

TbBool load_trapdoor_config_file(const char *textname, const char *fname, unsigned short flags)
{
    char *buf;
    long len;
    TbBool result;
    SYNCDBG(0,"%s %s file \"%s\".",((flags & CnfLd_ListOnly) == 0)?"Reading":"Parsing",textname,fname);
    len = LbFileLengthRnc(fname);
    if (len < MIN_CONFIG_FILE_SIZE)
    {
        if ((flags & CnfLd_IgnoreErrors) == 0)
            WARNMSG("The %s file \"%s\" doesn't exist or is too small.",textname,fname);
        return false;
    }
    if (len > MAX_CONFIG_FILE_SIZE)
    {
        if ((flags & CnfLd_IgnoreErrors) == 0)
            WARNMSG("The %s file \"%s\" is too large.",textname,fname);
        return false;
    }
    buf = (char *)LbMemoryAlloc(len+256);
    if (buf == NULL)
        return false;
    // Loading file data
    len = LbFileLoadAt(fname, buf);
    result = (len > 0);
    // Parse blocks of the config file
    if (result)
    {
        result = parse_trapdoor_common_blocks(buf, len, textname, flags);
        if ((flags & CnfLd_AcceptPartial) != 0)
            result = true;
        if (!result)
            WARNMSG("Parsing %s file \"%s\" common blocks failed.",textname,fname);
    }
    if (result)
    {
        result = parse_trapdoor_trap_blocks(buf, len, textname, flags);
        if ((flags & CnfLd_AcceptPartial) != 0)
            result = true;
        if (!result)
            WARNMSG("Parsing %s file \"%s\" trap blocks failed.",textname,fname);
    }
    if (result)
    {
        result = parse_trapdoor_door_blocks(buf, len, textname, flags);
        if ((flags & CnfLd_AcceptPartial) != 0)
            result = true;
        if (!result)
            WARNMSG("Parsing %s file \"%s\" door blocks failed.",textname,fname);
    }
    //Freeing and exiting
    LbMemoryFree(buf);
    SYNCDBG(19,"Done");
    return result;
}
开发者ID:dsserega,项目名称:keeperfx,代码行数:55,代码来源:config_trapdoor.c

示例6: load_column_file

TbBool load_column_file(LevelNumber lv_num)
{
    unsigned long i;
    long k;
    unsigned short n;
    long total;
    unsigned char *buf;
    long fsize;
    if ((game.operation_flags & GOF_ColumnConvert) != 0)
    {
        convert_old_column_file(lv_num);
        game.operation_flags &= ~GOF_ColumnConvert;
    }
    fsize = 8;
    buf = load_single_map_file_to_buffer(lv_num,"clm",&fsize,LMFF_None);
    if (buf == NULL)
      return false;
    clear_columns();
    i = 0;
    total = llong(&buf[i]);
    i += 4;
    // Validate total amount of columns
    if ((total < 0) || (total > (fsize-8)/sizeof(struct Column)))
    {
      total = (fsize-8)/sizeof(struct Column);
      WARNMSG("Bad amount of columns in CLM file; corrected to %ld.",total);
    }
    if (total > COLUMNS_COUNT)
    {
      WARNMSG("Only %d columns supported, CLM file has %ld.",COLUMNS_COUNT,total);
      total = COLUMNS_COUNT;
    }
    // Read and validate second amount
    game.field_14AB3F = llong(&buf[i]);
    if (game.field_14AB3F >= COLUMNS_COUNT)
    {
      game.field_14AB3F = COLUMNS_COUNT-1;
    }
    i += 4;
    // Fill the columns
    for (k=0; k < total; k++)
    {
        struct Column *colmn;
        colmn = &game.columns_data[k];
        LbMemoryCopy(colmn, &buf[i], sizeof(struct Column));
        //Update top cube in the column
        n = find_column_height(colmn);
        set_column_floor_filled_subtiles(colmn, n);
        i += sizeof(struct Column);
    }
    LbMemoryFree(buf);
    return true;
}
开发者ID:Loobinex,项目名称:keeperfx-unofficial,代码行数:53,代码来源:lvl_filesdk1.c

示例7: load_slab_datclm_files

TbBool load_slab_datclm_files(void)
{
    struct Column *cols;
    long cols_tot;
    struct SlabSet *slbset;
    long slbset_tot;
    struct SlabSet *sset;
    long i;
    SYNCDBG(5,"Starting");
    // Load Column Set
    cols_tot = COLUMNS_COUNT;
    cols = (struct Column *)LbMemoryAlloc(cols_tot*sizeof(struct Column));
    if (cols == NULL)
    {
      WARNMSG("Can't allocate memory for %d column sets.",cols_tot);
      return false;
    }
    if (!load_slabclm_file(cols, &cols_tot))
    {
      LbMemoryFree(cols);
      return false;
    }
    // Load Slab Set
    slbset_tot = SLABSET_COUNT;
    slbset = (struct SlabSet *)LbMemoryAlloc(slbset_tot*sizeof(struct SlabSet));
    if (slbset == NULL)
    {
      WARNMSG("Can't allocate memory for %d slab sets.",slbset_tot);
      return false;
    }
    if (!load_slabdat_file(slbset, &slbset_tot))
    {
      LbMemoryFree(cols);
      LbMemoryFree(slbset);
      return false;
    }
    // Update the structure
    for (i=0; i < slbset_tot; i++)
    {
        sset = &game.slabset[i];
        LbMemoryCopy(sset, &slbset[i], sizeof(struct SlabSet));
    }
    game.slabset_num = slbset_tot;
    update_columns_use(cols,cols_tot,slbset,slbset_tot);
    LbMemoryFree(slbset);
    create_columns_from_list(cols,cols_tot);
    update_slabset_column_indices(cols,cols_tot);
    LbMemoryFree(cols);
    return true;
}
开发者ID:Loobinex,项目名称:keeperfx-unofficial,代码行数:50,代码来源:lvl_filesdk1.c

示例8: get_level_fgroup

/**
 * Loads map file with given level number and file extension.
 * @return Returns NULL if the file doesn't exist or is smaller than ldsize;
 * on success, returns a buffer which should be freed after use,
 * and sets ldsize into its size.
 */
unsigned char *load_single_map_file_to_buffer(LevelNumber lvnum,const char *fext,long *ldsize,unsigned short flags)
{
  unsigned char *buf;
  char *fname;
  long fsize;
  short fgroup;
  fgroup = get_level_fgroup(lvnum);
  fname = prepare_file_fmtpath(fgroup,"map%05lu.%s",lvnum,fext);
  wait_for_cd_to_be_available();
  fsize = LbFileLengthRnc(fname);
  if (fsize < *ldsize)
  {
    if ((flags & LMFF_Optional) == 0)
      WARNMSG("Map file \"map%05lu.%s\" doesn't exist or is too small.",lvnum,fext);
    else
      SYNCMSG("Optional file \"map%05lu.%s\" doesn't exist or is too small.",lvnum,fext);
    return NULL;
  }
  if (fsize > ANY_MAP_FILE_MAX_SIZE)
  {
    if ((flags & LMFF_Optional) == 0)
      WARNMSG("Map file \"map%05lu.%s\" exceeds max size of %d; loading failed.",lvnum,fext,ANY_MAP_FILE_MAX_SIZE);
    else
      SYNCMSG("Optional file \"map%05lu.%s\" exceeds max size of %d; not loading.",lvnum,fext,ANY_MAP_FILE_MAX_SIZE);
    return NULL;
  }
  buf = LbMemoryAlloc(fsize+16);
  if (buf == NULL)
  {
    if ((flags & LMFF_Optional) == 0)
      WARNMSG("Can't allocate %ld bytes to load \"map%05lu.%s\".",fsize,lvnum,fext);
    else
      SYNCMSG("Can't allocate %ld bytes to load \"map%05lu.%s\".",fsize,lvnum,fext);
    return NULL;
  }
  fsize = LbFileLoadAt(fname,buf);
  if (fsize < *ldsize)
  {
    if ((flags & LMFF_Optional) == 0)
      WARNMSG("Reading map file \"map%05lu.%s\" failed.",lvnum,fext);
    else
      SYNCMSG("Reading optional file \"map%05lu.%s\" failed.",lvnum,fext);
    LbMemoryFree(buf);
    return NULL;
  }
  *ldsize = fsize;
  SYNCDBG(7,"Map file \"map%05lu.%s\" loaded.",lvnum,fext);
  return buf;
}
开发者ID:Loobinex,项目名称:keeperfx-unofficial,代码行数:55,代码来源:lvl_filesdk1.c

示例9: dp2p_assert

int TcpConnection::connect()
{
    dp2p_assert(fdSocket > 0);

	/* Connect. */
	const int64_t tic = Utilities::getAbsTime();
	const int retVal = ::connect(fdSocket, (struct sockaddr*)&SourceManager::get(srcId).hostAddr, sizeof(SourceManager::get(srcId).hostAddr));
	char _errBuf[1024];
	char *errBuf = strerror_r(errno, _errBuf, sizeof(_errBuf)); // get the error string
	const int64_t toc = Utilities::getAbsTime();
	DBGMSG("Spent %gs in connect().", (toc - tic) / 1e6);
	if(retVal) {
		WARNMSG("Could not connect to %s. Error in connect(): %s", SourceManager::get(srcId).hostName.c_str(), errBuf);
		return 1;
	}

	/* Allocate buffer for reading from the socket */
	recvBuf = new char[recvBufSize];
	dp2p_assert(recvBuf);

	//++ numConnectEvents;
	numReqsCompleted = 0;
	if(SourceManager::get(srcId).keepAliveTimeout != -1)
		keepAliveTimeoutNext = Utilities::getAbsTime() + SourceManager::get(srcId).keepAliveTimeout;

	updateTcpInfo();
	dp2p_assert(lastTcpInfo.tcpi_state == TCP_ESTABLISHED);
	keepAliveMaxRemaining = SourceManager::get(srcId).keepAliveMax;

	const pair<int,int> socketBufferLengths = this->getSocketBufferLengths();
	DBGMSG("Socket snd buf size: %d, socket rcv buf size: %d.", socketBufferLengths.first,socketBufferLengths.second);

	return 0;
}
开发者ID:konstantinmiller,项目名称:dashp2p,代码行数:34,代码来源:TcpConnectionManager.cpp

示例10: main

/**file main.cpp
 *@brief a main function for QMC simulation. 
 *Actual works are done by QMCApps and its derived classe.
 *For other simulations, one can derive a class from QMCApps, similarly to MolecuApps.
 *
 *Only requirements are the constructor and init function to initialize.
 */
int main(int argc, char **argv) {

  OHMMS::Controller->initialize(argc,argv);

  OhmmsInfo welcome(argc,argv,OHMMS::Controller->mycontext());

  ohmmsqmc::MolecuApps qmc(argc,argv);

  if(argc>1) {
    // build an XML tree from a the file;
    xmlDocPtr m_doc = xmlParseFile(argv[1]);
    if (m_doc == NULL) {
      ERRORMSG("File " << argv[1] << " is invalid")
      xmlFreeDoc(m_doc);
      return 1;
    }    
    // Check the document is of the right kind
    xmlNodePtr cur = xmlDocGetRootElement(m_doc);
    if (cur == NULL) {
      ERRORMSG("Empty document");
      xmlFreeDoc(m_doc);
      return 1;
    }
    qmc.run(cur);
  } else {
    WARNMSG("No argument is given. Assume that  does not need an input file")
    qmc.run(NULL);
  }
  LOGMSG("Bye")
  OHMMS::Controller->finalize();
  return 0;
}
开发者ID:digideskio,项目名称:qmcpack,代码行数:39,代码来源:main.cpp

示例11: load_map_slab_file

short load_map_slab_file(unsigned long lv_num)
{
    SYNCDBG(7,"Starting");
    struct SlabMap *slb;
    unsigned long x,y;
    unsigned char *buf;
    unsigned long i;
    unsigned long n;
    long fsize;
    fsize = 2*map_tiles_y*map_tiles_x;
    buf = load_single_map_file_to_buffer(lv_num,"slb",&fsize,LMFF_None);
    if (buf == NULL)
      return false;
    i = 0;
    for (y=0; y < map_tiles_y; y++)
      for (x=0; x < map_tiles_x; x++)
      {
        slb = get_slabmap_block(x,y);
        n = lword(&buf[i]);
        if (n > SLAB_TYPES_COUNT)
        {
          WARNMSG("Slab Type %d exceeds limit of %d",(int)n,SLAB_TYPES_COUNT);
          n = SlbT_ROCK;
        }
        slb->kind = n;
        i += 2;
      }
    LbMemoryFree(buf);
    initialise_map_collides();
    initialise_map_health();
    initialise_extra_slab_info(lv_num);
    return true;
}
开发者ID:Loobinex,项目名称:keeperfx-unofficial,代码行数:33,代码来源:lvl_filesdk1.c

示例12: WARNMSG

void MCWalkerConfiguration::resize(int numWalkers, int numPtcls) {

  WARNMSG("MCWalkerConfiguration::resize cleans up the walker list.")

  ParticleSet::resize(unsigned(numPtcls));

  int dn=numWalkers-WalkerList.size();
  if(dn>0) createWalkers(dn);

  if(dn<0) {
    int nw=-dn;
    if(nw<WalkerList.size())  {
      iterator it = WalkerList.begin();
      while(nw) {
        delete *it; ++it; --nw;
      }
      WalkerList.erase(WalkerList.begin(),WalkerList.begin()-dn);
    }
  }
  //iterator it = WalkerList.begin();
  //while(it != WalkerList.end()) {
  //  delete *it++;
  //}
  //WalkerList.erase(WalkerList.begin(),WalkerList.end());
  //R.resize(np);
  //GlobalNum = np;
  //createWalkers(nw);  
}
开发者ID:digideskio,项目名称:qmcpack,代码行数:28,代码来源:MCWalkerConfiguration.cpp

示例13: getExtension

bool ParticleParser::put(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
{
  if(xmlHasProp(cur, (const xmlChar *) "file"))
  {
    const char* fname
    =(const char*)(xmlGetProp(cur, (const xmlChar *) "file"));
    string pformat = getExtension(fname);
    if(pformat == "xml")
    {
      XMLParticleParser aHandle(ref_);
      return  aHandle.put(fname);
    }
    else
    {
      WARNMSG("Using old formats")
      ifstream fin(fname);
      if(fin)
      {
        ParticleInputFactory::createParticle(ref_,fin);
      }
      else
      {
        ERRORMSG("File " << fname << "is not found.");
      }
      return true;
    }
  }
  XMLParticleParser aHandle(ref_);
  aHandle.put(doc,ns,cur);
  return false;
}
开发者ID:digideskio,项目名称:qmcpack,代码行数:31,代码来源:GnomeParticleInputImpl.cpp

示例14: setStatus

bool
MediaPluginGStreamer010::load()
{
	if (!mDoneInit)
		return false; // error

	setStatus(STATUS_LOADING);

	DEBUGMSG("setting up media...");

	mIsLooping = false;
	mVolume = (float) 0.1234567; // minor hack to force an initial volume update

	// Create a pumpable main-loop for this media
	mPump = g_main_loop_new (NULL, FALSE);
	if (!mPump)
	{
		setStatus(STATUS_ERROR);
		return false; // error
	}

	// instantiate a playbin element to do the hard work
	mPlaybin = gst_element_factory_make ("playbin", "play");
	if (!mPlaybin)
	{
		setStatus(STATUS_ERROR);
		return false; // error
	}

	// get playbin's bus
	GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (mPlaybin));
	if (!bus)
	{
		setStatus(STATUS_ERROR);
		return false; // error
	}
	mBusWatchID = gst_bus_add_watch (bus,
					   llmediaimplgstreamer_bus_callback,
					   this);
	gst_object_unref (bus);

	if (NULL == getenv("LL_GSTREAMER_EXTERNAL")) {
		// instantiate a custom video sink
		mVideoSink =
			GST_SLVIDEO(gst_element_factory_make ("private-slvideo", "slvideo"));
		if (!mVideoSink)
		{
			WARNMSG("Could not instantiate private-slvideo element.");
			// todo: cleanup.
			setStatus(STATUS_ERROR);
			return false; // error
		}

		// connect the pieces
		g_object_set(mPlaybin, "video-sink", mVideoSink, NULL);
	}

	return true;
}
开发者ID:AlericInglewood,项目名称:SingularityViewer,代码行数:59,代码来源:media_plugin_gstreamer010.cpp

示例15: ODDocumentSetName

SOM_Scope void  SOMLINK ODDocumentSetName(ODDocument *somSelf, Environment *ev,
		ODDocumentName* name)
{
    /* ODDocumentData *somThis = ODDocumentGetData(somSelf); */
    ODDocumentMethodDebug("ODDocument","ODDocumentSetName");

	WARNMSG(WARN_INDEX(AMSG_690),"A subclass should have overridden this method!");
	ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
}
开发者ID:OS2World,项目名称:DEV-SAMPLES-IBM_OpenDoc,代码行数:9,代码来源:Document.cpp


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