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


C++ CheckError函数代码示例

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


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

示例1: eglChooseConfig

bool CEGLWrapper::ChooseConfig(EGLDisplay display, EGLint *configAttrs, EGLConfig *config)
{
  EGLint     configCount = 0;
  EGLConfig* configList = NULL;

  // Find out how many configurations suit our needs
  EGLBoolean eglStatus = eglChooseConfig(display, configAttrs, NULL, 0, &configCount);
  CheckError();

  if (!eglStatus || !configCount)
  {
    CLog::Log(LOGERROR, "EGL failed to return any matching configurations: %i", configCount);
    return false;
  }

  // Allocate room for the list of matching configurations
  configList = (EGLConfig*)malloc(configCount * sizeof(EGLConfig));
  if (!configList)
  {
    CLog::Log(LOGERROR, "EGL failure obtaining configuration list");
    return false;
  }

  // Obtain the configuration list from EGL
  eglStatus = eglChooseConfig(display, configAttrs, configList, configCount, &configCount);
  CheckError();
  if (!eglStatus || !configCount)
  {
    CLog::Log(LOGERROR, "EGL failed to populate configuration list: %d", eglStatus);
    return false;
  }

  // Select an EGL configuration that matches the native window
  *config = configList[0];

  free(configList);
  return m_result == EGL_SUCCESS;
}
开发者ID:AchimTuran,项目名称:xbmc,代码行数:38,代码来源:EGLWrapper.cpp

示例2: CheckError

int OWStatement::GetInteger( OCINumber* ppoData )
{
    sb4 nRetVal;

    CheckError( OCINumberToInt(
        hError,
        ppoData,
        (uword) sizeof(sb4),
        OCI_NUMBER_SIGNED,
        (dvoid *) &nRetVal ),
        hError );

    return nRetVal;
}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:14,代码来源:oci_wrapper.cpp

示例3: STEAM_BlockForResources

