当前位置: 首页>>代码示例>>C++>>正文


C++ pwr_Assert函数代码示例

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


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

示例1: lst_IsLinked

pwr_tBoolean
lst_IsLinked (
  thread_sMutex		*mp,
  lst_sEntry		*link
)
{
  pwr_tBoolean		is_linked;
  lst_sEntry		*pred;
  lst_sEntry		*succ;

  if (mp != NULL) sync_MutexLock(mp);

  pwr_Assert(checkInit(link));

  pred = link->blink;
  succ = link->flink;
  
  pwr_Assert(check(succ));
  pwr_Assert(check(pred));
  pwr_Assert(pred->flink == link);
  pwr_Assert(succ->blink == link);

  is_linked = link->flink != link;

  if (mp != NULL) sync_MutexUnlock(mp);

  return is_linked;
}
开发者ID:jordibrus,项目名称:proview,代码行数:28,代码来源:rt_lst.c

示例2: lst_InsertSucc

lst_sEntry *
lst_InsertSucc (
  thread_sMutex		*mp,
  lst_sEntry		*pred,		/* Insert after this element */
  lst_sEntry		*link,		/* link to insert */
  void			*item		/* Item to insert */
)
{
  lst_sEntry		*succ;

  if (mp != NULL) sync_MutexLock(mp);

  pwr_Assert(checkInit(link));

  succ = pred->flink;
  
  pwr_Assert(check(succ));
  pwr_Assert(check(pred));
  pwr_Assert(succ->blink == pred);

  link->blink = pred;
  link->flink = pred->flink;
  pred->flink = succ->blink = link;
  if (item != NULL)
    link->item = item;

  if (mp != NULL) sync_MutexUnlock(mp);

  return succ;  
}
开发者ID:jordibrus,项目名称:proview,代码行数:30,代码来源:rt_lst.c

示例3: cvolcm_FlushNode

void cvolcm_FlushNode(pwr_tStatus* sts, gdb_sNode* np)
{
  pool_sQlink* vl;
  gdb_sVolume* vp;
  gdb_sCclassVolume* cvp;
  pwr_tStatus lsts;

  gdb_AssumeLocked;
  pwr_Assert(np != gdbroot->my_node && np != gdbroot->no_node);

  for (vl = pool_Qsucc(NULL, gdbroot->pool, &np->own_lh); vl != &np->own_lh;
       vl = pool_Qsucc(NULL, gdbroot->pool, &np->own_lh)) {
    vp = pool_Qitem(vl, gdb_sVolume, l.own_ll);
    pwr_Assert(vp->l.flags.b.isCached);
    if (vp->l.flags.b.isCached)
      cvolcm_FlushVolume(NULL, vp);
  }

  for (vl = pool_Qsucc(NULL, gdbroot->pool, &np->ccvol_lh); vl != &np->ccvol_lh;
       vl = pool_Qsucc(NULL, gdbroot->pool, &np->ccvol_lh)) {
    cvp = pool_Qitem(vl, gdb_sCclassVolume, ccvol_ll);

    hash_Remove(&lsts, gdbroot->ccvol_ht, cvp);
    if (EVEN(lsts))
      errh_Bugcheck(lsts, "cached class volume inconsistency");

    pool_Qremove(NULL, gdbroot->pool, &cvp->ccvol_ll);
    pool_Free(NULL, gdbroot->pool, cvp);
  }
}
开发者ID:siamect,项目名称:proview,代码行数:30,代码来源:rt_cvolcm.c

示例4: lst_InsertPred

lst_sEntry *
lst_InsertPred (
  thread_sMutex		*mp,
  lst_sEntry		*succ,		/* Insert before this element */
  lst_sEntry		*link,		/* Link to insert */
  void			*item		/* Item to insert */
)
{
  lst_sEntry		*pred;

  if (mp != NULL) sync_MutexLock(mp);

  pwr_Assert(checkInit(link));

  pred = succ->blink;
  
  pwr_Assert(check(succ));
  pwr_Assert(check(pred));
  pwr_Assert(pred->flink == succ);

  link->flink = succ;
  link->blink = succ->blink;
  succ->blink = pred->flink = link;
  if (item != NULL)
    link->item = item;

  if (mp != NULL) sync_MutexUnlock(mp);

  return pred;  
}
开发者ID:jordibrus,项目名称:proview,代码行数:30,代码来源:rt_lst.c

示例5: lst_IsSucc

pwr_tBoolean
lst_IsSucc (
  thread_sMutex		*mp,
  lst_sEntry		*pred,
  lst_sEntry		*link
)
{
  lst_sEntry		*succ;
  pwr_tBoolean		is_succ;

  if (mp != NULL) sync_MutexLock(mp);

  pwr_Assert(check(pred));
  pwr_Assert(check(link));


  succ = link->flink;
  
  if (succ != NULL) {
    pwr_Assert(check(succ));
    pwr_Assert(succ->blink == link);
    pwr_Assert(link->flink == succ);
  }

  is_succ = pred->flink == link;

  if (mp != NULL) sync_MutexUnlock(mp);

  return is_succ;  
}
开发者ID:jordibrus,项目名称:proview,代码行数:30,代码来源:rt_lst.c

