当前位置: 首页>>代码示例>>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;未经允许,请勿转载。