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

C++ CLEANUP函数代码示例

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

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



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

示例1: CLEANUP

iMX27RtpInterface::~iMX27RtpInterface() {
	RTP_FUNCLOG;
	CLEANUP(m_pSendWrapper);
	CLEANUP(m_pReceiveWrapper);
#ifndef MINIMAL_MODE
	if ((Configuration::GetCfg()->GetIntVal("SendPacketsFromAnxbFile") || Configuration::GetCfg()->GetIntVal("SendPacketsFromPcapFile")) && !Configuration::GetCfg()->GetIntVal("RenderVideo")) {
		return;
	}
	pMutexLock scopedLock(m_VpuMutex);

	// De-initialize VPU hardware and release data structures/resources
	vpu_UnInit();
#endif
}
开发者ID:goodinges,项目名称:Ciao-Chat,代码行数:14,代码来源:iMX27RtpInterface.cpp


示例2: CLEANUP

SendVideoWrapper::~SendVideoWrapper() {
	if (m_pEncoder) {
		m_pEncoder->m_pVCap = NULL;
		m_pEncoder->StopEncoding();
	}
	if (m_pCapturer) {
		m_pCapturer->StopCapturing();
	}

	CLEANUP(m_pSendRtpDump);
	CLEANUP(m_pSendAnxbDump);
	CLEANUP(m_pCapturer);
	CLEANUP(m_pEncoder);
}
开发者ID:goodinges,项目名称:Ciao-Chat,代码行数:14,代码来源:SendVideoWrapper.cpp


示例3: main

int main(int ac, char **av)
{
	int lc, i;
	char *msg;
	struct timespec spec;
	clockid_t clocks[2] = { CLOCK_REALTIME, CLOCK_MONOTONIC };

	if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);

	TST_TOTAL = sizeof(clocks) / sizeof(clocks[0]);

	setup();

	for (lc = 0; TEST_LOOPING(lc); lc++) {

		Tst_count = 0;

		for (i = 0; i < TST_TOTAL; i++) {
			TEST(syscall(__NR_clock_gettime, clocks[i], &spec));
			tst_resm((TEST_RETURN < 0 ? TFAIL | TTERRNO : TPASS),
				 "%s",
				 (TEST_RETURN == 0 ? "passed" : "failed"));
		}
	}

	CLEANUP();
	tst_exit();
}
开发者ID:Nan619,项目名称:ltp-ddt,代码行数:29,代码来源:clock_gettime02.c


示例4: CLEANUP

bool SkypekitTestEngine::StopPlayback() {
	TI_FUNCLOG;

	CLEANUP(m_pReceiveWrapper);

	return true;
}
开发者ID:goodinges,项目名称:Ciao-Chat,代码行数:7,代码来源:SkypekitTestEngine.cpp


示例5: child_fn1

/*
 * child_fn1() - Inside container
*/
static int child_fn1(void *ttype)
{
	pid_t cpid, ppid;
	cpid = getpid();
	ppid = getppid();
	char mesg[] = "I was not killed !";
       	/* Child process closes up read side of pipe */
       	close(fd[0]);

	/* Comparing the values to make sure pidns is created correctly */
	if(( cpid == CHILD_PID) && ( ppid == PARENT_PID ) ) {
		tst_resm(TINFO, "PIDNS test is running inside container");
		kill(INIT_PID, SIGKILL);
		/* Verifying whether the container init is not killed, "
		 If so writing into the pipe created in the parent NS" */

        	/* Send "mesg" through the write side of pipe */
        	write(fd[1], mesg, (strlen(mesg)+1));
	}
	else {
		tst_resm(TFAIL, "got unexpected result of cpid=%d ppid=%d",
				cpid, ppid);
	}
	CLEANUP();
	close(fd[1]);
	tst_exit();
}
开发者ID:ystk,项目名称:debian-ltp,代码行数:30,代码来源:pidns04.c


示例6: read_from_pngfile

