當前位置: 首頁>>代碼示例>>C++>>正文


C++ DEL函數代碼示例

本文整理匯總了C++中DEL函數的典型用法代碼示例。如果您正苦於以下問題:C++ DEL函數的具體用法?C++ DEL怎麽用?C++ DEL使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了DEL函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: loop_rewrite_match

//091105 by HG
static int loop_rewrite_match( const void* p, const void *q )
{
	connection* conn = (connection*)q;
	rewrite_rule* rule = (rewrite_rule*)p;
	const int nmatch = 9; //why is nine? enough?
	char* newname;
	int i;
	char* v;
	regmatch_t pm[nmatch]; 
	if( conn->uri[0] != '/' ){ //bad luck!!
		NEW( newname, PATH_LEN+4 );
		if( strcmp( conn->current_dir, "/") == 0 )
			sprintf( newname, "/%s", conn->uri );
		else
			sprintf( newname, "%s/%s", conn->current_dir, conn->uri );
		strcpy( conn->uri, newname );
		DEL( newname );
	}
	if( strncmp( conn->uri, rule->base, rule->base_len ) )
		return 0; //search next rule
	if( regexec( &rule->compiled_pattern, conn->uri, nmatch, pm, 0 )  ==REG_NOMATCH )
		return 0; //search next rule
	NEW( newname, FILENAME_LEN+4 );
	for( v=rule->result, i=0; *v; v++ ){
		if( *v=='$' && *(v+1)>='0'&& *(v+1)<='9' ){
			int k = *(++v)-'0', j;
			if( pm[k].rm_so == -1 )
				continue;
			for( j=pm[k].rm_so; i<FILENAME_LEN && j<pm[k].rm_eo; j++ )
				newname[i++]=conn->uri[j];
		}else if( i<FILENAME_LEN ){
			newname[i++]=*v;
		}
	}
	newname[i]='\0';
	strcpy( conn->uri, newname );
	DEL( newname );
//	DBG("new uri: %s", conn->uri );
	return 1; //finished.
}
開發者ID:xf22001,項目名稱:homeserver,代碼行數:41,代碼來源:connection.c

示例2: DEL

void CDlgMakeTChartImage::allocVariable()
{
	DEL(m_pdLH);
	DEL(m_pdRH);
	DEL(m_pdLV);
	DEL(m_pdRV);
	DEL(m_pdStiH);
	DEL(m_pdStiV);

	if(m_ulDataCount)
	{
		m_pdLH = new double[m_ulDataCount];
		m_pdRH = new double[m_ulDataCount];
		m_pdLV = new double[m_ulDataCount];
		m_pdRV = new double[m_ulDataCount];
		m_pdStiH = new double[m_ulDataCount];
		m_pdStiV = new double[m_ulDataCount];

		memset(m_pdLH, 0, sizeof(double)*m_ulDataCount);
		memset(m_pdRH, 0, sizeof(double)*m_ulDataCount);
		memset(m_pdLV, 0, sizeof(double)*m_ulDataCount);
		memset(m_pdRV, 0, sizeof(double)*m_ulDataCount);
		memset(m_pdStiH, 0, sizeof(double)*m_ulDataCount);
		memset(m_pdStiV, 0, sizeof(double)*m_ulDataCount);
	}
}
開發者ID:dlsyaim,項目名稱:sm-eye-app,代碼行數:26,代碼來源:DlgMakeTChartImage.cpp

示例3: webqq_create_user

EXPORT user* webqq_create_user( void* session_ptr, uint number, uchar* md5pass )
{
	user* u;
	qqclient* qq;
	u = loop_search( &user_loop, session_ptr, get_user_searcher );
	if( u )
		return u;
	NEW( qqclient*, qq, sizeof(qqclient) );
	NEW( user*, u, sizeof(user) );
	if( !u || !qq ){
		DEL( qq );	DEL( u );
		return NULL;
	}
	u->session_ptr = session_ptr;
	u->create_time = u->update_time = time(NULL);
	u->qq = qq;
	u->reference = 1;
	qqclient_md5_create( qq, number, md5pass );
	qq->auto_accept = 1;	//temporarily do this
	loop_push_to_tail( &user_loop, u );
	return u;
}
開發者ID:PythonYXY,項目名稱:myqq3,代碼行數:22,代碼來源:webqq.c

