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


C++ REPORT_ERROR函数代码示例

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


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

示例1: file

QMap<QString, QVariant> SimpleMessageStyle::styleInfo(const QString &AStylePath)
{
	QMap<QString, QVariant> info;

	QFile file(AStylePath+"/Info.plist");
	if (!AStylePath.isEmpty() && file.open(QFile::ReadOnly))
	{
		QString xmlError;
		QDomDocument doc;
		if (doc.setContent(&file,true,&xmlError))
		{
			QDomElement elem = doc.documentElement().firstChildElement("dict").firstChildElement("key");
			while (!elem.isNull())
			{
				QString key = elem.text();
				if (!key.isEmpty())
				{
					elem = elem.nextSiblingElement();
					if (elem.tagName() == "string")
						info.insert(key,elem.text());
					else if (elem.tagName() == "integer")
						info.insert(key,elem.text().toInt());
					else if (elem.tagName() == "true")
						info.insert(key,true);
					else if (elem.tagName() == "false")
						info.insert(key,false);
				}
				elem = elem.nextSiblingElement("key");
			}
		}
		else
		{
			LOG_ERROR(QString("Failed to load simple style info from file content: %1").arg(xmlError));
		}
	}
	else if (AStylePath.isEmpty())
	{
		REPORT_ERROR("Failed to get simple style info: Style path is empty");
	}
	else
	{
		LOG_ERROR(QString("Failed to load simple style info from file: %1").arg(file.errorString()));
	}
	return info;
}
开发者ID:Ardaq,项目名称:vacuum-im,代码行数:45,代码来源:simplemessagestyle.cpp

示例2: u

void GeostrophicRelation::run(const SingleLevelField &ghs,
                              const TimeLevelIndex &timeIdx,
                              const Field &gd, Field &u, Field &v) {
    const Mesh &mesh = static_cast<const Mesh&>(ghs.getMesh());
    const Domain &domain = static_cast<const Domain&>(mesh.getDomain());
    double Re = domain.getRadius();
    int js = 0, jn = mesh.getNumGrid(1, FULL)-1;
    // -------------------------------------------------------------------------
    if (u.getStaggerLocation() == CENTER &&
        v.getStaggerLocation() == CENTER) {
        double dlon = mesh.getGridInterval(0, FULL, 0);
        double dlat = mesh.getGridInterval(1, FULL, 1); // assume equidistant grids
        // normal grids
        for (int j = 1; j < mesh.getNumGrid(1, FULL)-1; ++j) {
            double cosLat = mesh.getCosLat(FULL, j);
            double f = 2*OMEGA*mesh.getSinLat(FULL, j);
            for (int i = 0; i < mesh.getNumGrid(0, FULL); ++i) {
                if (fabs(f) <= 1.0e-15) {
                    u(timeIdx, i, j) = 0;
                    v(timeIdx, i, j) = 0;
                } else {
                    double dgdLon = gd(timeIdx, i+1, j)-gd(timeIdx, i-1, j);
                    double dgdLat = gd(timeIdx, i, j+1)-gd(timeIdx, i, j-1);
                    double dghsLon = ghs(i+1, j)-ghs(i-1, j);
                    double dghsLat = ghs(i, j+1)-ghs(i, j-1);
                    u(timeIdx, i, j) = -(dgdLat+dghsLat)/(f*Re*2*dlat);
                    v(timeIdx, i, j) =  (dgdLon+dghsLon)/(f*Re*cosLat*2*dlon);
                }
            }
        }
        // pole grids
        for (int i = 0; i < mesh.getNumGrid(0, FULL); ++i) {
            u(timeIdx, i, js) = 0;
            u(timeIdx, i, jn) = 0;
            v(timeIdx, i, js) = 0;
            v(timeIdx, i, jn) = 0;
        }
    } else if (u.getStaggerLocation() == X_FACE &&
               v.getStaggerLocation() == Y_FACE) {
        REPORT_ERROR("Under construction!");
    }
    // -------------------------------------------------------------------------
    u.applyBndCond(timeIdx);
    v.applyBndCond(timeIdx);
}
开发者ID:huyong1109,项目名称:barotropic-model,代码行数:45,代码来源:GeostrophicRelation.cpp

示例3: acpi_ds_scope_stack_push