示例6: dbs_Qinsert

dbs_sQlink *
dbs_Qinsert(pwr_tStatus *sts, dbs_sQlink *pred, dbs_sQlink *item, dbs_sQlink *succ)
{

    pwr_Assert(pred->succ == succ->self);
    pwr_Assert(succ->pred == pred->self);

    pred->succ = succ->pred = item->self;
    item->pred = pred->self;
    item->succ = succ->self;

    return item;
}
开发者ID:jordibrus,项目名称:proview,代码行数:13,代码来源:co_dbs.c

示例7: dbs_QisNull

pwr_tBoolean
dbs_QisNull(pwr_tStatus *sts, const dbs_sVenv *vep, dbs_sQlink *item)
{
    pwr_tBoolean nullQ;

    nullQ = (item->self == dbs_cNref)
        || (item->pred == dbs_cNref)
        || (item->succ == dbs_cNref);
  
    pwr_Assert(item->pred == dbs_cNref);
    pwr_Assert(item->succ == dbs_cNref);
    pwr_Assert(item->self  == dbs_cNref);

    return nullQ;
}
开发者ID:jordibrus,项目名称:proview,代码行数:15,代码来源:co_dbs.c

示例8: subs_UnlinkObject

void
subs_UnlinkObject (
  gdb_sObject		*op
)
{
  sub_sServer		*sp;
  pool_sQlink		*sl;
  
  gdb_AssumeLocked;

  for (
    sl = pool_Qsucc(NULL, gdbroot->pool, &gdbroot->db->subs_lh);
    sl != &gdbroot->db->subs_lh;
  ) {
    sp = pool_Qitem(sl, sub_sServer, subs_ll);
    if (cdh_ObjidIsEqual(sp->aref.Objid, op->g.oid)) {
      sp->data	= pool_cNRef;
      sp->sts	= GDH__NOSUCHOBJ;

      if ( op->u.n.subcount > 0) /* Subscriptions on invalid offset will allocate buffer without increasing count */
	op->u.n.subcount--;
    }
  }

  pwr_Assert(op->u.n.subcount == 0);

}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:27,代码来源:rt_subs.c

示例9: subs_UnlinkObject

void
subs_UnlinkObject (
    gdb_sObject		*op
)
{
    sub_sServer		*sp;
    pool_sQlink		*sl;

    gdb_AssumeLocked;

    for (
        sl = pool_Qsucc(NULL, gdbroot->pool, &gdbroot->db->subs_lh);
        sl != &gdbroot->db->subs_lh;
    ) {
        sp = pool_Qitem(sl, sub_sServer, subs_ll);
        if (cdh_ObjidIsEqual(sp->aref.Objid, op->g.oid)) {
            sp->data	= pool_cNRef;
            sp->sts	= GDH__NOSUCHOBJ;

            op->u.n.subcount--;
        }
    }

    pwr_Assert(op->u.n.subcount == 0);

}
开发者ID:hfuhuang,项目名称:proview,代码行数:26,代码来源:rt_subs.c

示例10: cvolcm_ExternVolumeFlush

void cvolcm_ExternVolumeFlush(gdb_sNode* np)
{
  pool_sQlink* vl;
  gdb_sVolume* vp;
  pool_sQlink* ol;
  gdb_sObject* op;
  gdb_sMountServer* msp;
  pwr_tStatus sts;

  // Flush local node
  gdb_AssumeLocked;

  for (vl = pool_Qsucc(NULL, gdbroot->pool, &np->own_lh); vl != &np->own_lh;
       vl = pool_Qsucc(NULL, gdbroot->pool, vl)) {
    vp = pool_Qitem(vl, gdb_sVolume, l.own_ll);
    pwr_Assert(vp->l.flags.b.isCached);
    if (vp->l.flags.b.isCached) {
      for (ol = pool_Qsucc(NULL, gdbroot->pool, &vp->l.obj_lh);
           ol != &vp->l.obj_lh;
           ol = pool_Qsucc(NULL, gdbroot->pool, &vp->l.obj_lh)) {
        op = pool_Qitem(ol, gdb_sObject, l.obj_ll);
        if (op->l.flags.b.isMountServer) {
          msp = (gdb_sMountServer*)hash_Search(
              &sts, gdbroot->ms_ht, &op->g.oid);
          if (msp == NULL)
            errh_Bugcheck(sts, "mount server inconsitency");
          msp->msor = pool_cNRef;
          pool_Qremove(NULL, gdbroot->pool, &msp->nodms_ll);
          /* Todo !!! Clear alarm and blocklevel in all mount clients. */
        }
        cvol_FlushObject(op);
      }
    }
  }
}
开发者ID:siamect,项目名称:proview,代码行数:35,代码来源:rt_cvolcm.c

