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

C++ ERRORMSG函数代码示例

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

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



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

示例1: uninitializeCache

bool uninitializeCache()
{
    void *threadResult;
    bool res = true;

    // Stop the cache controller thread
    _stopCacheControllerThread = true;
    _work++;
    if (pthread_join(_cacheThread, &threadResult)) {
        ERRORMSG(_("An error occurred while waiting the end of the cache "
            "controller thread"));
        res = false;
    }
 
    // Check if all pages has been read. Otherwise free them
    for (unsigned long i=0; i < _maxPagesInTable; i++) {
        if (_pages[i]) {
            ERRORMSG(_("Cache: page %lu hasn't be used!"), i+1);
            delete _pages[i]->page();
            delete _pages[i];
        }
    }
    delete[] _pages;

    return res;
}
开发者ID:bendlas,项目名称:splix,代码行数:26,代码来源:cache.cpp


示例2: ERRORMSG

bool CacheEntry::restoreIntoMemory()
{
    int fd;

    if (!_tempFile) {
        ERRORMSG(_("Trying to restore a page instance into memory which is "
            "aready into memory"));
        return false;
    }

    // Open the swap file
    if ((fd = open(_tempFile, O_RDONLY)) == -1) {
        ERRORMSG(_("Cannot restore page into memory (%i)"), errno);
        return false;
    }

    // Restore the instance
    if (!(_page = Page::restoreIntoMemory(fd))) {
        ERRORMSG(_("Cannot restore page into memory"));
        return false;
    }

    // Destroy the swap file
    close(fd);
    unlink(_tempFile);
    delete[] _tempFile;
    _tempFile = NULL;

    DEBUGMSG(_("Page %lu restored into memory"), _page->pageNr());
    return true;
}
开发者ID:bendlas,项目名称:splix,代码行数:31,代码来源:cache.cpp


示例3: writebits

static void writebits(FILE *file,unsigned int value,int bits)
   {
   if (bits<0 || bits>32) ERRORMSG();

   if (bits==0) return;

   value&=DDS_shiftl(1,bits)-1;

   if (DDS_bufsize+bits<32)
      {
      DDS_buffer=DDS_shiftl(DDS_buffer,bits)|value;
      DDS_bufsize+=bits;
      }
   else
      {
      DDS_buffer=DDS_shiftl(DDS_buffer,32-DDS_bufsize);
      DDS_bufsize+=bits-32;
      DDS_buffer|=DDS_shiftr(value,DDS_bufsize);
      if (DDS_ISINTEL) DDS_swapuint(&DDS_buffer);
      if (fwrite(&DDS_buffer,4,1,file)!=1) ERRORMSG();
      DDS_buffer=value&(DDS_shiftl(1,DDS_bufsize)-1);
      }

   DDS_bitcnt+=bits;
   }
开发者ID:BillTheBest,项目名称:Equalizer,代码行数:25,代码来源:ddsbase.cpp


示例4: xmlParseFile

