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

C++ CheckError函数代码示例

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

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



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


示例16: CreateSocket

//  Write a socket
wxInt32 BufferedSocket::SendData(wxInt32 Timeout)
{   
    CreateSocket();

    // create a transfer buffer, from memory stream to socket
    wxStopWatch sw;

    // clear it
    memset(sData, 0, sizeof(sData));
    
    // copy data
    wxInt32 actual_size = send_buf->CopyTo(sData, MAX_PAYLOAD);
    
    // set the start ping
    // (Horrible, needs to be improved)
    SendPing = sw.Time();
                
    // send the data
    if (!Socket->WaitForWrite(0,Timeout))
    {
        CheckError();
        
        SendPing = 0;
        RecvPing = 0;
        
        DestroySocket();
        
        return 0;
    }
    else
        Socket->SendTo(to_addr, sData, actual_size);
    
    CheckError();    
        
    // return the amount of bytes sent
    return Socket->LastCount();
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:38,代码来源:net_io.cpp


示例17: CheckNull

HRESULT CModuleConfiguration::GetString(IAppHostElement* section, LPCWSTR propertyName, LPWSTR* value)
{
	HRESULT hr = S_OK;
    BSTR sysPropertyName = NULL;
    BSTR sysPropertyValue = NULL;
    IAppHostProperty* prop = NULL;

	CheckNull(value);
	*value = NULL;
	ErrorIf(NULL == (sysPropertyName = SysAllocString(propertyName)), ERROR_NOT_ENOUGH_MEMORY);
	CheckError(section->GetPropertyByName(sysPropertyName, &prop));
	CheckError(prop->get_StringValue(&sysPropertyValue));
	ErrorIf(NULL == (*value = new WCHAR[wcslen(sysPropertyValue) + 1]), ERROR_NOT_ENOUGH_MEMORY);
	wcscpy(*value, sysPropertyValue);

Error:

    if ( sysPropertyName )
    {
        SysFreeString(sysPropertyName);
        sysPropertyName = NULL;
    }

    if ( sysPropertyValue )
    {
        SysFreeString(sysPropertyValue);
        sysPropertyValue = NULL;
    }

    if (prop)
    {
        prop->Release();
        prop = NULL;
    }

    return hr;
}
开发者ID:sidneylimafilho,项目名称:iisnode,代码行数:37,代码来源:cmoduleconfiguration.cpp


示例18: Init

bool Init (GetProcAddressCallback callback)
{
    std::vector <std::string> needed_extensions = {
            "GL_ARB_separate_shader_objects",
            "GL_ARB_sampler_objects",
            "GL_ARB_direct_state_access"
    };
    std::stringstream version;
    int major, minor;

#ifdef _WIN32
	internal::_opengl32dllhandle = LoadLibrary ("OPENGL32.DLL");
	internal::_usergetprocaddress = callback;
	InitPrototypes (internal::_getprocaddress);
#else
    InitPrototypes (callback);
#endif
    if (!GetString || GetString == (PFNGLGETSTRINGPROC) oglp::Unsupported) {
#ifdef OGLP_THROW_EXCEPTIONS
		throw std::runtime_error ("No entry point for glGetString found.");
#else
        return false;
#endif
    }

    version << GetString (GL_VERSION);
    CheckError ();
    version >> major;
    version.ignore (1);
    version >> minor;

    if (major < 3) {
#ifdef OGLP_THROW_EXCEPTIONS
		throw std::runtime_error ("OpenGL version 3.0 or higher is required.");
#else
        return false;
#endif
    }
    for (std::string &extension : needed_extensions) {
        if (!IsExtensionSupported (extension)) {
#ifdef OGLP_THROW_EXCEPTIONS
			throw std::runtime_error (extension + " is required.");
#else
            return false;
#endif
        }
    }
    return true;
}
开发者ID:ekpyron,项目名称:oglp,代码行数:49,代码来源:oglp.cpp


示例19: STEAM_fputc

int STEAM_fputc(int c, FILE *stream)
{
	unsigned char chr = (unsigned char)c;
	SteamHandle_t hndl = (SteamHandle_t)stream;
	int n;
	TSteamError steamError;

	n = SteamWriteFile(&chr, sizeof(chr), 1, hndl, &steamError);
	if ( n != 1 || steamError.eSteamError != eSteamErrorNone )
	{
		CheckError((FILE *)hndl, &steamError);
		return EOF;
	}
	return c;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:15,代码来源:Steam.c


示例20: GameMain

//-----------------------------
void GameMain()
{
  DDraw->FillSurface(DDraw->DDSBack,0) ;

  //turn
  CheckAction(mouse,EditInfo,world) ;
  mouse.button = mouse_NO ;
  //map scroll
  ThisTickCount = GetTickCount() ;
  if(ThisTickCount-MouseScrollTickCount>map_scroll_DELAY)
  {
    MouseScrollTickCount=ThisTickCount ;
    MoveMapByMouse(mouse.x,mouse.y,
                   (world->player[player_ID]).current_x_screen,(world->player[player_ID]).current_y_screen,
                   screen_HEIGHT,screen_WIDTH) ;
  } ;
  //drawind
  res=world->Draw(player_ID,screen,DDraw->DDSBack) ; // draw world
  CheckError(res,"world->Draw") ;
  if(mouse.x_frame>=0&&mouse.y_frame>=0)                                                                  //
  {                                                                                                       //  Draw
    res=(mouse.sprite)->Draw(DDraw->DDSBack,(mouse.x>>5)<<5,(mouse.y>>5)<<5,mouse.x_frame,mouse.y_frame) ;//  mouse
    CheckError(res,"mouse->Draw") ;                                                                       //
  } ;                                                                                                     //
开发者ID:Puppollo,项目名称:c-hive,代码行数:25,代码来源:hiveMapEd_p.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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