本文整理汇总了C++中PFREE函数的典型用法代码示例。如果您正苦于以下问题:C++ PFREE函数的具体用法?C++ PFREE怎么用?C++ PFREE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PFREE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: if
double *dist_ps(Point *pt, LSEG *lseg)
{
double m; /* slope of perp. */
LINE *ln;
double *result, *tmpdist;
Point *ip;
/* construct a line that's perpendicular. See if the intersection of
the two lines is on the line segment. */
if (lseg->p[1].x == lseg->p[0].x)
m = 0;
else if (lseg->p[1].y == lseg->p[0].y) /* slope is infinite */
m = (double)DBL_MAX;
else m = (-1) * (lseg->p[1].y - lseg->p[0].y) /
(lseg->p[1].x - lseg->p[0].x);
ln = line_construct_pm(pt, m);
if ((ip = interpt_sl(lseg, ln)) != NULL)
result = point_distance(pt, ip);
else /* intersection is not on line segment, so distance is min
of distance from point to an endpoint */
{
result = point_distance(pt, &lseg->p[0]);
tmpdist = point_distance(pt, &lseg->p[1]);
if (*tmpdist < *result) *result = *tmpdist;
PFREE (tmpdist);
}
if (ip != NULL) PFREE(ip);
PFREE(ln);
return (result);
}
开发者ID:jarulraj,项目名称:postgres95,代码行数:32,代码来源:geo-ops.c
示例2: free_event
static void
free_event(kherr_event * e)
{
EnterCriticalSection(&cs_error);
assert(IS_KHERR_EVENT(e));
#ifdef DEBUG
assert(LNEXT(e) == NULL);
assert(LPREV(e) == NULL);
#endif
if(e->flags & KHERR_RF_FREE_SHORT_DESC) {
assert(e->short_desc);
PFREE((void *) e->short_desc);
}
if(e->flags & KHERR_RF_FREE_LONG_DESC) {
assert(e->long_desc);
PFREE((void *) e->long_desc);
}
if(e->flags & KHERR_RF_FREE_SUGGEST) {
assert(e->suggestion);
PFREE((void *) e->suggestion);
}
free_event_params(e);
ZeroMemory(e, sizeof(*e));
LPUSH(&evt_free_list, e);
LeaveCriticalSection(&cs_error);
}
开发者ID:secure-endpoints,项目名称:netidmgr,代码行数:31,代码来源:kherr.c
示例3: free_event_params
static void
free_event_params(kherr_event * e)
{
assert(IS_KHERR_EVENT(e));
if(parm_type(e->p1) == KEPT_STRINGT) {
assert((void *) parm_data(e->p1));
PFREE((void*) parm_data(e->p1));
}
ZeroMemory(&e->p1, sizeof(e->p1));
if(parm_type(e->p2) == KEPT_STRINGT) {
assert((void *) parm_data(e->p2));
PFREE((void*) parm_data(e->p2));
}
ZeroMemory(&e->p2, sizeof(e->p2));
if(parm_type(e->p3) == KEPT_STRINGT) {
assert((void *) parm_data(e->p3));
PFREE((void*) parm_data(e->p3));
}
ZeroMemory(&e->p3, sizeof(e->p3));
if(parm_type(e->p4) == KEPT_STRINGT) {
assert((void *) parm_data(e->p4));
PFREE((void*) parm_data(e->p4));
}
ZeroMemory(&e->p4, sizeof(e->p4));
}
开发者ID:secure-endpoints,项目名称:netidmgr,代码行数:29,代码来源:kherr.c
示例4: kmqint_free_msg_type
/* called with cs_mkq_global && cs_kmq_types held */
void kmqint_free_msg_type(int t) {
kmq_msg_type * pt;
kmq_msg_subscription * s;
pt = msg_types[t];
msg_types[t] = NULL;
if (pt == NULL)
return;
/* all the subscriptions attached to a message type are owned by
the message type */
LPOP(&pt->subs, &s);
while(s) {
s->magic = 0;
PFREE(s);
LPOP(&pt->subs, &s);
}
pt->completion_handler = NULL;
LDELETE(&all_msg_types, pt);
PFREE(pt);
}
开发者ID:Brainiarc7,项目名称:pbis,代码行数:29,代码来源:msgtype.c
示例5: kcdb_credtype_check_and_delete
/* Called with cs_credtype held */
void kcdb_credtype_check_and_delete(khm_int32 id)
{
kcdb_credtype_i * ict;
#ifdef DEBUG
assert(id >= 1 && id <= KCDB_CREDTYPE_MAX_ID);
#endif
if (id < 1 || id > KCDB_CREDTYPE_MAX_ID)
return;
ict = kcdb_credtype_tbl[id];
if(!ict)
return;
if((ict->flags & KCDB_CTI_FLAG_DELETED) &&
!ict->refcount)
{
kcdb_credtype_tbl[id] = NULL;
LDELETE(&kcdb_credtypes, ict);
PFREE(ict->ct.name);
if(ict->ct.short_desc)
PFREE(ict->ct.short_desc);
if(ict->ct.long_desc)
PFREE(ict->ct.long_desc);
if(ict->ct.sub)
kmq_delete_subscription(ict->ct.sub);
PFREE(ict);
}
}
开发者ID:secure-endpoints,项目名称:netidmgr,代码行数:32,代码来源:credtype.c
示例6: PALLOCTYPE
/* lseg_distance -
* If two segments don't intersect, then the closest
* point will be from one of the endpoints to the other
* segment.
*/
double *lseg_distance(LSEG *l1, LSEG *l2)
{
double *d, *result;
result = PALLOCTYPE(double);
if (lseg_intersect(l1, l2)) {
*result = 0.0;
return(result);
}
*result = (double)DBL_MAX;
d = dist_ps(&l1->p[0], l2);
*result = Min(*result, *d);
PFREE(d);
d = dist_ps(&l1->p[1], l2);
*result = Min(*result, *d);
PFREE(d);
d = dist_ps(&l2->p[0], l1);
*result = Min(*result, *d);
PFREE(d);
d = dist_ps(&l2->p[1], l1);
*result = Min(*result, *d);
PFREE(d);
return(result);
}
开发者ID:jarulraj,项目名称:postgres95,代码行数:30,代码来源:geo-ops.c
示例7: khui_delete_ilist
KHMEXP BOOL KHMAPI
khui_delete_ilist(khui_ilist * il) {
DeleteObject(il->img);
DeleteObject(il->mask);
PFREE(il->idlist);
PFREE(il);
return TRUE;
}
开发者ID:Brainiarc7,项目名称:pbis,代码行数:9,代码来源:rescache.c
示例8: mrl_properties_video_free
void
mrl_properties_video_free (mrl_properties_video_t *video)
{
if (!video)
return;
PFREE (video->codec);
PFREE (video);
}
开发者ID:GeeXboX,项目名称:libplayer,代码行数:9,代码来源:mrl_internal.c
示例9: mrl_properties_audio_free
void
mrl_properties_audio_free (mrl_properties_audio_t *audio)
{
if (!audio)
return;
PFREE (audio->codec);
PFREE (audio);
}
开发者ID:GeeXboX,项目名称:libplayer,代码行数:9,代码来源:mrl_internal.c
示例10: json_find
SDB_IPI Rangstr json_find (const char *s, Rangstr *rs) {
#define RESFIXSZ 1024
RangstrType resfix[RESFIXSZ] = {0};
RangstrType *res = resfix;
int i, j, n, len, ret;
Rangstr rsn;
if (!s) {
return rangstr_null ();
}
len = strlen (s);
if (len > RESFIXSZ) {
res = calloc (len + 1, sizeof (RangstrType));
if (!res) {
eprintf ("Cannot allocate %d byte(s)\n", len + 1);
return rangstr_null ();
}
}
ret = js0n ((const unsigned char *)s, len, res);
#define PFREE(x) if (x && x != resfix) free (x)
if (ret > 0) {
PFREE (res);
return rangstr_null ();
}
if (*s == '[') {
n = rangstr_int (rs);
if (n < 0) {
goto beach;
}
for (i = j = 0; res[i] && j < n; i += 2, j++);
if (!res[i]) {
goto beach;
}
rsn = rangstr_news (s, res, i);
PFREE (res);
return rsn;
} else {
for (i=0; res[i]; i+=4) {
Rangstr rsn = rangstr_news (s, res, i);
if (!rangstr_cmp (rs, &rsn)) {
rsn = rangstr_news (s, res, i+2);
PFREE (res);
return rsn;
}
}
}
beach:
PFREE (res);
return rangstr_null ();
}
开发者ID:dtrecherel,项目名称:radare2,代码行数:56,代码来源:path.c
示例11: mrl_resource_videodisc_free
static void
mrl_resource_videodisc_free (mrl_resource_videodisc_args_t *args)
{
if (!args)
return;
PFREE (args->device);
PFREE (args->audio_lang);
PFREE (args->sub_lang);
}
开发者ID:GeeXboX,项目名称:libplayer,代码行数:10,代码来源:mrl_internal.c
示例12: mrl_resource_network_free
static void
mrl_resource_network_free (mrl_resource_network_args_t *args)
{
if (!args)
return;
PFREE (args->url);
PFREE (args->username);
PFREE (args->password);
PFREE (args->user_agent);
}
开发者ID:GeeXboX,项目名称:libplayer,代码行数:11,代码来源:mrl_internal.c
示例13: pl_playlist_free
void
pl_playlist_free (playlist_t *playlist)
{
if (!playlist)
return;
if (playlist->mrl_list)
mrl_list_free (playlist->mrl_list);
PFREE (playlist->shuffle_list);
PFREE (playlist);
}
开发者ID:GeeXboX,项目名称:libplayer,代码行数:12,代码来源:playlist.c
示例14: mrl_resource_tv_free
static void
mrl_resource_tv_free (mrl_resource_tv_args_t *args)
{
if (!args)
return;
PFREE (args->device);
PFREE (args->driver);
PFREE (args->channel);
PFREE (args->output_format);
PFREE (args->norm);
}
开发者ID:GeeXboX,项目名称:libplayer,代码行数:12,代码来源:mrl_internal.c
示例15: identpro_check_and_set_default_provider
/* called with cs_identpro held */
static void
identpro_check_and_set_default_provider(void)
{
wchar_t * p_order = NULL;
khm_size cb;
khm_handle csp_kcdb = NULL;
khm_int32 rv;
kcdb_identpro_i * p = NULL;
wchar_t * e;
if (KHM_SUCCEEDED(khc_open_space(NULL, L"KCDB", KHM_PERM_READ, &csp_kcdb))) {
rv = khc_read_multi_string(csp_kcdb, L"IdentityProviderOrder", NULL, &cb);
if (rv == KHM_ERROR_TOO_LONG && cb > sizeof(wchar_t) * 2) {
p_order = PMALLOC(cb);
rv = khc_read_multi_string(csp_kcdb, L"IdentityProviderOrder", p_order, &cb);
if (KHM_FAILED(rv)) {
PFREE(p_order);
p_order = NULL;
}
}
khc_close_space(csp_kcdb);
csp_kcdb = NULL;
}
for (e = p_order;
e && e[0];
e = multi_string_next(e)) {
p = identpro_find_by_name(e);
if (p)
break;
}
if (p != NULL) {
if (DEFAULT_PROVIDER != p) {
QDEL(&id_providers, p);
QPUSH(&id_providers, p);
#ifdef DEBUG
assert(DEFAULT_PROVIDER == p);
#endif
kcdbint_identpro_post_message(KCDB_OP_NEW_DEFAULT, DEFAULT_PROVIDER);
}
}
if (p)
identpro_release(p);
if (p_order)
PFREE(p_order);
}
开发者ID:secure-endpoints,项目名称:netidmgr,代码行数:51,代码来源:identpro.c
示例16: mrl_metadata_audio_free
static void
mrl_metadata_audio_free (mrl_metadata_audio_t *audio)
{
mrl_metadata_audio_t *audio_n;
while (audio)
{
PFREE (audio->name);
PFREE (audio->lang);
audio_n = audio->next;
PFREE (audio);
audio = audio_n;
}
}
开发者ID:GeeXboX,项目名称:libplayer,代码行数:14,代码来源:mrl_internal.c
示例17: kcdb_buf_delete
void kcdb_buf_delete(kcdb_buf * buf)
{
buf->cb_buffer = 0;
buf->cb_used = 0;
if(buf->buffer)
PFREE(buf->buffer);
buf->buffer = NULL;
buf->n_fields = 0;
buf->nc_fields = 0;
if(buf->fields)
PFREE(buf->fields);
buf->fields = NULL;
}
开发者ID:aosm,项目名称:Kerberos,代码行数:14,代码来源:buf.c
示例18: box_dt
/* box_dt - returns the distance between the
* center points of two boxes.
*/
double box_dt(BOX *box1, BOX *box2)
{
double result;
Point *box_center(),
*a, *b;
a = box_center(box1);
b = box_center(box2);
result = HYPOT(a->x - b->x, a->y - b->y);
PFREE(a);
PFREE(b);
return(result);
}
开发者ID:jarulraj,项目名称:postgres95,代码行数:17,代码来源:geo-ops.c
示例19: mrl_metadata_sub_free
static void
mrl_metadata_sub_free (mrl_metadata_sub_t *sub)
{
mrl_metadata_sub_t *sub_n;
while (sub)
{
PFREE (sub->name);
PFREE (sub->lang);
sub_n = sub->next;
PFREE (sub);
sub = sub_n;
}
}
开发者ID:GeeXboX,项目名称:libplayer,代码行数:14,代码来源:mrl_internal.c
示例20: switch
/*
** Distance from a point to a path
*/
double *dist_ppth(Point *pt, PATH *path)
{
double *result;
double *tmp;
int i;
LSEG lseg;
switch (path->npts) {
case 0:
result = PALLOCTYPE(double);
*result = Abs((double) DBL_MAX); /* +infinity */
break;
case 1:
result = point_distance(pt, &path->p[0]);
break;
default:
/*
* the distance from a point to a path is the smallest distance
* from the point to any of its constituent segments.
*/
Assert(path->npts > 1);
result = PALLOCTYPE(double);
for (i = 0; i < path->npts - 1; ++i) {
statlseg_construct(&lseg, &path->p[i], &path->p[i+1]);
tmp = dist_ps(pt, &lseg);
if (i == 0 || *tmp < *result)
*result = *tmp;
PFREE(tmp);
}
break;
}
return(result);
}
开发者ID:jarulraj,项目名称:postgres95,代码行数:36,代码来源:geo-ops.c
注:本文中的PFREE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论