您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ERRORMSG函数代码示例

51自学网 2021-06-01 20:33:20
  C++
这篇教程C++ ERRORMSG函数代码示例写得很实用,希望能帮到您。

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

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


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


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


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


示例5: if

// swap byte ordering between MSB and LSBvoid 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,


示例6: writePNMimage

// write an optionally compressed PNM imagevoid 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,


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


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


示例9: CCSer_InternalMapRegisterAddresses

// Miscellaneous internal routines.PUCHARstaticCCSer_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,


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


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


示例12: setstringsize

void lunascan::setstringsize(int size)   {   if (STRING!=NULL) ERRORMSG();   if (size<1) ERRORMSG();   STRINGSIZE=size;   }
开发者ID:mahdi12167,项目名称:libmini,代码行数:8,


示例13: setscopestacksize

void lunascan::setscopestacksize(int size)   {   if (SCOPESTACK!=NULL) ERRORMSG();   if (size<1) ERRORMSG();   SCOPESTACKSIZE=size;   }
开发者ID:mahdi12167,项目名称:libmini,代码行数:8,


示例14: sethashsize

void lunascan::sethashsize(int size)   {   if (HASH!=NULL) ERRORMSG();   if (size<1) ERRORMSG();   HASHSIZE=size;   }
开发者ID:mahdi12167,项目名称:libmini,代码行数:8,


示例15: setcodestacksize

void lunascan::setcodestacksize(int size)   {   if (CODE!=NULL) ERRORMSG();   if (size<1) ERRORMSG();   CODESTACKMAX=size;   }
开发者ID:mahdi12167,项目名称:libmini,代码行数:8,


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


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


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


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


示例20: writeRAWfile

// write a RAW filevoid 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,


示例21: LoadGfwList_Thread

static int LoadGfwList_Thread(ConfigFileInfo *ConfigInfo){	int		UpdateInterval	=	ConfigGetInt32(ConfigInfo, "GfwListUpdateInterval");	int		RetryInterval	=	ConfigGetInt32(ConfigInfo, "GfwListRetryInterval");	BOOL	NeedBase64Decode	=	ConfigGetBoolean(ConfigInfo, "GfwListBase64Decode");	int		Count;	if( RetryInterval < 0 )	{		RetryInterval = 0;	}	while( TRUE )	{		INFO("Loading GFW List From %s .../n", GfwList);		if( GetFromInternet_Base(GfwList, File, FALSE) != 0 )		{			ERRORMSG("Downloading GFW List failed. Waiting %d second(s) for retry./n", RetryInterval);			SLEEP(RetryInterval * 1000);		} else {			INFO("GFW List saved at %s./n", File);			Count = LoadGfwListFile(File, NeedBase64Decode);			switch( Count )			{				case -1:				case -2:				case -3:					break;				case -4:					ERRORMSG("Loading GFW List failed, cannot open file %s. Stop loading./n", File);					return -1;					break;				default:					INFO("Loading GFW List completed. %d effective items./n", Count);					break;			}			if( UpdateInterval < 0 )			{				return 0;			}			SLEEP(UpdateInterval * 1000);		}	}	return 0;}
开发者ID:0rt,项目名称:dnsforwarder,代码行数:53,


示例22: ERRORMSG

VISIBILITY_ENABLE#include "ttyrec.h"VISIBILITY_DISABLE#include "stream.h"#include "error.h"#include "gettext.h"#define ERRORMSG(x) do if (write(fd,(x),strlen(x))) {} while(0)#define BUFFER_SIZE 32768#if (defined HAVE_LIBBZ2) || (defined SHIPPED_LIBBZ2)static void read_bz2(int f, int fd, const char *arg){    BZFILE* b;    int     nBuf;    char    buf[BUFFER_SIZE];    int     bzerror;    b = BZ2_bzReadOpen(&bzerror, fdopen(f,"rb"), 0, 0, NULL, 0);    if (bzerror != BZ_OK)    {        BZ2_bzReadClose(&bzerror, b);        // error        ERRORMSG(_("Invalid/corrupt .bz2 file./n"));        close(fd);        return;    }    bzerror = BZ_OK;    while (bzerror == BZ_OK)    {        nBuf = BZ2_bzRead(&bzerror, b, buf, BUFFER_SIZE);        if (write(fd, buf, nBuf)!=nBuf)        {            BZ2_bzReadClose(&bzerror, b);            close(fd);            return;        }    }    if (bzerror != BZ_STREAM_END)    {        BZ2_bzReadClose(&bzerror, b);        // error        ERRORMSG("/033[0m");        ERRORMSG(_("bzip2: Error during decompression./n"));    }    else        BZ2_bzReadClose(&bzerror, b);    close(fd);}
开发者ID:kilobyte,项目名称:termrec,代码行数:51,