示例4: Py_DECREF

static
void
__destroy              (rbtree_t *T, rbtree_node_t *n)
{
    if (n != T->nil)
        {
            Py_DECREF(n->key);
            Py_DECREF(n->value);
            __destroy(T, n->l);
            __destroy(T, n->r);
            DEL      (n);
        }
}
開發者ID:shenli-uiuc,項目名稱:Centaur,代碼行數:13,代碼來源:rbtree_impl.c

示例5: api_init_licence_time_now

void api_init_licence_time_now(apiclient* apis)
{
    char *server;
    NEW(server, 128);
    strcpy(server, LICENCE_SERVER);
    char *data;
    NEW(data, HTTP_POST_SIZE);
    apis->licence_time_now = time(NULL);
    sprintf( data,
        "process=api_init_server_time&"
        "local=%d"
        , apis->licence_time_now
    );
    char *http = http_post(server, data);
    DEL(server);
    DEL(data);
    char *next;
    char *timer, *key;
    NEW(timer, 12);
    NEW(key, 33);
    next = mid_value(http, "<time>", "</time>", timer, 12);
    next = mid_value(next, "<key>", "</key>", key, 33);
    apis->licence_time_now = atoi(timer);
    apis->licence_seckey = LICENCE_SECKEY;
    char *local_key = api_create_transfer_hash(apis, "sck");
    if (stricmp(key, local_key) != 0)
    {
        apis->licence_time_now = 0;
    }
    // 真JJ奇怪,這兩個變量用DEL就會崩潰
    //DEL(timer);
    //DEL(key);
    // 沒辦法,先用下麵的代碼釋放內存了
    free(*timer);
    free(*key);
    DEL(local_key);
    DEL(http);
}
開發者ID:kissthink,項目名稱:qq.robot.xiaoc,代碼行數:38,代碼來源:api.c

示例6: libqq_create

EXPORT qqclient* libqq_create( uint number, char* pass )
{
	qqclient* qq;
	if( !if_init )
		libqq_init();
	NEW( qq, sizeof(qqclient) );
	if( !qq ){
		DEL( qq );
		return NULL;
	}
	qqclient_create( qq, number, pass );
	qq->auto_accept = 1;	//temporarily do this
	return qq;
}
開發者ID:564263820,項目名稱:search4alibabainfor,代碼行數:14,代碼來源:libqq.c

示例7: ASSERT

bool CBNFParser::Parse(CList<CToken *> &lstTokens, CNode *&pParsed)
{
	ASSERT(m_pRootRule);
	pParsed = 0;
	CList<CToken *>::TNode *pFirst = lstTokens.m_pHead;
	pParsed = NEW(CNode, (pFirst ? pFirst->Data : 0, m_pRootRule->m_iID));
	bool bMatch = m_pRootRule->Match(pFirst, *pParsed);
	if (!bMatch || pFirst) {
		DEL(pParsed);
		pParsed = 0;
		bMatch = false;
	}
	return bMatch;
}
開發者ID:aaalexandrov,項目名稱:Alex,代碼行數:14,代碼來源:BNF.cpp

示例8: pcibr_hints_subdevs