int GTO2Slater::parse(const char* fname) {

  // build an XML tree from a the file;
  xmlDocPtr m_doc = xmlParseFile(fname);
  if (m_doc == NULL) {
    ERRORMSG("File " << fname << " 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;
  }

  xmlXPathContextPtr m_context = xmlXPathNewContext(m_doc);
  xmlXPathObjectPtr result
    = xmlXPathEvalExpression((const xmlChar*)"//atomicBasisSet",m_context);
  if(!xmlXPathNodeSetIsEmpty(result->nodesetval)) {
    for(int ic=0; ic<result->nodesetval->nodeNr; ic++) {
        cout << "Going to optimize" << endl;
      if(put(result->nodesetval->nodeTab[ic])) {
        optimize();
      }
    }
  }

  xmlXPathFreeObject(result);

  return 1;
}
开发者ID:digideskio,项目名称:qmcpack,代码行数:33,代码来源:gto2slater.cpp


示例5: if

// swap byte ordering between MSB and LSB
void MiniDatabuf::swapbytes()
{
	unsigned int i,b;

	unsigned char *ptr,tmp;

	if (type==0 || (type>=3 && type<=6)) return;

	if (type==1) b=2;
	else if (type==2) b=4;
	else ERRORMSG();

	if (bytes==0 || bytes%b!=0) ERRORMSG();

	ptr=(unsigned char *)data+bytes;

	while (ptr!=data)
	{
		ptr-=b;

		for (i=0; i<(b>>1); i++)
		{
			tmp=ptr[i];
			ptr[i]=ptr[b-1-i];
			ptr[b-1-i]=tmp;
		}
	}
}
开发者ID:kalwalt,项目名称:ofxVTerrain,代码行数:29,代码来源:MiniDatabuf.cpp


示例6: writePNMimage

// write an optionally compressed PNM image
void writePNMimage(const char *filename,unsigned const char *image,unsigned int width,unsigned int height,unsigned int components,int dds)
   {
   char str[DDS_MAXSTR];

   unsigned char *data;

   if (width<1 || height<1) ERRORMSG();

   switch (components)
      {
      case 1: snprintf(str,DDS_MAXSTR,"P5\n%d %d\n255\n",width,height); break;
      case 2: snprintf(str,DDS_MAXSTR,"P5\n%d %d\n32767\n",width,height); break;
      case 3: snprintf(str,DDS_MAXSTR,"P6\n%d %d\n255\n",width,height); break;
      default: ERRORMSG();
      }

   if ((data=(unsigned char *)malloc(strlen(str)+width*height*components))==NULL) ERRORMSG();

   memcpy(data,str,strlen(str));
   memcpy(data+strlen(str),image,width*height*components);

   if (DDS_ISINTEL)
      if (components==2) swapshort(data+strlen(str),width*height);

   if (dds!=0) writeDDSfile(filename,data,strlen(str)+width*height*components,components,width);
   else writeRAWfile(filename,data,strlen(str)+width*height*components);
   }
开发者ID:BillTheBest,项目名称:Equalizer,代码行数:28,代码来源:ddsbase.cpp


示例7: CheckWork

bool CheckWork(CBlock* pblock, CWallet& wallet) {
//	uint256 hash = pblock->GetHash();
//	uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
//
//	if (hash > hashTarget)
//		return false;

	//// debug print
//	LogPrint("INFO","proof-of-work found  \n  hash: %s  \ntarget: %s\n", hash.GetHex(), hashTarget.GetHex());
	pblock->print(*pAccountViewTip);
	// LogPrint("INFO","generated %s\n", FormatMoney(pblock->vtx[0].vout[0].nValue));

	// Found a solution
	{
		LOCK(cs_main);
		if (pblock->GetHashPrevBlock() != chainActive.Tip()->GetBlockHash())
			return ERRORMSG("HonghuoMiner : generated block is stale");

		// Remove key from key pool
	//	reservekey.KeepKey();

		// Track how many getdata requests this block gets
//		{
//			LOCK(wallet.cs_wallet);
//			wallet.mapRequestCount[pblock->GetHash()] = 0;
//		}

		// Process this block the same as if we had received it from another node
		CValidationState state;
		if (!ProcessBlock(state, NULL, pblock))
			return ERRORMSG("HonghuoMiner : ProcessBlock, block not accepted");
	}

	return true;
}
开发者ID:huanghao2008,项目名称:honghuo,代码行数:35,代码来源:miner.cpp


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


示例9: CCSer_InternalMapRegisterAddresses

// Miscellaneous internal routines.
PUCHAR
static
CCSer_InternalMapRegisterAddresses(
    ULONG   HWAddress,
    ULONG   Size
    )
{
	PUCHAR	ioPortBase; 

    DEBUGMSG(ZONE_FUNCTION, 
             (TEXT("+CCSer_InternalMapRegisterAddresses: adr=0x%x len=0x%x\r\n"),
			 HWAddress, Size));

	ioPortBase = VirtualAlloc(0, Size, MEM_RESERVE, PAGE_NOACCESS);
	if ( ioPortBase == NULL )
	{
		ERRORMSG(1, (TEXT("CCSer_InternalMapRegisterAddresses: VirtualAlloc failed!\r\n")));
	}
	else if ( !VirtualCopy((PVOID)ioPortBase, (PVOID)HWAddress, Size, PAGE_READWRITE|PAGE_NOCACHE) )
	{
		ERRORMSG(1, (TEXT("CCSer_InternalMapRegisterAddresses: VirtualCopy failed!\r\n")));
		VirtualFree( (PVOID)ioPortBase, 0, MEM_RELEASE );
		ioPortBase = 0;
	}

    DEBUGMSG(ZONE_FUNCTION, 
             (TEXT("-CCSer_InternalMapRegisterAddresses: mapped at 0x%x\r\n"),
              ioPortBase ));

    return ioPortBase;
}
开发者ID:zizilala,项目名称:projects_wince_new,代码行数:32,代码来源:ccser_pdd.c


示例10: read_gz

static void read_gz(int f, int fd, const char *arg)
{
    gzFile  g;
    int     nBuf;
    char    buf[BUFFER_SIZE];

    g=gzdopen(f, "rb");
    if (!g)
    {
        ERRORMSG(_("Invalid/corrupt .gz file.\n"));
        close(f);
        close(fd);
        return;
    }
    while ((nBuf=gzread(g, buf, BUFFER_SIZE))>0)
    {
        if (write(fd, buf, nBuf)!=nBuf)
        {
            gzclose(g);
            close(fd);
            return;
        }
    }
    if (nBuf)
    {
        ERRORMSG("\033[0m");
        ERRORMSG(_("gzip: Error during decompression.\n"));
    }
    gzclose(g);
    close(fd);
}
开发者ID:kilobyte,项目名称:termrec,代码行数:31,代码来源:compress.c


示例11: transfer_creature

void transfer_creature(struct Thing *boxtng, struct Thing *transftng, unsigned char plyr_idx)
{
    SYNCDBG(7,"Starting");
    struct CreatureControl *cctrl;
    if (!thing_exists(boxtng) || (box_thing_to_special(boxtng) != SpcKind_TrnsfrCrtr) ) {
        ERRORMSG("Invalid transfer box object!");
        return;
    }
    // Check if 'things' are correct
    if (!thing_exists(transftng) || !thing_is_creature(transftng) || (transftng->owner != plyr_idx)) {
        ERRORMSG("Invalid transfer creature thing!");
        return;
    }

    cctrl = creature_control_get_from_thing(transftng);
    set_transfered_creature(plyr_idx, transftng->model, cctrl->explevel);
    remove_thing_from_power_hand_list(transftng, plyr_idx);
    kill_creature(transftng, INVALID_THING, -1, CrDed_NoEffects|CrDed_NotReallyDying);
    create_special_used_effect(&boxtng->mappos, plyr_idx);
    remove_events_thing_is_attached_to(boxtng);
    force_any_creature_dragging_owned_thing_to_drop_it(boxtng);
    delete_thing_structure(boxtng, 0);
    if (is_my_player_number(plyr_idx))
      output_message(SMsg_CommonAcknowledge, 0, true);
}
开发者ID:dkfans,项目名称:keeperfx-stable,代码行数:25,代码来源:power_specials.c


示例12: setstringsize

void lunascan::setstringsize(int size)
   {
   if (STRING!=NULL) ERRORMSG();

   if (size<1) ERRORMSG();

   STRINGSIZE=size;
   }
开发者ID:mahdi12167,项目名称:libmini,代码行数:8,代码来源:lunascan.cpp


示例13: setscopestacksize

void lunascan::setscopestacksize(int size)
   {
   if (SCOPESTACK!=NULL) ERRORMSG();

   if (size<1) ERRORMSG();

   SCOPESTACKSIZE=size;
   }
开发者ID:mahdi12167,项目名称:libmini,代码行数:8,代码来源:lunascan.cpp


示例14: sethashsize

void lunascan::sethashsize(int size)
   {
   if (HASH!=NULL) ERRORMSG();

   if (size<1) ERRORMSG();

   HASHSIZE=size;
   }
开发者ID:mahdi12167,项目名称:libmini,代码行数:8,代码来源:lunascan.cpp


示例15: setcodestacksize

void lunascan::setcodestacksize(int size)
   {
   if (CODE!=NULL) ERRORMSG();

   if (size<1) ERRORMSG();

   CODESTACKMAX=size;
   }
开发者ID:mahdi12167,项目名称:libmini,代码行数:8,代码来源:lunascan.cpp


示例16: setcomment

void lunascan::setcomment(char comment)
   {
   if (CODESTACKSIZE>0) ERRORMSG();

   if (comment==' ' || comment=='\n' || comment=='\r' || comment=='\0') ERRORMSG();

   COMMENT=comment;
   }
开发者ID:mahdi12167,项目名称:libmini,代码行数:8,代码来源:lunascan.cpp


示例17: getinfo

int lunascan::getinfo(int serial)
   {
   if (CODESTACKSIZE<1) ERRORMSG();

   if (serial<0 || serial>=POOLSIZE) ERRORMSG();

   return(POOL[serial].info);
   }
开发者ID:mahdi12167,项目名称:libmini,代码行数:8,代码来源:lunascan.cpp


示例18: InitializeIST

static BOOL InitializeIST()
{
    BOOL r;

    gMfcIntrEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    if (!gMfcIntrEvent) {
        ERRORMSG(1, (L"Unable to create interrupt event"));
        return(FALSE);
    }

    if (!CreateInterruptNotification()) {
        ERRORMSG(1, (L"Unable to create interrupt notification"));
        CloseHandle(gMfcIntrEvent);
        return FALSE;
    }

    r = KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR,
                        &g_MfcIrq,     sizeof(UINT32),
                        &g_MfcSysIntr, sizeof(UINT32),
                        NULL);
    if (r != TRUE) {
        ERRORMSG(1, (L"Failed to request sysintr value for MFC interrupt.\r\n"));
        DeleteInterruptNotification();
        CloseHandle(gMfcIntrEvent);
        return FALSE;
    }


    r = InterruptInitialize(g_MfcSysIntr, gMfcIntrEvent, NULL, 0);
    if (r != TRUE) {
        ERRORMSG(1, (L"Unable to initialize output interrupt"));
        DeleteInterruptNotification();
        CloseHandle(gMfcIntrEvent);
        return FALSE;
    }

    gMfcIntrThread = CreateThread((LPSECURITY_ATTRIBUTES)NULL,
                                  0,
                                  (LPTHREAD_START_ROUTINE)MFC_IntrThread,
                                  0,
                                  0,
                                  NULL);
    if (!gMfcIntrThread) {
        ERRORMSG(1, (L"Unable to create interrupt thread"));
        InterruptDisable(g_MfcSysIntr);
        DeleteInterruptNotification();
        CloseHandle(gMfcIntrEvent);
        return FALSE;
    }

    // Bump up the priority since the interrupt must be serviced immediately.
    CeSetThreadPriority(gMfcIntrThread, MFC_THREAD_PRIORITY_DEFAULT);

    RETAILMSG(1, (L"MFC Interrupt has been initialized.\n"));

    return TRUE;
}
开发者ID:HITEG,项目名称:TenByTen6410_SLC,代码行数:57,代码来源:MfcDriver.cpp