acpi_status
acpi_ds_scope_stack_push (
	acpi_namespace_node     *node,
	acpi_object_type8       type,
	acpi_walk_state         *walk_state)
{
	acpi_generic_state      *scope_info;


	FUNCTION_TRACE ("Ds_scope_stack_push");


	if (!node) {
		/* Invalid scope   */

		REPORT_ERROR (("Ds_scope_stack_push: null scope passed\n"));
		return_ACPI_STATUS (AE_BAD_PARAMETER);
	}

	/* Make sure object type is valid */

	if (!acpi_ex_validate_object_type (type)) {
		REPORT_WARNING (("Ds_scope_stack_push: type code out of range\n"));
	}


	/* Allocate a new scope object */

	scope_info = acpi_ut_create_generic_state ();
	if (!scope_info) {
		return_ACPI_STATUS (AE_NO_MEMORY);
	}

	/* Init new scope object */

	scope_info->common.data_type = ACPI_DESC_TYPE_STATE_WSCOPE;
	scope_info->scope.node      = node;
	scope_info->common.value    = (u16) type;

	/* Push new scope object onto stack */

	acpi_ut_push_generic_state (&walk_state->scope_info, scope_info);

	return_ACPI_STATUS (AE_OK);
}
开发者ID:TitaniumBoy,项目名称:lin,代码行数:45,代码来源:dswscope.c

示例4: ImgRegionRscSize

extern "C" void gxpport_loadimmutable_from_platformbuffer
(unsigned char* srcBuffer, int length, jboolean isStatic,
 int* ret_imgWidth, int* ret_imgHeight,
 gxpport_image_native_handle *newImmutableImagePtr,
 gxutl_native_image_error_codes* creationErrorPtr) {

    int rscSize;
    gxutl_image_buffer_raw* dataBuffer = (gxutl_image_buffer_raw*)srcBuffer;

    /* Check resource limit */
    rscSize = ImgRegionRscSize(NULL, dataBuffer->width, dataBuffer->height);
    if (midpCheckResourceLimit(RSC_TYPE_IMAGE_IMMUT, rscSize) == 0) {
        /* Exceed Resource limit */
        *creationErrorPtr = GXUTL_NATIVE_IMAGE_RESOURCE_LIMIT;
        return;
    }

    _Platform_ImmutableImage* immutableImage =
        (_Platform_ImmutableImage*)midpMalloc(sizeof(_Platform_ImmutableImage));
    if (immutableImage == NULL) {
        *creationErrorPtr = GXUTL_NATIVE_IMAGE_OUT_OF_MEMORY_ERROR;
        return;
    }

    if (!load_raw(&immutableImage->qimage,
                dataBuffer,
                length, isStatic,
                ret_imgWidth, ret_imgHeight)) {
	midpFree(immutableImage);
        *creationErrorPtr = GXUTL_NATIVE_IMAGE_DECODING_ERROR;
        return;
    }

    /* Image creation succeeds */
    if (midpIncResourceCount(RSC_TYPE_IMAGE_IMMUT, rscSize) == 0) {
        REPORT_ERROR(LC_LOWUI, "Error in updating resource limit"
                     " for Immutable image");
    }
            
    immutableImage->marker = 7;
    immutableImage->qpixmap = NULL;

    *newImmutableImagePtr = immutableImage;
    *creationErrorPtr = GXUTL_NATIVE_IMAGE_NO_ERROR;
}
开发者ID:jiangxilong,项目名称:yari,代码行数:45,代码来源:gxpportqt_immutableimage.cpp

示例5: SetUp

    //init metadatas
    virtual void SetUp()
    {

        try
        {
            //get example images/staks
            if (chdir(((String)(getXmippPath() + (String)"/resources/test")).c_str())==-1)
            	REPORT_ERROR(ERR_UNCLASSIFIED,"Could not change directory");
            // testBaseName = xmippPath + "/resources/test";
            imageName = "image/singleImage.spi";

        }
        catch (XmippError &xe)
        {
            std::cerr << xe;
            exit(-1);
        }
    }
开发者ID:I2PC,项目名称:scipion,代码行数:19,代码来源:test_ctf_main.cpp

示例6: FM_PCD_SetPrsStatistics