示例11: ivol_BuildVolume

pwr_tBoolean
ivol_BuildVolume (
  pwr_tStatus		*status,
  gdb_sVolume		*vp
)
{
  pool_sQlink		*ol;
  gdb_sObject		*op;

  pwr_dStatus(sts, status, GDH__SUCCESS);

  /* First link the volume block.  */


  /* Now link all objects.  */

  for (
    ol = pool_Qsucc(sts, gdbroot->pool, &vp->l.obj_lh);
    ol != &vp->l.obj_lh;
    ol = pool_Qsucc(sts, gdbroot->pool, ol)
  ) {
    op = pool_Qitem(ol, gdb_sObject, l.obj_ll);

    vol_LinkObject(sts, vp, op, vol_mLink_build);
    pwr_Assert(ODD(*sts));

  }
  return YES;
}
开发者ID:Strongc,项目名称:proview,代码行数:29,代码来源:rt_ivol.c

示例12: buildScObjects

static pwr_tBoolean
buildScObjects (
  pwr_tStatus		*status,
  gdb_sVolume		*vp
)
{
  pool_sQlink		*scl;
  gdb_sScObject		*scp;

  pwr_dStatus(sts, status, GDH__SUCCESS); 

  /* Link all sc objects.  */

  for (
    scl = pool_Qsucc(sts, gdbroot->pool, &vp->u.n.sc_lh);
    scl != &vp->u.n.sc_lh;
    scl = pool_Qsucc(sts, gdbroot->pool, scl)
  ) {
    scp = pool_Qitem(scl, gdb_sScObject, sc_ll);

    vol_LinkScObject(sts, vp, scp, vol_mLinkSc_build);
    pwr_Assert(ODD(*sts));

  }
  return YES;
}
开发者ID:Strongc,项目名称:proview,代码行数:26,代码来源:rt_ivol.c

示例13: mountClients

static pwr_tBoolean
mountClients (
  pwr_tStatus		*sts,
  gdb_sVolume		*vp
)
{
  pool_sQlink		*ol;
  gdb_sObject		*op;

  /* First link the volume block.  */


  /* Now link all objects.  */

  for (
    ol = pool_Qsucc(sts, gdbroot->pool, &vp->l.obj_lh);
    ol != &vp->l.obj_lh;
    ol = pool_Qsucc(sts, gdbroot->pool, ol)
  ) {
    op = pool_Qitem(ol, gdb_sObject, l.obj_ll);

    if (op->g.flags.b.isMountClient && op->g.oid.vid == gdbroot->db->vid) {
      /* Only root volumes can mount.  */
      mountVolume(sts, op);
      if ( *sts != GDH__NOMOUNTOBJECT)
	pwr_Assert(ODD(*sts));
    }
  }
  return YES;
}
开发者ID:Strongc,项目名称:proview,代码行数:30,代码来源:rt_ivol.c

示例14: time_Uptime

pwr_tDeltaTime *
time_Uptime (
  pwr_tStatus	  *status,
  pwr_tDeltaTime  *tp,
  pwr_tDeltaTime  *ap
)
{
  pwr_tDeltaTime  time;
  long		  tics;
  void		  *argv[2];

  pwr_dStatus(sts, status, TIME__SUCCESS);

  if (tp == NULL)
    tp = &time;

  argv[0] = (void *) 1;
  argv[1] = &tics;

  *sts = sys$cmexec(&uptime, argv);

  tp->tv_sec = tics / 100;
  tp->tv_nsec = (tics % 100) * 10000000;

  pwr_Assert(tp->tv_sec >= 0 && tp->tv_nsec >= 0);

  if (ap != NULL)
    return time_Dadd(tp, tp, ap);
  else
    return tp;
}
开发者ID:hfuhuang,项目名称:proview,代码行数:31,代码来源:co_time_spec.c

示例15: time_Adiff

pwr_tDeltaTime *
time_Adiff (
  pwr_tDeltaTime  *r,
  pwr_tTime   *t,
  pwr_tTime   *s
)
{
  pwr_tInt64     tv_nsec = t->tv_nsec - s->tv_nsec;
  pwr_tInt64     tv_sec  = t->tv_sec  - s->tv_sec;

  pwr_Assert(r != NULL);
  assertAbs(t);
  assertAbs(s);

  tv_sec  = tv_sec + tv_nsec / 1000000000;
  tv_nsec = tv_nsec % 1000000000;
  if (tv_nsec < 0 && tv_sec > 0) {
    tv_sec--;
    tv_nsec += 1000000000;
  } else if (tv_sec < 0 && tv_nsec > 0) {
    tv_sec++;
    tv_nsec -= 1000000000;
  }

  r->tv_sec = tv_sec;
  r->tv_nsec = tv_nsec;

  return r;
}
开发者ID:jordibrus,项目名称:proview,代码行数:29,代码来源:co_time.c


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