void
pcibr_hints_subdevs(devfs_handle_t xconn_vhdl,
		    pciio_slot_t slot,
		    uint64_t subdevs)
{
    arbitrary_info_t        ainfo = 0;
    char                    sdname[16];
    devfs_handle_t            pconn_vhdl = GRAPH_VERTEX_NONE;

    sprintf(sdname, "pci/%d", slot);
    (void) hwgraph_path_add(xconn_vhdl, sdname, &pconn_vhdl);
    if (pconn_vhdl == GRAPH_VERTEX_NONE) {
#if DEBUG
	printk("pcibr_hints_subdevs: hwgraph_path_create failed at\n"
		"\t%p (seeking %s)\n", xconn_vhdl, sdname);
#endif
	return;
    }
    hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo);
    if (ainfo == 0) {
	uint64_t                *subdevp;

	NEW(subdevp);
	if (!subdevp) {
#if DEBUG
	    printk("pcibr_hints_subdevs: subdev ptr alloc failed at\n"
		    "\t%p\n", pconn_vhdl);
#endif
	    return;
	}
	*subdevp = subdevs;
	hwgraph_info_add_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, (arbitrary_info_t) subdevp);
	hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo);
	if (ainfo == (arbitrary_info_t) subdevp)
	    return;
	DEL(subdevp);
	if (ainfo == (arbitrary_info_t) NULL) {
#if DEBUG
	    printk("pcibr_hints_subdevs: null subdevs ptr at\n"
		    "\t%p\n", pconn_vhdl);
#endif
	    return;
	}
#if DEBUG
	printk("pcibr_subdevs_get: dup subdev add_LBL at\n"
		"\t%p\n", pconn_vhdl);
#endif
    }
    *(uint64_t *) ainfo = subdevs;
}
開發者ID:muromec,項目名稱:linux-ezxdev,代碼行數:50,代碼來源:pcibr_hints.c

示例9: fft3_done

void fft3_done()
{
  int i, j;

  if(d.init != 1)
    {
      fft3_fail("fft3: has not been initialized.");
    }

  for(i=0; i<d.nomp; i++) DEL(d.tomp[i]);
  free(d.tomp);

  for(j=0; j<3; j++)
    {
      for(i=0; i<d.nomp; i++)
	{
	  if(d.work[j][i] != NULL) DEL(d.work[j][i]);
	}
      free(d.work[j]);
    }

  d.init = 0;
}
開發者ID:sleitner,項目名稱:cart,代碼行數:23,代碼來源:fft3.c

示例10: while

void CFMOD::DeleteAllSamples(void)
{
    Log->AddEntry("Deleting All Samples");
    CSample *delsample;
    CSample *nextsample;
    delsample=FirstSample;
    while(delsample)
    {
        nextsample=delsample->pNext;
        Log->AddEntry(va("sample: [%s] DEL!",delsample->name));
        DEL(delsample);
        delsample=nextsample;
    }
}
開發者ID:jbworley,項目名稱:dlstorm,代碼行數:14,代碼來源:c_fmod.cpp

示例11: DEL

void enumdef.dcl(Pname, Ptable tbl)
{
#define FIRST_ENUM 0
	int nmem = mem->no_of_names();
	Pname p;
	Pname ns = 0;
	Pname nl;
	int enum_old = enum_count;
	no_of_enumerators = nmem;

	enum_count = FIRST_ENUM;

	if (this == 0) error('i',"0->enumdef.dcl(%d)",tbl);

	for(p=mem, mem=0; p; p=p->n_list) {
		Pname nn;
		if (p->n_initializer) {
			Pexpr i = p->n_initializer->typ(tbl);
			Neval = 0;
			enum_count = i->eval();
			if (Neval) error("%s",Neval);
			DEL(i);
			p->n_initializer = 0;
		}
		p->n_evaluated = 1;
		p->n_val = enum_count++; 
		nn = tbl->insert(p,0); /* ??? */
		if (Nold) {
			if (nn->n_stclass == ENUM)
				error( (p->n_val!=nn->n_val)?0:'w',"enumerator%n declared twice",nn);
			else
				error("incompatibleDs of%n",nn);
		}
		else {
			nn->n_stclass = ENUM; // no store will be allocated
			if (ns)
				nl->n_list = nn;
			else
				ns = nn;
			nl = nn;
		}
		delete p;
	}

	mem = ns;

	enum_count = enum_old;
	defined |= DEFINED;
}
開發者ID:setekhid,項目名稱:cfront1,代碼行數:49,代碼來源:dcl2.c