void FM_PCD_SetPrsStatistics(t_Handle h_FmPcd, bool enable)
{
    t_FmPcd             *p_FmPcd = (t_FmPcd*)h_FmPcd;

    SANITY_CHECK_RETURN(p_FmPcd, E_INVALID_HANDLE);
    SANITY_CHECK_RETURN(p_FmPcd->p_FmPcdPrs, E_INVALID_HANDLE);

    if(p_FmPcd->guestId != NCSW_MASTER_ID)
    {
        REPORT_ERROR(MAJOR, E_NOT_SUPPORTED, ("FM_PCD_SetPrsStatistics - guest mode!"));
        return;
    }
    if(enable)
        WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->ppsc, FM_PCD_PRS_PPSC_ALL_PORTS);
    else
        WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->ppsc, 0);

}
开发者ID:2asoft,项目名称:freebsd,代码行数:18,代码来源:fm_prs.c

示例7: rfind

// Get number from file ....................................................
size_t FileName::getPrefixNumber(size_t pos) const
{
    size_t first = rfind(AT);
    size_t result = ALL_IMAGES;
    if (first != npos)
    {
        std::vector<String> prefixes;
        size_t nPref = splitString(substr(0, first),",",prefixes, false);

        if (pos > nPref-1)
            REPORT_ERROR(ERR_ARG_INCORRECT, formatString("getPrefixNumber: Selected %lu position greater than %lu positions \n"
                         " detected in %s filename.",pos+1, nPref, this->c_str()));

        if (isdigit(prefixes[pos].at(0)))
            result = textToSizeT(prefixes[pos].c_str());
    }
    return result;
}
开发者ID:I2PC,项目名称:scipion,代码行数:19,代码来源:xmipp_filename.cpp

示例8: REPORT_ERROR

void EditProfilesDialog::onRenameProfileClicked()
{
	QListWidgetItem *listItem = ui.lstProfiles->selectedItems().value(0);
	if (listItem)
	{
		bool ok;
		QString profile = listItem->text();
		QString newname = QInputDialog::getText(this,tr("Rename Profile"),tr("Enter new name for profile:"),QLineEdit::Normal,QString::null,&ok);
		if (ok && !newname.isEmpty())
		{
			if (!FOptionsManager->renameProfile(profile, newname))
			{
				REPORT_ERROR("Failed to rename profile");
				QMessageBox::warning(this,tr("Error"),tr("Failed to rename profile"));
			}
		}
	}
}
开发者ID:RoadWorksSoftware,项目名称:eyecu-qt,代码行数:18,代码来源:editprofilesdialog.cpp

示例9: SetFilePointer

void FileLock::unlock()
{
    if (islocked)
    {
#ifdef __MINGW32__
        HANDLE hFile = (HANDLE)_get_osfhandle(filenum);
        DWORD dwLastPos = SetFilePointer(hFile, 0, NULL, FILE_END);
        if (UnlockFile(hFile, 0, 0, dwLastPos, 0) != NULL)
            REPORT_ERROR(ERR_IO_LOCKED,"File cannot be unlocked.");
#else

        fl.l_type = F_UNLCK;
        fcntl(filenum, F_SETLK, &fl);
#endif

        islocked = false;
    }
}
开发者ID:I2PC,项目名称:scipion,代码行数:18,代码来源:xmipp_filename.cpp

示例10: read

	void read(int argc, char **argv)
	{

		parser.setCommandLine(argc, argv);

		int general_section = parser.addSection("General options");
	    fn_star = parser.getOption("--i", "Input STAR file with the images (as rlnImageName) to be saved in a stack");
	    fn_root = parser.getOption("--o", "Output rootname","output");
	    do_spider  = parser.checkOption("--spider_format", "Write out in SPIDER stack format (by default MRC stack format)");
	    do_split_per_micrograph = parser.checkOption("--split_per_micrograph", "Write out separate stacks for each micrograph (needs rlnMicrographName in STAR file)");
	    do_apply_trans = parser.checkOption("--apply_transformation", "Apply the inplane-transformations (needs _rlnOriginX/Y and _rlnAnglePsi in STAR file)");

	    fn_ext = (do_spider) ? ".spi" : ".mrcs";

      	// Check for errors in the command-line option
    	if (parser.checkForErrors())
    		REPORT_ERROR("Errors encountered on the command line, exiting...");
	}