示例19: initglobal

void initglobal(int argc,char *argv[])
   {
   char *ptr;

   parseargs(argc,argv);

   ptr=strrchr(PROGNAME,'/');
   if (ptr==NULL) PROGNAME[0]='\0';
   else *ptr='\0';

   VOLREN=new volren(PROGNAME);

   if (strlen(OUTNAME)>0)
      {
      loadvolume();
      VOLREN->savePVMvolume(OUTNAME);
      exit(0);
      }

   EYE_X=0.0f;
   EYE_Y=0.0f;
   EYE_Z=3.0f;

   EYE_SPEED=0.0f;

   VOLREN->get_tfunc()->set_line(0.0f,0.0f,0.33f,1.0f,VOLREN->get_tfunc()->get_be());
   VOLREN->get_tfunc()->set_line(0.33f,1.0f,0.67f,0.0f,VOLREN->get_tfunc()->get_be());
   VOLREN->get_tfunc()->set_line(0.33f,0.0f,0.67f,1.0f,VOLREN->get_tfunc()->get_ge());
   VOLREN->get_tfunc()->set_line(0.67f,1.0f,1.0f,0.0f,VOLREN->get_tfunc()->get_ge());
   VOLREN->get_tfunc()->set_line(0.67f,0.0f,1.0f,1.0f,VOLREN->get_tfunc()->get_re());

   VOLREN->get_tfunc()->set_line(0.0f,0.0f,1.0f,1.0f,VOLREN->get_tfunc()->get_ra());
   VOLREN->get_tfunc()->set_line(0.0f,0.0f,1.0f,1.0f,VOLREN->get_tfunc()->get_ga());
   VOLREN->get_tfunc()->set_line(0.0f,0.0f,1.0f,1.0f,VOLREN->get_tfunc()->get_ba());

   loadhook();

   if ((GUI_recfile=fopen(RECORD,"rb"))!=NULL)
      {
      GUI_demo=TRUE;
      fclose(GUI_recfile);
      }

   if (GUI_record)
      {
      if ((GUI_recfile=fopen(RECORD,"wb"))==NULL) ERRORMSG();
      GUI_demo=FALSE;
      }

   if (GUI_demo)
      {
      if ((GUI_recfile=fopen(RECORD,"rb"))==NULL) ERRORMSG();
      GUI_start=gettime();
      }
   }
开发者ID:anqanq000,项目名称:vvv,代码行数:55,代码来源:v3.cpp


示例20: writeRAWfile

// write a RAW file
void writeRAWfile(const char *filename,unsigned char *data,size_t bytes,int nofree)
   {
   if (bytes<1) ERRORMSG();

   if ((DDS_file=fopen(filename,"wb"))==NULL) ERRORMSG();
   if (fwrite(data,1,bytes,DDS_file)!=bytes) ERRORMSG();

   fclose(DDS_file);

   if (nofree==0) free(data);
   }
开发者ID:BillTheBest,项目名称:Equalizer,代码行数:12,代码来源:ddsbase.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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