/*
===================================
STEAM_BlockForResources

  Instruct the STEAM resource preload system to get
  the indicated resources and block until all are
  obtained.

  ***NOTE*** THIS BLOCKS (DUH) SO DON'T USE WANTONLY
===================================
*/
int STEAM_BlockForResources( const char *hintlist )
{
	int val = TRUE;

#if STEAM_SYNCHRONIZED_PRELOADING
	{
//		val = SteamHintResourceNeed(hintlist, TRUE, &steamError); // Temporary implementation.
		val = SteamWaitForResources(hintlist, &steamError);
		CheckError(NULL, &steamError);
	}
#endif

	return val;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:25,代码来源:Steam.c

示例4: CheckError

bool CEGLWrapper::CreateSurface(EGLDisplay display, EGLConfig config, EGLSurface *surface)
{
    if (!surface || !m_nativeTypes)
        return false;

    EGLNativeWindowType *nativeWindow=NULL;
    if (!m_nativeTypes->GetNativeWindow((XBNativeWindowType**)&nativeWindow))
        return false;

    *surface = eglCreateWindowSurface(display, config, *nativeWindow, NULL);
    CheckError();

    return *surface != EGL_NO_SURFACE;
}
开发者ID:ugers,项目名称:xbmc,代码行数:14,代码来源:EGLWrapper.cpp

示例5: STEAM_ResumeResourcePreloading

/*
===================================
STEAM_ResumeResourcePreloading

  Resume STEAM resource preloading
===================================
*/
int STEAM_ResumeResourcePreloading(void)
{
	int val = TRUE;

#if STEAM_SYNCHRONIZED_PRELOADING
	{
		val = SteamResumeCachePreloading(&steamError);
		CheckError(NULL, &steamError);
	}
#endif

	return val;

}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:21,代码来源:Steam.c

示例6: CheckError

   int CONetCDF4::getGroup(const CNetCDF4Path & path)
   {
      int retvalue = this->ncidp;
      
      CNetCDF4Path::const_iterator
         it  = path.begin(), end = path.end();

      for (;it != end; it++)
      {
         const std::string & groupid = *it;
         CheckError(nc_inq_ncid(retvalue, const_cast<char*>(groupid.c_str()), &retvalue));
      }
      return (retvalue);
   }
开发者ID:RemiLacroix-IDRIS,项目名称:XIOS,代码行数:14,代码来源:onetcdf4.cpp

示例7: ArrayGetInt_

static int ArrayGetInt_(lua_State *L, GLuint array, GLenum pname, int boolean)
#define ArrayGetInt(L, array, pname) ArrayGetInt_((L), (array), (pname), 0)
#define ArrayGetBoolean(L, array, pname) ArrayGetInt_((L), (array), (pname), 1)
    {
    GLint param;
    GLuint index = luaL_checkinteger(L, 3);
    glGetVertexArrayIndexediv(array, index, pname, &param);
    CheckError(L);
    if(boolean)
        lua_pushboolean(L, param);
    else
        lua_pushinteger(L, param);
    return 1;
    }
开发者ID:stetre,项目名称:moongl,代码行数:14,代码来源:getvertex.c

示例8: InsertServerPrerequisiteForMessageType

int InsertServerPrerequisiteForMessageType(int msgType, vector<string> * v){
	char query[200];
	char * fixedInsertStr;
	unsigned int len;
	int holder;
	char * cTemp;
	MYSQL * conn;

	if(WaitForSingleObject(mysqlMutex, INFINITE) != WAIT_OBJECT_0){
		printf("InsertServerPrerequisiteForMessageType: Couldn't acquire mutex. Returning\n");
		return GENERIC_ERROR;
	}

	conn = OpenDatabaseConnection(gffServerDBName);
	if(conn == NULL){
		printf("InsertServerPrerequisiteForMessageType: OpenDatabaseConnection(gffServerDBName) failed\n");
		v->clear();
		return ReleaseMutexAndReturnError(mysqlMutex, GENERIC_ERROR);
	}

	//For each host to measure in the vector
	for(unsigned int i=0; i < v->size(); i++){
		string temp = v->at(i);
		cTemp = (char *)temp.c_str();

		fixedInsertStr = "INSERT INTO TableVerificationPrerequisiteModules VALUES(NULL,%i,'%s')";
		len = sprintf_s(query, 200, fixedInsertStr, msgType, cTemp);

		//////////////////////////////////
		if(0 != mysql_real_query(conn, query, len)){
			holder = CheckError(conn,mysql_errno(conn));
			
			// if error code is 1062, the entry already exists, so it's ok
			if(holder != 1062){
				CloseDatabaseConnection(conn);
				v->clear();
				return ReleaseMutexAndReturnError(mysqlMutex, holder);
			}
		}

	}
	CloseDatabaseConnection(conn);
	v->clear();
	//////////////////////////////////
	if(!ReleaseMutex(mysqlMutex)){
		printf("InsertServerPrerequisiteForMessageType: Couldn't release mutex. Returning\n");
		return GENERIC_ERROR;
	}
	return GENERIC_SUCCESS;
}
开发者ID:hurryon,项目名称:timing-attestation,代码行数:50,代码来源:database_mysql2.cpp

示例9: GetEnumOptIndex

static int GetEnumOptIndex(lua_State *L, GLenum pname, uint32_t domain) /* index is optional */
    {
    GLint data;
    GLuint index;
    if(!lua_isnoneornil(L, 2))
        {
        index = luaL_checkinteger(L, 2);
        glGetIntegeri_v(pname, index, &data);
        }
    else
        glGetIntegerv(pname, &data);
    CheckError(L);
    return enums_push(L, domain, data);
    }
开发者ID:stetre,项目名称:moongl,代码行数:14,代码来源:get.c

示例10: update

	void Listener::updateListener()
	{
		update();
		if(mParentNode)
		{
			mPosition = mLastParentPosition;
			mDirection = mLastParentOrientation.zAxis();
			mUp = mLastParentOrientation.yAxis();
		}
		alListener3f(AL_POSITION, mPosition.x, mPosition.y, mPosition.z);
		CheckError(alGetError(), "Failed to set Position");

		mOrientation[0]= -mDirection.x; // Forward.x
		mOrientation[1]= -mDirection.y; // Forward.y
		mOrientation[2]= -mDirection.z; // Forward.z

		mOrientation[3]= mUp.x; // Up.x
		mOrientation[4]= mUp.y; // Up.y
		mOrientation[5]= mUp.z; // Up.z

		alListenerfv(AL_ORIENTATION, mOrientation);
		CheckError(alGetError(), "Failed to set Orientation");
	}
开发者ID:barsnadcat,项目名称:steelandconcrete,代码行数:23,代码来源:OgreALListener.cpp

示例11: lck

void AudioChannel::SetVolume(float newVolume)
{
	volume = std::max(newVolume, 0.f);

	if (cur_sources.empty())
		return;

	boost::recursive_mutex::scoped_lock lck(soundMutex);

	for (std::map<CSoundSource*, bool>::iterator it = cur_sources.begin(); it != cur_sources.end(); ++it) {
		it->first->UpdateVolume();
	}
	CheckError("AudioChannel::SetVolume");
}
开发者ID:304471720,项目名称:spring,代码行数:14,代码来源:AudioChannel.cpp

示例12: SetupPendingShaderProgram

void FOpenGLDrv::DrawArrayedPrimitive(GLenum InMode, GLint InStart, GLsizei InCount)
{
	// bind shader program
	SetupPendingShaderProgram();
	// Set Program Parameters
	SetupPendingShaderProgramParameters();
	// Bind Vertex Attributes
	SetupPendingVertexAttributeArray();
	// Setup Texture
	SetupPendingTexture();

	glDrawArrays(InMode, InStart, InCount);
	CheckError(__FILE__, __LINE__);
}
开发者ID:JettHuang,项目名称:JetX,代码行数:14,代码来源:OpenGLDrv.cpp

示例13: LinkProgram

GLint
LinkProgram(GLint vshader, GLint fshader)
{
    GLint program = glCreateProgram();

    glAttachShader(program, vshader);
    glAttachShader(program, fshader);
    glLinkProgram(program);

    // todo return placeholder program instead?
    cpAssertHard(CheckError(program, GL_LINK_STATUS, glGetProgramiv, glGetProgramInfoLog), "Error linking shader program");

    return program;
}
开发者ID:phaikawl,项目名称:projectx1,代码行数:14,代码来源:ChipmunkDebugDraw.cpp

示例14: CheckError

bool CEGLWrapper::InitDisplay(EGLDisplay *display)
{
  if (!display || !m_nativeTypes)
    return false;

  //nativeDisplay can be (and usually is) NULL. Don't use if(nativeDisplay) as a test!
  EGLint status;
  EGLNativeDisplayType *nativeDisplay = NULL;
  if (!m_nativeTypes->GetNativeDisplay((XBNativeDisplayType**)&nativeDisplay))
    return false;

  *display = eglGetDisplay(*nativeDisplay);
  CheckError();
  if (*display == EGL_NO_DISPLAY)
  {
    CLog::Log(LOGERROR, "EGL failed to obtain display");
    return false;
  }

  status = eglInitialize(*display, 0, 0);
  CheckError();
  return status;
}
开发者ID:Neverous,项目名称:other-boxeebox-xbmc,代码行数:23,代码来源:EGLWrapper.cpp

示例15: close

bool PaPlayer::initStream()
{
    close();
    PaStreamParameters outputParameters;
    PaError err;

    outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
    if (outputParameters.device == paNoDevice) {
       m_lastError = "No default output device.";
       return false;
    }
    outputParameters.channelCount = m_wavFile->channelsCount();       /* stereo/mono output */
    outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */
    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency;
    outputParameters.hostApiSpecificStreamInfo = NULL;
    const double sampleRate = m_wavFile->audioSampleRate();
    const unsigned int framesPerBuffer = 64;

    err = Pa_OpenStream(
              &m_stream,
              NULL, // no input
              &outputParameters,
              sampleRate,
              framesPerBuffer,
              paClipOff,      // we won't output out of range samples so don't bother clipping them
              wavPlayCallback,
              this );
    CheckError(err);

    err = Pa_SetStreamFinishedCallback( m_stream, &StreamFinished );
    CheckError(err);

    err = Pa_StartStream( m_stream );
    CheckError(err);

    return true;
}
开发者ID:mapron,项目名称:wavReader,代码行数:37,代码来源:PaPlayer.cpp


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