开发者ID:dtegunov,项目名称:vlion,代码行数:18,代码来源:stack_create.cpp

示例11: acpi_ut_resolve_package_references

acpi_status
acpi_ut_resolve_package_references (
	acpi_operand_object     *obj_desc)
{
	u32                     count;
	acpi_operand_object     *sub_object;


	FUNCTION_TRACE ("Ut_resolve_package_references");


	if (obj_desc->common.type != ACPI_TYPE_PACKAGE) {
		/* The object must be a package */

		REPORT_ERROR (("Must resolve Package Refs on a Package\n"));
		return_ACPI_STATUS(AE_ERROR);
	}

	/*
	 * TBD: what about nested packages? */

	for (count = 0; count < obj_desc->package.count; count++) {
		sub_object = obj_desc->package.elements[count];

		if (sub_object->common.type == INTERNAL_TYPE_REFERENCE) {
			if (sub_object->reference.opcode == AML_ZERO_OP) {
				sub_object->common.type = ACPI_TYPE_INTEGER;
				sub_object->integer.value = 0;
			}

			else if (sub_object->reference.opcode == AML_ONE_OP) {
				sub_object->common.type = ACPI_TYPE_INTEGER;
				sub_object->integer.value = 1;
			}

			else if (sub_object->reference.opcode == AML_ONES_OP) {
				sub_object->common.type = ACPI_TYPE_INTEGER;
				sub_object->integer.value = ACPI_INTEGER_MAX;
			}
		}
	}

	return_ACPI_STATUS(AE_OK);
}
开发者ID:TKr,项目名称:Wive-ng-rt8186,代码行数:44,代码来源:utmisc.c

示例12: javanotify_install_midlet_wparams

/**
 * A notification function for telling Java to perform installation of
 * a MIDlet with parameters
 *
 * If the given url is of the form http://www.sun.com/a/b/c/d.jad then
 * java will start a graphical installer will download the MIDlet
 * fom the internet.
 * If the given url is a file url (see below, file:///a/b/c/d.jar or
 * file:///a/b/c/d/jad) installation will be performed
 * in the backgroudn without launching the graphic installer application
 *
 *
 * @param url of MIDlet to install, can be either one of the following
 *   1. A full path to the jar file, of the following form file:///a/b/c/d.jar
 *   2. A full path to the JAD file, of the following form file:///a/b/c/d.jad
 *   3. An http url of jad file, of the following form,
 *      http://www.sun.com/a/b/c/d.jad
 * @param silentInstall install the MIDlet without user interaction
 * @param forceUpdate install the MIDlet even if it already exist regardless
 *                    of version
 */