void *
read_from_pngfile(char * filename,
	void *(*alloc)(int w, int h, int bpp, void** datap))
{
	struct read_file_cleanup * clup;
	void * retval;

	VERBOSE(SYSTEM, "read bitmap data from png file %s\n",
			filename);

	FILE * fp = fopen(filename, "rb");
	if (NULL == fp) {
		WARNING(SYSTEM, "open file %s for read failed\n", filename);
		THROW(EXCEPTION_RESOURCE_LOST,
				"open file for read error\n");
	}

	clup = GC_TRIVAL_CALLOC(clup);
	assert(clup != NULL);
	clup->base.function = do_read_file_cleanup;

	struct png_reader * reader = &clup->reader;
	reader->io_ptr = fp;
	reader->read_fn = file_reader;
	reader->read_ptr = NULL;
	reader->info_ptr = NULL;

	make_cleanup(&clup->base);

	retval = do_png_read(reader, alloc);
	CLEANUP(&clup->base);
	return retval;
}
开发者ID:pi3orama,项目名称:yaavg,代码行数:33,代码来源:utils_png_rw.c


示例7: tolower

void
CAudioScrobbler::Handshake()
{
	std::string username="";
	for(unsigned int i = 0; i < Config->getLUsername().length(); i++) {
		username.append(1, tolower(Config->getLUsername().c_str()[i]));
	}
	std::string authtoken(md5sum((char*)"%s%s", username.c_str(), Config->getLPassword().c_str()));

	std::ostringstream query, sig;
	query << "method=auth.getMobileSession&username=" << Config->getLUsername() << "&authToken=" << authtoken << "&api_key=" << APIKEY;

	sig << "api_key" << APIKEY << "authToken" << authtoken << "methodauth.getMobileSessionusername" << Config->getLUsername() << SECRET;
	std::string sighash(md5sum((char*)"%s", sig.str().c_str()));

	query << "&api_sig=" << sighash;

	OpenURL(ROOTURL, query.str().c_str());

	if(_response.find("<lfm status=\"ok\">") != std::string::npos) {
		size_t start, end;
		start = _response.find("<key>") + 5;
		end = _response.find("</key>");
		_sessionid = _response.substr(start, end-start);
		iprintf("%s%s", "Last.fm handshake successful. SessionID: ", _sessionid.c_str());
		_authed = true;
	}
	else if(_response.find("<lfm status=\"failed\">") != std::string::npos) {
		CheckFailure(_response);
		exit(EXIT_FAILURE);
	}

	CLEANUP();
}
开发者ID:Sectoid,项目名称:mpdas,代码行数:34,代码来源:audioscrobbler.cpp


示例8: eprintf

bool
CAudioScrobbler::Scrobble(centry_t* entry)
{
	bool retval = false;
	if(!_authed) {
		eprintf("Handshake hasn't been done yet.");
		Handshake();
		return retval;
	}
	iprintf("Scrobbling: %s - %s", entry->artist.c_str(), entry->title.c_str());
	
	OpenURL(ROOTURL, CreateScrobbleMessage(0, entry).c_str());
	if(_response.find("<lfm status=\"ok\">") != std::string::npos) {
		iprintf("%s", "Scrobbled successfully.");
		retval = true;
	}
	else if(_response.find("<lfm status=\"failed\">") != std::string::npos) {
		eprintf("%s%s", "Last.fm returned an error while scrobbling:\n", _response.c_str());
		if(CheckFailure(_response))
			Failure();
	}
	CLEANUP();

	return retval;
}
开发者ID:Sectoid,项目名称:mpdas,代码行数:25,代码来源:audioscrobbler.cpp


示例9: cleanOptions

void cleanOptions(Options* inOptions)
/*
**  Clean up any open handles.
*/
{
    unsigned loop = 0;

    CLEANUP(inOptions->mInputName);
    CLEANUP(inOptions->mOutputName);
    if(NULL != inOptions->mOutput && stdout != inOptions->mOutput)
    {
        fclose(inOptions->mOutput);
    }

    memset(inOptions, 0, sizeof(Options));
}
开发者ID:diversys,项目名称:bezilla,代码行数:16,代码来源:tmstats.c