示例23: thing_get

struct Thing *allocate_free_thing_structure_f(unsigned char allocflags, const char *func_name){    struct Thing *thing;    long i;    // Get a thing from "free things list"    i = game.free_things_start_index;    // If there is no free thing, try to free an effect    if (i >= THINGS_COUNT-1)    {        if ((allocflags & FTAF_FreeEffectIfNoSlots) != 0)        {            thing = thing_get(game.thing_lists[TngList_EffectElems].index);            if (!thing_is_invalid(thing))            {                delete_thing_structure(thing, 0);            } else            {#if (BFDEBUG_LEVEL > 0)                ERRORMSG("%s: Cannot free up effect element to allocate new thing!",func_name);#endif            }        }        i = game.free_things_start_index;    }    // Now, if there is still no free thing (we couldn't free any)    if (i >= THINGS_COUNT-1)    {#if (BFDEBUG_LEVEL > 0)        ERRORMSG("%s: Cannot allocate new thing, no free slots!",func_name);#endif        return INVALID_THING;    }    // And if there is free one, allocate it    thing = thing_get(game.free_things[i]);#if (BFDEBUG_LEVEL > 0)    if (thing_exists(thing)) {        ERRORMSG("%s: Found existing thing %d in free things list at pos %d!",func_name,(int)game.free_things[i],(int)i);    }#endif    LbMemorySet(thing, 0, sizeof(struct Thing));    if (thing_is_invalid(thing)) {        ERRORMSG("%s: Got invalid thing slot instead of free one!",func_name);        return INVALID_THING;    }    thing->alloc_flags |= TAlF_Exists;    thing->index = game.free_things[i];    game.free_things[game.free_things_start_index] = 0;    game.free_things_start_index++;    TRACE_THING(thing);    return thing;}
开发者ID:yvsarkisyan,项目名称:keeperfx,代码行数:51,


示例24: read_end_of_cent_dir

static int read_end_of_cent_dir (FILE *fp, t_end_of_cent_dir *ecd){	int	count, read;	int	sigoffset;	int	err;	sigoffset=0;	/* determine how many bytes to read */	if (gZipLen > BUFSIZE)		count = BUFSIZE;	else		count = gZipLen;	/* seek to end of file - count */	err = fseek (fp, -count, SEEK_END);	if (err!=0){		ERRORMSG ("Error in zipfile: fseek failed/n");		return err;	}	/* read entire file or BUFSIZE bytes into buffer */	read = fread (input_buffer, 1, count, fp);	if (read == count){		/* locate end-of-central-dir sig */		err = find_ecd_sig (input_buffer, count, &sigoffset);		if (err==0){			char *p = input_buffer+sigoffset;			/* read end-of-central-dir */			ecd->end_of_cent_dir_sig = read_dword (p+ZIPESIG);			ecd->number_of_this_disk = read_word (p+ZIPEDSK);			ecd->number_of_disk_start_cent_dir = read_word (p+ZIPECEN);			ecd->total_entries_cent_dir_this_disk = read_word (p+ZIPENUM);			ecd->total_entries_cent_dir = read_word (p+ZIPECENN);			ecd->size_of_cent_dir = read_dword (p+ZIPECSZ);			ecd->offset_to_start_of_cent_dir = read_dword (p+ZIPEOFST);			ecd->zipfile_comment_length = read_word (p+ZIPECOML);		}		else{			ERRORMSG ("Error in zipfile: couldn't find 'end of central dir' signature/n");		}	}	else{		ERRORMSG ("Error in zipfile: couldn't read %d bytes from end of file/n", count);		err = -1;	}	return err;}
开发者ID:sdlBasic,项目名称:sdlbrt,代码行数:50,


示例25: DllMain

BOOL _stdcall DllMain (HANDLE hModule, DWORD reason, void * unused) {	if (reason != DLL_PROCESS_ATTACH) return true;	MGEFlags = NULL;	bool iniLoaded = LoadSettings ();	if (!IsMorrowind ()) return true;	if (FindWindow (0, GUI_VERSION)) {		ERRORMSG ("Error: MGEgui is running. Please shut it down before launching morrowind.");	}	if (!iniLoaded) {		ERRORMSG ("Error: MGE is not configured. Please run MGEgui to configure it before launching Morrowind.");	}	Initialized = !BitTst (&MGEFlags, MGE_DISABLED_BIT);	HANDLE MWSEpipe;	HANDLE MGEpipe;	if (Initialized) {		MWSEpipe = CreateNamedPipeA ("////.//pipe//MWSEMGEpipe", PIPE_ACCESS_DUPLEX, 			PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_NOWAIT,			PIPE_UNLIMITED_INSTANCES, 4096, 4096, 20000, NULL		);		MWSEpipe2 = CreateNamedPipeA ("////.//pipe//MWSEMGEpipe2", PIPE_ACCESS_DUPLEX, 			PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_NOWAIT,			PIPE_UNLIMITED_INSTANCES, 4096, 4096, 20000, NULL		);		if (MWSEpipe == INVALID_HANDLE_VALUE || MWSEpipe2 == INVALID_HANDLE_VALUE) {			LOG::log ("Failed to create mge-mwse pipe/r/n");			return false;		}		MGEpipe = CreateFile ("////.//pipe//MWSEMGEpipe", GENERIC_WRITE|GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL);		MGEpipe2 = CreateFile ("////.//pipe//MWSEMGEpipe2", GENERIC_WRITE|GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL);		if (MGEpipe == INVALID_HANDLE_VALUE || MGEpipe2 == INVALID_HANDLE_VALUE) {			LOG::log ("Failed to open mge-mwse pipe/r/n");			return false;		}	} else MWSEpipe = INVALID_HANDLE_VALUE;	if (MGEFlags & MWSE_DISABLED) LOG::log ("MWSE: Disabled/r/n");	else MWSEOnProcessStart (MWSEpipe);	if (Initialized) {		MGEOnProcessStart (MGEpipe);		DInputOnProcessStart ();	} else LOG::log ("MGE: Disabled/r/n");	return true;}
开发者ID:europop,项目名称:morrgraphext,代码行数:49,


示例26: ERRORMSG

AlignmentSet * AlignmentSet::CreateFromMultiple(StructureBase *parent,    const BlockMultipleAlignment *multiple, const vector < unsigned int >& rowOrder){    // sanity check on the row order map    map < unsigned int, unsigned int > rowCheck;    for (unsigned int i=0; i<rowOrder.size(); ++i) rowCheck[rowOrder[i]] = i;    if (rowOrder.size() != multiple->NRows() || rowCheck.size() != multiple->NRows() || rowOrder[0] != 0) {        ERRORMSG("AlignmentSet::CreateFromMultiple() - bad row order vector");        return NULL;    }    // create a single Seq-annot, with 'align' data that holds one Seq-align per dependent    auto_ptr<SeqAnnotList> newAsnAlignmentData(new SeqAnnotList(1));    CSeq_annot *seqAnnot = new CSeq_annot();    newAsnAlignmentData->back().Reset(seqAnnot);    CSeq_annot::C_Data::TAlign& seqAligns = seqAnnot->SetData().SetAlign();    seqAligns.resize((multiple->NRows() == 1) ? 1 : multiple->NRows() - 1);    CSeq_annot::C_Data::TAlign::iterator sa = seqAligns.begin();    BlockMultipleAlignment::UngappedAlignedBlockList blocks;    multiple->GetUngappedAlignedBlocks(&blocks);    // create Seq-aligns; if there's only one row (the master), then cheat and create an alignment    // of the master with itself, because asn data doesn't take well to single-row "alignment"    if (multiple->NRows() > 1) {        unsigned int newRow;        for (unsigned int row=1; row<multiple->NRows(); ++row, ++sa) {          newRow = rowOrder[row];          CSeq_align *seqAlign = CreatePairwiseSeqAlignFromMultipleRow(multiple, blocks, newRow);          sa->Reset(seqAlign);        }    } else        sa->Reset(CreatePairwiseSeqAlignFromMultipleRow(multiple, blocks, 0));    auto_ptr<AlignmentSet> newAlignmentSet;    try {        newAlignmentSet.reset(new AlignmentSet(parent, multiple->GetMaster(), *newAsnAlignmentData));    } catch (exception& e) {        ERRORMSG(            "AlignmentSet::CreateFromMultiple() - failed to create AlignmentSet from new asn object; "            << "exception: " << e.what());        return NULL;    }    newAlignmentSet->newAsnAlignmentData = newAsnAlignmentData.release();    return newAlignmentSet.release();}
开发者ID:jackgopack4,项目名称:pico-blast,代码行数:48,


示例27: DrvLib_MapIoSpace

void *Phy2Vir_AddrMapping(unsigned int phy_addr, int mem_size){#if	1	void *mappedAddr = NULL;	mappedAddr = DrvLib_MapIoSpace(phy_addr, mem_size, FALSE);	if (mappedAddr == NULL)	{		RETAILMSG(1, (L"[MFC:ERR] Phy2Vir_AddrMapping() : Mapping Failed [PA:0x%08x]/n/r", phy_addr));	}	return mappedAddr;#else	BOOL					b;	void					*reserved_mem;	reserved_mem = (void *)VirtualAlloc(NULL, mem_size, MEM_RESERVE, PAGE_NOACCESS);	if (reserved_mem == NULL) {		ERRORMSG(1,(TEXT("For IOPreg: VirtualAlloc failed!/r/n")));		return 0;	}	b = VirtualCopy(reserved_mem,	                (void *)(phy_addr >> 8),	                mem_size,	                PAGE_PHYSICAL | PAGE_READWRITE | PAGE_NOCACHE);	if (b == FALSE) {		VirtualFree(reserved_mem, 0, MEM_RELEASE);		return NULL;	}	return reserved_mem;#endif}
开发者ID:darwinbeing,项目名称:wince-on-iphone,代码行数:34,


示例28: switch

// render the globevoid miniglobe::render()   {   if (DONE==0)      {      switch (SHAPE)         {         case SHAPE_SUN: create_sun(); break;         case SHAPE_MERCURY: create_orb(minicoord::MINICOORD_ORB_MERCURY); break;         case SHAPE_VENUS: create_orb(minicoord::MINICOORD_ORB_VENUS); break;         case SHAPE_EARTH: create_earth(); break;         case SHAPE_MARS: create_orb(minicoord::MINICOORD_ORB_MARS); break;         case SHAPE_JUPITER: create_orb(minicoord::MINICOORD_ORB_JUPITER); break;         case SHAPE_SATURN: create_orb(minicoord::MINICOORD_ORB_SATURN); break;         case SHAPE_URANUS: create_orb(minicoord::MINICOORD_ORB_URANUS); break;         case SHAPE_NEPTUNE: create_orb(minicoord::MINICOORD_ORB_NEPTUNE); break;         case SHAPE_CERES: create_orb(minicoord::MINICOORD_ORB_CERES); break;         case SHAPE_PLUTO: create_orb(minicoord::MINICOORD_ORB_PLUTO); break;         case SHAPE_ERIS: create_orb(minicoord::MINICOORD_ORB_ERIS); break;         case SHAPE_MOON: create_moon(); break;         default: ERRORMSG();         }      create_shader(CONFIGURE_FRONTNAME,CONFIGURE_BACKNAME,                    CONFIGURE_FRONTBUF,CONFIGURE_BACKBUF);      DONE=1;      }   initstate();   STRIP->render();   exitstate();   }
开发者ID:mahdi12167,项目名称:libmini,代码行数:33,


示例29: ERRORMSG

struct PlayerInfo *get_player_f(long plyr_idx,const char *func_name){    if ((plyr_idx >= 0) && (plyr_idx < PLAYERS_COUNT))        return &game.players[plyr_idx];    ERRORMSG("%s: Tried to get non-existing player %d!",func_name,(int)plyr_idx);    return INVALID_PLAYER;}
开发者ID:ommmmmmm,项目名称:keeperfx,代码行数:7,



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


C++ ERROR_CHECK函数代码示例
C++ ERRORLOG函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。