void javanotify_install_midlet_wparams(const char* httpUrl,
                                       int silentInstall, int forceUpdate) {
    int argc = 0;
    char *argv[MIDP_RUNMIDLET_MAXIMUM_ARGS];
    javacall_result res;
    int length;

    REPORT_INFO2(LC_CORE,"javanotify_install_midlet_wparams() >> "
                         "httpUrl = %s, silentInstall = %d\n",
                 httpUrl, silentInstall);

    JVM_Initialize();

    if (initialize_memory_slavemode() != JAVACALL_OK) {
        return;
    }

    argv[argc++] = "runMidlet";
    argv[argc++] = "-1";
    argv[argc++] = "com.sun.midp.installer.GraphicalInstaller";

    if (silentInstall == 1) {
        if (forceUpdate == 1) {
            argv[argc++] = "FU";
        } else {
            argv[argc++] = "FI";
        }
    } else {
        argv[argc++] = "I";
    }

    length = strlen(httpUrl);
    if (length >= BINARY_BUFFER_MAX_LEN) {
        REPORT_ERROR(LC_AMS, "javanotify_install_midlet_wparams(): httpUrl is too long");
        return;
    }

    memset(urlAddress, 0, BINARY_BUFFER_MAX_LEN);
    memcpy(urlAddress, httpUrl, length);
    argv[argc++] = urlAddress;

    javacall_lifecycle_state_changed(JAVACALL_LIFECYCLE_MIDLET_STARTED, JAVACALL_OK);
    res = runMidlet(argc, argv);
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:65,代码来源:javanotify_lifecycle.c

示例13: kaiser_proj

/* Value of line integral through Kaiser-Bessel radial function
   (n >=2 dimensions) at distance s from center of function.
   Parameter m = 0, 1, or 2. */
double kaiser_proj(double s, double a, double alpha, int m)
{
    double sda, sdas, w, arg, p;

    sda = s / a;
    sdas = sda * sda;
    w = 1.0 - sdas;
    if (w > 1.0e-10)
    {
        arg = alpha * sqrt(w);
        if (m == 0)
        {
            if (alpha == 0.0)
                p = 2.0 * a * sqrt(w);
            else
                p = (2.0 * a / alpha) * sinh(arg) / bessi0(alpha);

        }
        else if (m == 1)
        {
            if (alpha == 0.0)
                p = 2.0 * a * w * sqrt(w) * (2.0 / 3.0);
            else
                p = (2.0 * a / alpha) * sqrt(w) * (cosh(arg) - sinh(arg) / arg)
                    / bessi1(alpha);

        }
        else if (m == 2)
        {
            if (alpha == 0.0)
                p = 2.0 * a * w * w * sqrt(w) * (8.0 / 15.0);
            else
                p = (2.0 * a / alpha) * w *
                    ((3.0 / (arg * arg) + 1.0) * sinh(arg) - (3.0 / arg) * cosh(arg)) / bessi2(alpha);
        }
        else
            REPORT_ERROR(ERR_VALUE_INCORRECT, "m out of range in kaiser_proj()");

    }
    else
        p = 0.0;

    return p;
}
开发者ID:josegutab,项目名称:scipion,代码行数:47,代码来源:blobs.cpp

示例14: while

// Produce side info =====================================================
void ProgClassifyCL2DCore::produceSideInfo()
{
    // Get maximum CL2D level
    maxLevel=0;
    FileName fnLevel;
    do
        fnLevel=formatString("%s/level_%02d/%s_classes.xmd",fnODir.c_str(),maxLevel++,fnRoot.c_str());
    while (fnLevel.exists());
    maxLevel-=2;
    if (maxLevel==-1)
        REPORT_ERROR(ERR_ARG_MISSING,"Cannot find any CL2D analysis in the directory given");

    // Read all the blocks available in all MetaData
    StringVector blocksAux;
    CL2DBlock block;
    for (int level=0; level<=maxLevel; level++)
    {
        fnLevel=formatString("%s/level_%02d/%s_classes.xmd",fnODir.c_str(),level,fnRoot.c_str());
        getBlocksInMetaDataFile(fnLevel,blocksAux);
        block.level=level;
        block.fnLevel=fnLevel;
        block.fnLevelCore=fnLevel.insertBeforeExtension("_core");
        for (size_t i=0; i<blocksAux.size(); i++)
        {
            if (blocksAux[i].find("class")!=std::string::npos && 
                blocksAux[i].find("images")!=std::string::npos)
            {
                block.block=blocksAux[i];
                blocks.push_back(block);
            }
        }
    }

    // Create a task file distributor for all blocks
    size_t Nblocks=blocks.size();
    taskDistributor=new MpiTaskDistributor(Nblocks,1,node);

    // Get image dimensions
    if (Nblocks>0)
    {
        size_t Zdim, Ndim;
        getImageSizeFromFilename(blocks[0].block+"@"+blocks[0].fnLevel,Xdim,Ydim,Zdim,Ndim);
    }
}
开发者ID:I2PC,项目名称:scipion,代码行数:45,代码来源:mpi_classify_CL2D_core_analysis.cpp

示例15: DbgSetRopFlag

STATUS
DbgSetRopFlag(
	VOID
	)
{
    ERRORINFO err;

	/* set the ROP flag */
	bRopDetected = TRUE;

	/* init log path */
	if ( InitLogPath( MCEDP_REGCONFIG.LOG_PATH, MAX_PATH ) != MCEDP_STATUS_SUCCESS )
	{
		REPORT_ERROR("InitLogPath()", &err);
		return MCEDP_STATUS_GENERAL_FAIL;
	}

	return MCEDP_STATUS_SHELLCODE_FLAG_SET;
}
开发者ID:ltfish,项目名称:Pwnypot,代码行数:19,代码来源:RopDetection.cpp


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