示例10: CLEANUP

 //***********************************************
 uint8_t ColYuvRgb::reset(uint32_t ww, uint32_t hh)
 {
 int flags=0;
	
    CLEANUP();
    FLAGS();
    PixelFormat fmt=TARGET_COLORSPACE;
    if(_inverted) fmt=ALTERNATE_COLORSPACE;
    if(!ww || !hh) return 0;

	if (_context)
		sws_freeContext((SwsContext *)_context);

	/* 
	FIXME: remove when ffmpeg is fixed
	Without SWS_ACCURATE_RND the quality is bad 
	for YUV->RGB (caused by libswscale r28700) 
	*/
	flags |= SWS_ACCURATE_RND;

	 _context=(void *)sws_getContext(
                      ww,hh,
                      PIX_FMT_YUV420P ,
                      ww,hh,
                      fmt,
                      flags, NULL, NULL,NULL);

    if(!_context) ADM_assert(0);
    w=ww;
    h=hh;
    return 1;
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:33,代码来源:ADM_rgb.cpp


示例11: LogTrace

DWORD WINAPI   CardDeleteContext
               (
                  __inout PCARD_DATA  pCardData
               )
{
   DWORD             dwReturn    = 0;

   LogTrace(LOGTYPE_INFO, WHERE, "Enter API...");

   /********************/
   /* Check Parameters */
   /********************/
   if ( pCardData == NULL )
   {
      LogTrace(LOGTYPE_ERROR, WHERE, "Invalid parameter [pCardData]");
      CLEANUP(SCARD_E_INVALID_PARAMETER);
   }

   LogTrace(LOGTYPE_INFO, WHERE, "Context:[0x%08X]", pCardData->hSCardCtx);
   if (pCardData->pvVendorSpecific != NULL)
   {
	   pCardData->pfnCspFree(pCardData->pvVendorSpecific);
	   pCardData->pvVendorSpecific = NULL;
   }
	
cleanup:

   LogTrace(LOGTYPE_INFO, WHERE, "Exit API...");

   return (dwReturn);
}
开发者ID:Fedict,项目名称:eid-mw,代码行数:31,代码来源:InitAndDeconstruct.c


示例12: main

int main(int argc, char *argv[])
{
	int status;
	pid_t pid;

	setup();

	pid = getpid();

	/* Container creation on PID namespace */
	TEST(do_clone_unshare_test(T_CLONE, CLONE_NEWPID, child_fn, NULL));
	if (TEST_RETURN == -1) {
		tst_brkm(TBROK | TTERRNO, CLEANUP, "clone failed");
	}

	sleep(1);
	if (wait(&status) < 0)
		tst_resm(TWARN, "parent: waitpid() failed.");

	if (WIFEXITED(status) && WEXITSTATUS(status) != 0)
		tst_resm(TBROK, "container was terminated abnormally");

	CLEANUP();
	tst_exit();
}
开发者ID:MohdVara,项目名称:ltp,代码行数:25,代码来源:pidns10.c


示例13: C_GetMechanismInfo

CK_RV C_GetMechanismInfo(CK_SLOT_ID slotID,
	CK_MECHANISM_TYPE type,
	CK_MECHANISM_INFO_PTR pInfo)
{
	CK_RV ret;
	log_trace(WHERE, "I: enter");

	if (p11_get_init() != BEIDP11_INITIALIZED)
	{
		log_trace(WHERE, "I: leave, CKR_CRYPTOKI_NOT_INITIALIZED");
		return (CKR_CRYPTOKI_NOT_INITIALIZED);
	}		

	ret = p11_lock();
	if (ret != CKR_OK)
	{
		log_trace(WHERE, "I: leave, p11_lock failed with %i",ret);
		return ret;
	}

	log_trace(WHERE, "S: C_GetMechanismInfo(slot %d)", slotID);

	if (pInfo == NULL_PTR)
	{
		CLEANUP(CKR_ARGUMENTS_BAD);
	}

	/*ret = cal_get_mechanism_info(slotID, type, pInfo);
	if (ret != CKR_OK)
	{
		log_trace(WHERE, "E: p11_get_mechanism_info(slotid=%d) returns %d", slotID, ret);
		goto cleanup;
	}*/
    if (g_aseP11Handle == NULL)
    {
        log_trace(WHERE, "E: leave, CKR_CRYPTOKI_NOT_INITIALIZED - g_aseP11Handle is NULL");
        CLEANUP(CKR_ARGUMENTS_BAD);
    }

    ret = (pFunctions->C_GetMechanismInfo) ( slotID,  type, pInfo);


cleanup:        
	p11_unlock();
	log_trace(WHERE, "I: leave, ret = %i",ret);
	return ret;
}
开发者ID:Solerx,项目名称:dcfd-mw-applet,代码行数:47,代码来源:general.c


示例14: LogTrace

DWORD WINAPI   CardQueryKeySizes
               (
                  __in      PCARD_DATA       pCardData,
                  __in      DWORD            dwKeySpec,
                  __in      DWORD            dwFlags,
                  __in      PCARD_KEY_SIZES  pKeySizes
               )
{
   DWORD             dwReturn = 0;

   LogTrace(LOGTYPE_INFO, WHERE, "Enter API...");

   /********************/
   /* Check Parameters */
   /********************/
   if ( pCardData == NULL )
   {
      LogTrace(LOGTYPE_ERROR, WHERE, "Invalid parameter [pCardData]");
      CLEANUP(SCARD_E_INVALID_PARAMETER);
   }
   if ( dwKeySpec != AT_SIGNATURE )
   {
      LogTrace(LOGTYPE_ERROR, WHERE, "Invalid parameter [dwKeySpec]");
      CLEANUP(SCARD_E_INVALID_PARAMETER);
   }
   if ( dwFlags != 0 )
   {
      LogTrace(LOGTYPE_ERROR, WHERE, "Invalid parameter [dwKeySpec]");
      CLEANUP(SCARD_E_INVALID_PARAMETER);
   }
   if ( pKeySizes == NULL )
   {
      LogTrace(LOGTYPE_ERROR, WHERE, "Invalid parameter [pKeySizes]");
      CLEANUP(SCARD_E_INVALID_PARAMETER);
   }

   pKeySizes->dwVersion           = CARD_KEY_SIZES_CURRENT_VERSION;
   pKeySizes->dwMinimumBitlen     = 1024;
   pKeySizes->dwDefaultBitlen     = 1024;
   pKeySizes->dwMaximumBitlen     = 1024;
   pKeySizes->dwIncrementalBitlen = 0;

cleanup:
   LogTrace(LOGTYPE_INFO, WHERE, "Exit API...");
   return(dwReturn);
}
开发者ID:Blandinium,项目名称:eid-mw,代码行数:46,代码来源:cryptoops.cpp


示例15: main

int main(int argc, char *argv[])
{
	int ret, status, nbytes;
        char    readbuffer[80];

	pipe(fd);
	ret = do_clone_unshare_test(T_CLONE, CLONE_NEWPID, child_fn1, NULL);
	if ((wait(&status)) < 0) {
		tst_resm(TWARN, "wait() failed, skipping this test case");
		/* Cleanup & continue with next test case */
		CLEANUP();
	}
	if (ret == -1) {
		tst_resm(TFAIL, "clone() Failed, errno = %d :"
			" %s", ret, strerror(ret));
		/* Cleanup & continue with next test case */
		CLEANUP();
	}

	/* Parent process closes up write side of pipe */
	close(fd[1]);
	/* Read in a string from the pipe */
	nbytes = read(fd[0], readbuffer, sizeof(readbuffer));

	if (nbytes !=0 ) {
		tst_resm(TPASS, "Container init : %s", readbuffer);
	}
	else {
		tst_resm(TFAIL, "Container init is killed by SIGKILL !!!");
	}

	if (WTERMSIG(status)) {
		tst_resm(TFAIL, "Container init pid got killed by signal %d",
		WTERMSIG(status));
	}
        /* cleanup and exit */
	CLEANUP();
	close(fd[0]);

	tst_exit();

}	/* End main */
开发者ID:ystk,项目名称:debian-ltp,代码行数:42,代码来源:pidns04.c


示例16: LogTrace

DWORD WINAPI   CardQueryCapabilities
(
    __in      PCARD_DATA          pCardData,
    __in      PCARD_CAPABILITIES  pCardCapabilities
)
{
   DWORD    dwReturn  = 0;
   DWORD    dwVersion = 0;

   LogTrace(LOGTYPE_INFO, WHERE, "Enter API...");

   /********************/
   /* Check Parameters */
   /********************/
   if ( pCardData == NULL )
   {
      LogTrace(LOGTYPE_ERROR, WHERE, "Invalid parameter [pCardData]");
      CLEANUP(SCARD_E_INVALID_PARAMETER);
   }
   if ( pCardCapabilities == NULL )
   {
      LogTrace(LOGTYPE_ERROR, WHERE, "Invalid parameter [pCardCapabilities]");
      CLEANUP(SCARD_E_INVALID_PARAMETER);
   }
   dwVersion = (pCardCapabilities->dwVersion == 0) ? 1 : pCardCapabilities->dwVersion;
   if ( dwVersion != CARD_CAPABILITIES_CURRENT_VERSION )
   {
      LogTrace(LOGTYPE_ERROR, WHERE, "Invalid parameter [pCardCapabilities->dwVersion]");
      CLEANUP(ERROR_REVISION_MISMATCH );
   }

   /* It's the Base CSP/CNG KSP performs these operations if the card minidriver cannot do so */
   //pCardCapabilities->dwVersion                = CARD_CAPABILITIES_CURRENT_VERSION;
   pCardCapabilities->fCertificateCompression  = TRUE;
   pCardCapabilities->fKeyGen                  = FALSE;

cleanup:
   LogTrace(LOGTYPE_INFO, WHERE, "Exit API...");
   return(dwReturn);
}
开发者ID:Fedict,项目名称:eid-mw,代码行数:40,代码来源:CardCap.c


示例17: LogTrace

DWORD WINAPI   CardDeleteDirectory
               (
                  __in    PCARD_DATA  pCardData,
                  __in    LPSTR       pszDirectoryName
               )
{
   DWORD    dwReturn = 0;
   LogTrace(LOGTYPE_INFO, WHERE, "Enter API...");

   CLEANUP(SCARD_E_UNSUPPORTED_FEATURE);

cleanup:
   LogTrace(LOGTYPE_INFO, WHERE, "Exit API...");
   return(dwReturn);
}
开发者ID:Blandinium,项目名称:eid-mw,代码行数:15,代码来源:PubDataOps.c


示例18: xf86parseModesSection

XF86ConfModesPtr
xf86parseModesSection (void)
{
	int has_ident = FALSE;
	int token;
	parsePrologue (XF86ConfModesPtr, XF86ConfModesRec)

	while ((token = xf86getToken (ModesTab)) != ENDSECTION)
	{
		switch (token)
		{
		case COMMENT:
			ptr->modes_comment = xf86addComment(ptr->modes_comment, val.str);
			break;
		case IDENTIFIER:
			if (xf86getSubToken (&(ptr->modes_comment)) != STRING)
				Error (QUOTE_MSG, "Identifier");
			if (has_ident == TRUE)
				Error (MULTIPLE_MSG, "Identifier");
			ptr->modes_identifier = xf86configStrdup(val.str);
			has_ident = TRUE;
			break;
		case MODE:
			HANDLE_LIST (mon_modeline_lst, xf86parseVerboseMode,
						 XF86ConfModeLinePtr);
			break;
		case MODELINE:
			HANDLE_LIST (mon_modeline_lst, xf86parseModeLine,
						 XF86ConfModeLinePtr);
			break;
		case OPTION:
			ptr->modes_option_lst = xf86parseOption(ptr->modes_option_lst);
			break;
		default:
			xf86parseError (INVALID_KEYWORD_MSG, xf86tokenString ());
			CLEANUP (ptr);
			return NULL;
		}
	}

	if (!has_ident)
		Error (NO_IDENT_MSG, NULL);

#ifdef DEBUG
	printf ("Modes section parsed\n");
#endif
	return ptr;
}
开发者ID:marioaugustorama,项目名称:tropix-xwindow,代码行数:48,代码来源:Monitor.c


示例19: xf86readConfigFile

XF86ConfigPtr
xf86readConfigFile()
{
	XF86ConfigPtr ptr;

	ptr = xf86parseConfigFile(NULL);
	if (!ptr)
		return NULL;

	if (xf86validateConfig(ptr))
		return ptr;
	else
	{
		CLEANUP(ptr);
		return NULL;
	}
}
开发者ID:marioaugustorama,项目名称:tropix-xwindow,代码行数:17,代码来源:read.c


示例20: CLEANUP

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
uint8_t ColYv12Rgb24::reset(uint32_t ww, uint32_t hh)
 {
 int flags=0;
	CLEANUP();
    FLAGS();
   
	 _context=(void *)sws_getContext(
				    		ww,hh,
						PIX_FMT_YUV420P ,
		 				ww,hh,
	   					PIX_FMT_RGB24,
	    					flags, NULL, NULL,NULL);

    if(!_context) ADM_assert(0);
    w=ww;
    h=hh;
    return 1;
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:19,代码来源:ADM_rgb.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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