示例12: client_end

int client_end( client* c )
{
	//close all connections
	pthread_mutex_lock( &c->mutex_conn );
	connection* conn;
	for( conn=c->first_conn; conn; ){
		connection* next = conn->next;
		shutdown( conn->socket, SHUT_RDWR );
#ifdef __WIN32__
		closesocket( conn->socket );
#else
		close( conn->socket );
#endif
		conn->state = C_END;
		conn = next;
	}
	//close all sessions
	pthread_mutex_lock( &c->mutex_session );
	session* s;
	for( s=c->first_session; s; ){
		session* next = s->next;
		if( s->reference > 0 ){
			DBG("##Fatal Error: session->reference = %d", s->reference );
		}
		LINK_DELETE( s, c->first_session );
		DEL( s );
		s = next;
	}
	pthread_mutex_unlock( &c->mutex_session );
	pthread_mutex_unlock( &c->mutex_conn );
	//is it safe to do things below? 091205 by HG
	pthread_mutex_destroy( &c->mutex_session );
	pthread_mutex_destroy( &c->mutex_conn );
	DEL( c );
	return 0;
}
開發者ID:xf22001,項目名稱:homeserver,代碼行數:36,代碼來源:client.c

示例13: DEL

//-------------------------------------
//
//-------------------------------------
void BaseScene::End()
{
    for( int i = m_entities.Size() -1; i >=  0; i-- ) 
	{
		IEntity* entityToDelete = m_entities[i];
		entityToDelete->End();
		m_entities.Remove( m_entities[i] );
		IEntityFactory::Instance().RemoveEntity( entityToDelete );
	}

    m_labels.Clear();
    m_labelsToDelete.Clear();

	DEL( m_scene );
}
開發者ID:CarlosCasVen,項目名稱:UTad,代碼行數:18,代碼來源:BaseScene.cpp

示例14: __rb_del_node

static
rbtree_node_t *
__rb_del_node(rbtree_t *T, rbtree_node_t *z)
{
    // Delete a node and return successor
    rbtree_node_t  *y;
    rbtree_node_t  *x;
    rbtree_node_t  *remainder = NULL;

    if (z == NULL) return NULL;
    remainder = __tree_successor(T, z);
    if ((z->l == T->nil) || (z->r == T->nil)) y = z;
    else y = remainder;

    if (y->l != T->nil) x = y->l;
    else                x = y->r;

    x->p = y->p;
    if (y->p == T->nil) T->root = x;
    else
        {
            // Disconnect y from tree
            if (y == y->p->l) y->p->l = x;
            else              y->p->r = x;
        }
    if (y != z)
        {
            // copy y to z replace z, the delete target with y's data, then
            // remove the old shell. saves a rotate.
            Py_DECREF(z->key);
            Py_DECREF(z->value);
            z->key = y->key;
            z->value = y->value;
            remainder = z;
        }

    if (COLOR(y) == BLACK)
        {
            __rb_del_fix(T, x);
        }

    DEL(y);

    T->ct--;
    if (remainder == T->nil)
        return NULL;
    return remainder;
}
開發者ID:shenli-uiuc,項目名稱:Centaur,代碼行數:48,代碼來源:rbtree_impl.c

示例15: REL

cDxSound::~cDxSound(void)
{
	REL(_pSegment);
	REL(_pPerformance);
	REL(_pLoader);
	POSITION pos = _sounds.GetStartPosition();
	long key;
	CSound* value;
	while(pos)
	{
		_sounds.GetNextAssoc(pos, key, value);
		delete value;
	}
	_sounds.RemoveAll();
	DEL(_pSoundManager);
}
開發者ID:jstty,項目名稱:OlderProjects,代碼行數:16,代碼來源:DxSound.cpp


注:本文中的DEL函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。