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

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

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

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

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

示例1: test

void Image::import(const SimulationItem *item, QString filename, QString directory){    // Cache a pointer to the logger    Log* log = item->find<Log>();    // Store a pointer to the units system    _units = item->find<Units>();    // Determine the path of the input FITS file    QString filepath;    filename = filename.endsWith(".fits") ? filename : filename + ".fits";    if (directory.isNull())    {        filepath = item->find<FilePaths>()->input(filename);    }    else    {        QFileInfo test(directory);        if (!test.isDir()) throw FATALERROR("Import directory does not exist: " + directory);        filepath = directory + "/" + filename;    }    // Read the input image and store it    log->info("Reading FITS file " + filepath);    FITSInOut::read(filepath, _data, _xsize, _ysize, _nframes);    // Verify that the FITS file contains only one frame    if (_nframes != 1) throw FATALERROR("FITS image contains multiple frames");    // Log the dimensions of the image    log->info("Frame dimensions: " + QString::number(_xsize) + " x " + QString::number(_ysize));}
开发者ID:SKIRT,项目名称:SKIRT,代码行数:32,


示例2: extract2fs

/* * extract from the archive * and copy to the filesystem  * relative to the directory the archive's in */int extract2fs(TOC *ptoc){#ifdef WIN32	char *p;#endif	FILE *out;	unsigned char *data = extract(ptoc);	if (!f_workpath) {		getTempPath(f_temppath);#ifdef WIN32		strcpy(f_temppathraw, f_temppath);		for ( p=f_temppath; *p; p++ )			if (*p == '//')				*p = '/';#endif		f_workpath = f_temppath;	}	out = openTarget(f_workpath, ptoc->name);	if (out == NULL)  {		FATALERROR(ptoc->name);		FATALERROR(" could not be extracted!/n");	}	else {		fwrite(data, ntohl(ptoc->ulen), 1, out);#ifndef WIN32		fchmod(fileno(out), S_IRUSR | S_IWUSR | S_IXUSR);#endif		fclose(out);	}	free(data);	return 0;}
开发者ID:ludisnet,项目名称:ludisoft,代码行数:39,


示例3: loadPython

/* * Load the Python DLL, and get all of the necessary entry points * Windows only (dynamic load) */int loadPython(){#ifdef WIN32	HINSTANCE dll;	char dllpath[_MAX_PATH + 1];	/* Determine the path */	sprintf(dllpath, "%spython%02d.dll", f_homepathraw, ntohl(f_cookie.pyvers));	/* Load the DLL */	dll = LoadLibraryEx(dllpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);  	if (dll) {		VS(dllpath);		VS("/n");	}	else {		sprintf(dllpath, "%spython%02d.dll", f_temppathraw, ntohl(f_cookie.pyvers));		dll = LoadLibraryEx(dllpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH );		if (dll) {			VS(dllpath); 			VS("/n");		}	}	if (dll == 0) {		FATALERROR("Error loading Python DLL: ");		FATALERROR(dllpath);		FATALERROR("/n");		return -1;	}	mapNames(dll);#endif	return 0;}
开发者ID:ludisnet,项目名称:ludisoft,代码行数:39,


示例4: setupSelfBefore

void LogNormalGrainSizeDistribution::setupSelfBefore(){    RangeGrainSizeDistribution::setupSelfBefore();    // verify the attributes    if (_a0 <= 0) throw FATALERROR("The centroid of the log-normal law must be positive");    if (_sigma <= 0) throw FATALERROR("The width of the log-normal law must be positive");}
开发者ID:DukhangLee,项目名称:SKIRT,代码行数:8,


示例5:

voidYDustCompNormalization::setupSelfBefore(){    DustCompNormalization::setupSelfBefore();    // verify that we have some wavelength and optical depth    if (_wavelength <= 0) throw FATALERROR("Wavelength was not set");    if (_tau <= 0) throw FATALERROR("Optical depth was not set");}
开发者ID:wsaftly,项目名称:SKIRT-1,代码行数:9,


示例6:

voidTriaxialGeometry::setupSelfBefore(){    GenGeometry::setupSelfBefore();    // verify property values    if (_p <= 0 || _p > 1.0) throw FATALERROR("the flattening parameter p should be between 0 and 1");    if (_q <= 0 || _q > 1.0) throw FATALERROR("the flattening parameter q should be between 0 and 1");}
开发者ID:lbignone,项目名称:SKIRT,代码行数:9,


示例7: GMC_DCL

   GMC_DCL(tp_Nod, Nod){   tp_FilHdr FilHdr;   tp_Nod RootNod, OprNod;   tp_Key Key;   if (Nod == ERROR) return ERROR;   switch (Nod_NodTyp(Nod)) {      case NSTDEF: case FILDEF: case SEGDEF: {	 SystemError("Syntax error: Unexpected target./n");	 return ERROR; }/*case*/;      case WORD: {	 FilHdr = Str_FilHdr(Sym_Str(Nod_Sym(Nod)), NullPrmTyp);	 return New_PrmFHdr(FilHdr, RootFilPrm); }/*case*/;      case DRVFIL: {	 break; }/*case*/;      default: {	 FATALERROR("Unexpected node type./n"); };}/*switch*/;   RootNod = Nod_Son(1, Nod);   OprNod = Nod_Brother(RootNod);   switch (Nod_NodTyp(RootNod)) {      case EMPFIL: {	 FilHdr = Copy_FilHdr(EmptyFilHdr);	 break; }/*case*/;      case ARTFIL: {	 FilHdr = Copy_FilHdr(RootFilHdr);	 break; }/*case*/;      case OBJTID: {	 FilHdr = LocHdr_FilHdr	  ((tp_LocHdr)Str_PosInt(Sym_Str(Nod_Sym(RootNod))));	 break; }/*case*/;      case WORD: {	 FilHdr = HostFN_FilHdr(Sym_Str(Nod_Sym(RootNod)));	 break; }/*case*/;      case ABSFIL: {	 Key = Sym_Str(Nod_Sym(Nod_Son(1, RootNod)));	 FilHdr = Do_Keys(Copy_FilHdr(RootFilHdr), Key);	 break; }/*case*/;      case SEGOPR: {	 FilHdr = Get_BaseVTgtFilHdr(Top_ContextFilHdr());	 OprNod = RootNod;	 break; }/*case*/;      case DRVOPR: {	 FilHdr = Top_ContextFilHdr();	 OprNod = RootNod;	 break; }/*case*/;      case STRING: {	 FilHdr = Str_FilHdr(Sym_Str(Nod_Sym(Nod_Son(1, RootNod))), NullPrmTyp);	 break; }/*case*/;      default: {	 FATALERROR("Unexpected node type./n"); };}/*switch*/;   return Apply_OprNods(FilHdr, RootFilPrm, OprNod);   }/*Nod_PrmFHdr*/
开发者ID:LukeMeszar,项目名称:CAS,代码行数:56,


示例8: _MGL_destroyDisplayDC

/****************************************************************************PARAMETERS:dc  - Device context to destroyRETURNS:True if the context was destroyed, false on error.REMARKS:Searches for the display device context in the list of currently allocatedcontexts, and destroys it if it exists. If this is the last display devicecontext, then we also shut down the graphics mode and restore the originalgraphics mode.{secret}****************************************************************************/ibool _MGL_destroyDisplayDC(    MGLDC *dc){    MGLDC   *prev;    PM_HWND hwndConsole;    if (!dc) {        FATALERROR(grInvalidDC);        return false;        }    if (DEV.dispDCList->count == 1) {        /* There is only one active display context left, so restore         * the original display mode and destroy the entire display         * device context list         */        if (dc != _LST_first(DEV.dispDCList)) {            FATALERROR(grInvalidDC);            return false;            }        /* Save the console window handle for later as the DC structure         * is destroyed before we close the console itself.         */        hwndConsole = (PM_HWND)dc->v->d.hwnd;        dc->v->d.restoreTextMode(dc);        _MGL_freeInternalDCVars(dc);        dc->v->d.destroy(dc);        _LST_destroy(DEV.dispDCList,_LST_freeNode);        DEV.dispDCList = NULL;        /* Restore the console state and close it */        if (DEV.stateBuf) {            PM_restoreConsoleState(DEV.stateBuf,hwndConsole);            PM_free(DEV.stateBuf);            DEV.stateBuf = NULL;            PM_closeConsole(hwndConsole);            }        /* We are no longer in Windows full screen mode but on the desktop */        if (_MGL_consoleSupport)            _MS_setDisplayDC(NULL);        }    else {        /* There is more than one active display context, so simply         * remove the current one from the list and destroy it.         */        if ((prev = _LST_findNode(DEV.dispDCList,dc)) == NULL) {            FATALERROR(grInvalidDC);            return false;            }        _MGL_freeInternalDCVars(dc);        dc->v->d.destroy(dc);        _LST_removeNext(DEV.dispDCList,prev);        _LST_freeNode(dc);        }    return true;}
开发者ID:OS2World,项目名称:DEV-UTIL-MGL,代码行数:70,


示例9: openArchive

/*  * Open the archive * Sets f_archiveFile, f_pkgstart, f_tocbuff and f_cookie. */int openArchive(){	int filelen;	/* Physically open the file */	f_fp = fopen(f_archivename, "rb");	if (f_fp == NULL) {		VS("Cannot open archive: ");		VS(f_archivename);		VS("/n");		return -1;	}	/* Seek to the Cookie at the end of the file. */	fseek(f_fp, 0, SEEK_END);	filelen = ftell(f_fp);	if (fseek(f_fp, -(int)sizeof(COOKIE), SEEK_END)) 	{		VS(f_archivename);		VS(" appears to be an invalid archive/n");		return -1;	}	/* Read the Cookie, and check its MAGIC bytes */	fread(&f_cookie, sizeof(COOKIE), 1, f_fp);	if (strncmp(f_cookie.magic, MAGIC, strlen(MAGIC))) 	{		VS(f_archivename);		VS(" has bad magic!/n");		return -1;	}	/* From the cookie, calculate the archive start */	f_pkgstart = filelen - ntohl(f_cookie.len);	/* Read in in the table of contents */	fseek(f_fp, f_pkgstart + ntohl(f_cookie.TOC), SEEK_SET);	f_tocbuff = (TOC *) malloc(ntohl(f_cookie.TOClen));	if (f_tocbuff == NULL) 	{		FATALERROR("Could not allocate buffer for TOC.");		return -1;	}	fread(f_tocbuff, ntohl(f_cookie.TOClen), 1, f_fp);	f_tocend = (TOC *) (((char *)f_tocbuff) + ntohl(f_cookie.TOClen));	/* Check input file is still ok (should be). */	if (ferror(f_fp))	{		FATALERROR("Error on file");		return -1;	}	return 0;}
开发者ID:ludisnet,项目名称:ludisoft,代码行数:58,


示例10: value

double AdaptiveMeshAsciiFile::value(int g) const{    // verify index range    if (g < 0) throw FATALERROR("Field index out of range");    if (g >= _columns.size()) throw FATALERROR("Insufficient number of field values in mesh data");    // get the appropriate column value    bool ok;    double value = _columns.value(g).toDouble(&ok);    if (!ok) throw FATALERROR("Invalid leaf line in mesh data");    return value;}
开发者ID:wsaftly,项目名称:SKIRT-1,代码行数:12,


示例11: buildFontEnumCache

/****************************************************************************PARAMETERS:dcache  - local cache for one directorycache   - pointer to variable that holds list of found familiesREMARKS:Extracts information from dcache and translates it to cache.This involves finding fonts with same family name and merging them intoone entry in cache.Called exclusively by enumFontsInDir.{secret}****************************************************************************/static void buildFontEnumCache(    dirCache *dcache,    fontEnumCache **cache){    fontEnumCache  *ecache, *tail;    size_t         i;    fileCache      *f;    if (dcache->filesCnt == 0)        return;    qsort(dcache->files, dcache->filesCnt, sizeof(fileCache),          comparFileCacheByFamily);    tail = ecache = NULL;    for (i = 0, f = dcache->files; i < dcache->filesCnt; i++, f++) {        /* new family: */        if (tail == NULL ||                    strcmp(tail->info.familyName, f->familyName) != 0) {            if (tail == NULL) {                if ((tail = ecache = PM_malloc(sizeof(fontEnumCache))) == NULL)                    FATALERROR(grNoMem);                }            else {                if ((tail->next = PM_malloc(sizeof(fontEnumCache))) == NULL)                    FATALERROR(grNoMem);                tail = tail->next;                }            tail->next = NULL;            strcpy(tail->info.familyName, f->familyName);            tail->info.fontLibType = f->fontLibType;            tail->info.isFixed = f->isFixed;            tail->info.regularFace[0] = '/0';            tail->info.boldFace[0] = '/0';            tail->info.italicFace[0] = '/0';            tail->info.boldItalicFace[0] = '/0';            }        /* faces lookup: */        if (!f->isBold && !f->isItalic)            strcpy(tail->info.regularFace, f->fileName);        else if (f->isBold && !f->isItalic)            strcpy(tail->info.boldFace, f->fileName);        else if (!f->isBold && f->isItalic)            strcpy(tail->info.italicFace, f->fileName);        else if (f->isBold && f->isItalic)            strcpy(tail->info.boldItalicFace, f->fileName);        }    tail->next = *cache;    *cache = ecache;}
开发者ID:OS2World,项目名称:DEV-UTIL-MGL,代码行数:64,


示例12: Init_Env

voidInit_Env(GMC_ARG_VOID){   tps_FileName FileName;   boolean Abort;   size_t sz;   OdinDirName = GetEnv("ODINCACHE");   FORBIDDEN(OdinDirName == NIL);   if (!IsDirectory_FileName(OdinDirName)) {      SystemError("Odin root <%s> does not exist./n", OdinDirName);      FATALERROR("");}/*if*/;   if (OdinDirName[0] != '/') {      SystemError("Odin cache pathname <%s> must be absolute./n", OdinDirName);      FATALERROR("");}/*if*/;   Set_ModeMask(OdinDirName);   sz = snprintf(FileName, MAX_FileName, "%s/FILES", OdinDirName);   if (sz >= MAX_FileName) {      (void)fprintf(stderr, "File name too long (MAX_FileName=%d): %s/FILES/n",                  MAX_FileName, OdinDirName);      exit(1); }/*if*/;   CacheDirName = Malloc_Str(FileName);   MakeDirFile(&Abort, CacheDirName);   if (Abort) FATALERROR("cannot create odin FILES directory");   sz = snprintf(FileName, MAX_FileName, "%s/JOBS", OdinDirName);   if (sz >= MAX_FileName) {      (void)fprintf(stderr, "File name too long (MAX_FileName=%d): %s/JOBS/n",                  MAX_FileName, OdinDirName);      exit(1); }/*if*/;   JobsDirName = Malloc_Str(FileName);   MakeDirFile(&Abort, JobsDirName);   if (Abort) FATALERROR("cannot create odin JOBS directory");   sz = snprintf(FileName, MAX_FileName, "%s/ENV", OdinDirName);   if (sz >= MAX_FileName) {      (void)fprintf(stderr, "File name too long (MAX_FileName=%d): %s/ENV/n",		  MAX_FileName, OdinDirName);      exit(1); }/*if*/;   Read_Env(FileName);   DumpCore = (GetEnv("DUMPCORE") != NIL);   RBS_Cmd = GetEnv("ODIN_RBSCMD");   FORBIDDEN(RBS_Cmd == NIL);   ShortCacheNameFlag = (GetEnv("ODIN_SHORTNAMES") != NIL);   LocalIPCFlag = (GetEnv("ODIN_LOCALIPC") != NIL);   }/*Init_Env*/
开发者ID:urnest,项目名称:urnest,代码行数:48,


示例13: _MGL_destroyWindowedDC

/****************************************************************************PARAMETERS:dc  - Device context to destroyRETURNS:True if the context was destroyed, false on error.REMARKS:Searches for the windowed device context in the list of currently allocatedcontexts, and destroys it if it exists.{secret}****************************************************************************/ibool _MGL_destroyWindowedDC(    MGLDC *dc){    MGLDC   *prev;    PM_HWND hwndConsole;    /* Remove the DC from the list of allocated memory DC's */    if (!dc) {        FATALERROR(grInvalidDC);        return false;        }    if ((prev = _LST_findNode(_MGL_winDCList,dc)) == NULL) {        __MGL_result = grInvalidDC;        return false;        }    /* Unhook any window procedures that are hooked */    _MGL_unhookWindowProc(dc);    /* Free up all memory occupied by the DC */    if (_MGL_winDCList->count == 1) {        /* This is the last windowed device context, so destroy the list */        if (dc != _LST_first(_MGL_winDCList)) {            FATALERROR(grInvalidDC);            return false;            }        hwndConsole = (PM_HWND)dc->v->d.hwnd;        dc->v->d.restoreTextMode(dc);        _MGL_freeInternalDCVars(dc);        dc->v->w.destroy(dc);        _LST_destroy(_MGL_winDCList,_LST_freeNode);        _MGL_winDCList = NULL;        /* Restore the console state and close it */        PM_closeConsole(hwndConsole);        /* We are no longer in Windows full screen mode but on the desktop */        if (_MGL_consoleSupport)            _MS_setDisplayDC(NULL);        }    else {        _MGL_freeInternalDCVars(dc);        dc->v->w.destroy(dc);        _LST_removeNext(_MGL_winDCList,prev);        _LST_freeNode(dc);        }    return true;}
开发者ID:OS2World,项目名称:DEV-UTIL-MGL,代码行数:60,


示例14: FATALERROR

void BinTreeDustGridStructure::setupSelfBefore(){    TreeDustGridStructure::setupSelfBefore();    if (searchMethod() == TreeDustGridStructure::Bookkeeping)        throw FATALERROR("Bookkeeping method is not compatible with binary tree");}
开发者ID:wsaftly,项目名称:SKIRT-1,代码行数:7,


示例15: extract2fs

/* * extract from the archive * and copy to the filesystem * relative to the directory the archive's in */int extract2fs(ARCHIVE_STATUS *status, TOC *ptoc){	FILE *out;	unsigned char *data = extract(status, ptoc);    if (createTempPath(status) == -1){        return -1;    }	out = openTarget(status->temppath, ptoc->name);	if (out == NULL)  {		FATALERROR("%s could not be extracted!/n", ptoc->name);		return -1;	}	else {		fwrite(data, ntohl(ptoc->ulen), 1, out);#ifndef WIN32		fchmod(fileno(out), S_IRUSR | S_IWUSR | S_IXUSR);#endif		fclose(out);	}	free(data);	return 0;}
开发者ID:CNCBASHER,项目名称:LasaurApp,代码行数:30,


示例16: setupSelfBefore

void PowerLawGrainSizeDistribution::setupSelfBefore(){    RangeGrainSizeDistribution::setupSelfBefore();    // verify the attributes    if (_gamma <= 0) throw FATALERROR("The exponent must be positive");}
开发者ID:DukhangLee,项目名称:SKIRT,代码行数:7,


示例17: sprintf

/*  * extract an archive entry * returns pointer to the data (must be freed) */unsigned char *extract(TOC *ptoc){	unsigned char *data;	unsigned char *tmp;	char msg[400];	sprintf( msg, " extracting %1.20s (%d, %c)/n", ptoc->name, ptoc->cflag, ptoc->typcd);	//VS(msg);	fseek(f_fp, f_pkgstart + ntohl(ptoc->pos), SEEK_SET);	data = (unsigned char *)malloc(ntohl(ptoc->len));	if (data == NULL) {		OTHERERROR("Could not allocate read buffer/n");		return NULL;	}	fread(data, ntohl(ptoc->len), 1, f_fp);	if (ptoc->cflag == '/1') {#ifndef NOZLIB		tmp = decompress(data, ptoc);		free(data);		data = tmp;		if (data == NULL) {			sprintf(msg, "Error decompressing %s/n", ptoc->name);			OTHERERROR(msg);			return NULL;		}#else		FATALERROR("No ZLIB support but archive uses compression/n");		return NULL;#endif	}	return data;}
开发者ID:ludisnet,项目名称:ludisoft,代码行数:36,


示例18: __MGL_destroyDC

/****************************************************************************PARAMETERS:list    - List to destroy the context fromdc      - Device context to destroyRETURNS:True if the context was destroyed, false on error.REMARKS:Searches for the device context in the list of currently allocated contexts,and destroys it if it exists. If there are now more contexts in the list,the list itself is destroyed.{secret}****************************************************************************/ibool __MGL_destroyDC(    LIST **listHandle,    MGLDC *dc){    LIST    *list = *listHandle;    MGLDC   *prev;    /* Remove the DC from the list of allocated DC's */    CHECK(dc != NULL);    if ((prev = _LST_findNode(list,dc)) == NULL) {        FATALERROR(grInvalidDC);        return false;        }    _LST_removeNext(list,prev);    /* Free up all memory occupied by the DC */    if (dc->offBuf)        MGL_destroyBuffer(dc->offBuf);    _MGL_freeInternalDCVars(dc);    if (dc->v->m.destroy)        dc->v->m.destroy(dc);    _LST_freeNode(dc);    /* If this is the last device context, destroy the list */    if (list->count == 0) {        _LST_destroy(list,_LST_freeNode);        *listHandle = NULL;        }    return true;}
开发者ID:OS2World,项目名称:DEV-UTIL-MGL,代码行数:44,


示例19: FATALERROR

void ParameterRange::setupSelfBefore(){    SimulationItem::setupSelfBefore();    if (_maximumValue < _minimumValue)        throw FATALERROR("Maximum value of parameter range must be larger or equal than minimum value");}
开发者ID:wsaftly,项目名称:SKIRT-1,代码行数:7,


示例20: Zoltan_Timer_Init

int Zoltan_Timer_Init(  ZTIMER *zt,           /* Ptr to Timer object */  int use_barrier,      /* Flag indicating whether to perform a                            barrier operation before starting the                           timer. */  const char *name            /* Name of this timer */){/* Function that returns the index of the next available Timer timer. */int ret;static char *yo = "Zoltan_Timer_Init";  TESTTIMER(zt, yo);    ret = zt->NextTimeStruct++;  if (ret >= zt->Length) {    /* Realloc -- need more individual timers */    zt->Length += INITLENGTH;    zt->Times = (ZTIMER_TS *) ZOLTAN_REALLOC(zt->Times, zt->Length * sizeof(ZTIMER_TS));  }  Zoltan_Timer_Reset(zt, ret, use_barrier, name);#ifdef VAMPIR  if (VT_funcdef(name, VT_NOCLASS, &((zt->Times[ret]).vt_handle)) != VT_OK)      FATALERROR(yo, "VT_funcdef failed.");#endif  return ret;}
开发者ID:00liujj,项目名称:trilinos,代码行数:31,


示例21: main

int main(int argc, char** argv){    QCoreApplication app(argc, argv);    if (argc == 2)    {        // Create new solver        Solver* solver = new Solver;        // Initialize and run        solver->initialize(app.arguments().at(1));        solver->run();        solver->uninitialize();        // Clean up        delete solver;        solver = NULL;    }    else    {        FATALERROR("Invalid arguments");    }    return 0;}
开发者ID:qroph,项目名称:motion-solver,代码行数:26,


示例22: get_thisfile

int get_thisfile(char *thisfile, const char *programname){    char buf[_MAX_PATH];    char *p;    /* Fill in thisfile. */#ifdef __CYGWIN__    if (strncasecmp(&programname[strlen(programname)-4], ".exe", 4)) {        strcpy(thisfile, programname);        strcat(thisfile, ".exe");        PI_SetProgramName(thisfile);    }    else#endif    PI_SetProgramName(programname);    strcpy(buf, PI_GetProgramFullPath());    /* Make homepath absolute.     * 'thisfile' starts ./ which breaks some modules when changing the CWD.     */    p = realpath(buf, thisfile);    if(p == NULL) {        FATALERROR("Error in making thisfile absolute./n");        return -1;    }    VS("thisfile is %s/n", thisfile);        return 0;}
开发者ID:3xp10it,项目名称:evlal_win,代码行数:31,


示例23: pyi_win32_wcs_to_mbs

char * pyi_win32_wcs_to_mbs(const wchar_t *wstr) {    DWORD len, ret;    char * str;    /* NOTE: setlocale hysterics are not needed on Windows - this function       has an explicit codepage parameter. CP_ACP means "current ANSI codepage"       which is set in the "Language for Non-Unicode Programs" control panel setting. */    /* Get buffer size by passing NULL and 0 for output arguments */    len = WideCharToMultiByte(CP_ACP,    // CodePage                              0,         // dwFlags                              wstr,      // lpWideCharStr                              -1  ,      // cchWideChar - length in chars                              NULL,      // lpMultiByteStr                              0,         // cbMultiByte - length in bytes                              NULL,      // lpDefaultChar                              NULL       // lpUsedDefaultChar                              );    if(0 == len) {        FATALERROR("Failed to get ANSI buffer size"                   "(WideCharToMultiByte: %s)",                   GetWinErrorString()                   );        return NULL;    }    str = (char *)malloc(sizeof(char) * wcslen(wstr) + 1);    ret = WideCharToMultiByte(CP_ACP,    // CodePage                              0,         // dwFlags                              wstr,      // lpWideCharStr                              -1,        // cchWideChar - length in chars                              str,       // lpMultiByteStr                              len,       // cbMultiByte - length in bytes                              NULL,      // lpDefaultChar                              NULL       // lpUsedDefaultChar                              );    if(0 == ret) {        FATALERROR("Failed to encode filename as ANSI"                   "(WideCharToMultiByte: %s)",                   GetWinErrorString()                   );        return NULL;    }    return str;}
开发者ID:DerrickMeyer27,项目名称:pyinstaller,代码行数:47,


示例24:

voidSpheroidalGeometry::setupSelfBefore(){    AxGeometry::setupSelfBefore();    // verify property values    if (_q <= 0 || _q > 1.0) throw FATALERROR("the flattening parameter q should be between 0 and 1");}
开发者ID:wsaftly,项目名称:SKIRT-1,代码行数:8,


示例25: ntohl

/* * Return pointer to next toc entry. */TOC *incrementTocPtr(TOC* ptoc){	TOC *result = (TOC*)((char *)ptoc + ntohl(ptoc->structlen));	if (result < f_tocbuff) {		FATALERROR("Cannot read Table of Contents./n");		return f_tocend;	}	return result;}
开发者ID:C4rt,项目名称:pyinstaller,代码行数:12,


示例26: get_thisfile

int get_thisfile(char *thisfile, const char *programname){	if (!GetModuleFileNameA(NULL, thisfile, _MAX_PATH)) {		FATALERROR("System error - unable to load!");		return -1;	}		return 0;}
开发者ID:Matt-Esch,项目名称:anaconda,代码行数:9,


示例27: ntohl

/* * Return pointer to next toc entry. */TOC *incrementTocPtr(ARCHIVE_STATUS *status, TOC* ptoc){	TOC *result = (TOC*)((char *)ptoc + ntohl(ptoc->structlen));	if (result < status->tocbuff) {		FATALERROR("Cannot read Table of Contents./n");		return status->tocend;	}	return result;}
开发者ID:CNCBASHER,项目名称:LasaurApp,代码行数:12,


示例28: get_thisfilew

int get_thisfilew(LPWSTR thisfilew){	if (!GetModuleFileNameW(NULL, thisfilew, _MAX_PATH)) {		FATALERROR("System error - unable to load!");		return -1;	}		return 0;}
开发者ID:Matt-Esch,项目名称:anaconda,代码行数:9,


示例29: fseek

/* * extract an archive entry * returns pointer to the data (must be freed) */unsigned char *extract(TOC *ptoc){	unsigned char *data;	unsigned char *tmp;	fseek(f_fp, f_pkgstart + ntohl(ptoc->pos), SEEK_SET);	data = (unsigned char *)malloc(ntohl(ptoc->len));	if (data == NULL) {		OTHERERROR("Could not allocate read buffer/n");		return NULL;	}	fread(data, ntohl(ptoc->len), 1, f_fp);	if (ptoc->cflag == '/2') {		PyObject *func_new;		PyObject *aes_dict;		PyObject *aes_obj;		PyObject *ddata;		long block_size;		char *iv;		if (!AES)			AES = PI_PyImport_ImportModule("AES");		aes_dict = PI_PyModule_GetDict(AES);		func_new = PI_PyDict_GetItemString(aes_dict, "new");		block_size = PI_PyInt_AsLong(PI_PyDict_GetItemString(aes_dict, "block_size"));		iv = malloc(block_size);		memset(iv, 0, block_size);		aes_obj = PI_PyObject_CallFunction(func_new, "s#Os#",			data, 32,			PI_PyDict_GetItemString(aes_dict, "MODE_CFB"),			iv, block_size);		ddata = PI_PyObject_CallMethod(aes_obj, "decrypt", "s#", data+32, ntohl(ptoc->len)-32);		memcpy(data, PI_PyString_AsString(ddata), ntohl(ptoc->len)-32);		Py_DECREF(aes_obj);		Py_DECREF(ddata);		VS("decrypted ");		VS(ptoc->name);		VS("/n");	}	if (ptoc->cflag == '/1' || ptoc->cflag == '/2') {#ifndef NOZLIB		tmp = decompress(data, ptoc);		free(data);		data = tmp;		if (data == NULL) {			OTHERERROR("Error decompressing %s/n", ptoc->name);			return NULL;		}#else		FATALERROR("No ZLIB support but archive uses compression/n");		return NULL;#endif	}	return data;}
开发者ID:C4rt,项目名称:pyinstaller,代码行数:61,



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


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