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


C++ TAG函数代码示例

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


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

示例1: eppic_newvlist

/* get a new empty vlist */
var_t*
eppic_newvlist()
{
var_t*p=eppic_newvar("");
    TAG(p);
    TAG(p->name);
    return p;
}
开发者ID:lucchouina,项目名称:eppic,代码行数:9,代码来源:eppic_var.c

示例2: DEBUG_WARNING

/**
 * Loads the template data from an iff file. We should already be in the form
 * for this template.
 *
 * @param file		file to load from
 */
void ServerStaticObjectTemplate::load(Iff &file)
{
static const int MAX_NAME_SIZE = 256;
char paramName[MAX_NAME_SIZE];

	if (file.getCurrentName() != ServerStaticObjectTemplate_tag)
	{
		ServerObjectTemplate::load(file);
		return;
	}

	file.enterForm();
	m_templateVersion = file.getCurrentName();
	if (m_templateVersion == TAG(D,E,R,V))
	{
		file.enterForm();
		file.enterChunk();
		std::string baseFilename;
		file.read_string(baseFilename);
		file.exitChunk();
		const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
		DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
		if (m_baseData == base && base != NULL)
			base->releaseReference();
		else
		{
			if (m_baseData != NULL)
				m_baseData->releaseReference();
			m_baseData = base;
		}
		file.exitForm();
		m_templateVersion = file.getCurrentName();
	}
	if (getHighestTemplateVersion() != TAG(0,0,0,1))
	{
		if (DataLint::isEnabled())
			DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
	}

	file.enterForm();

	file.enterChunk();
	int paramCount = file.read_int32();
	file.exitChunk();
	for (int i = 0; i < paramCount; ++i)
	{
		file.enterChunk();
		file.read_string(paramName, MAX_NAME_SIZE);
		if (strcmp(paramName, "clientOnlyBuildout") == 0)
			m_clientOnlyBuildout.loadFromIff(file);
		file.exitChunk(true);
	}

	file.exitForm();
	ServerObjectTemplate::load(file);
	file.exitForm();
	return;
}	// ServerStaticObjectTemplate::load
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:64,代码来源:ServerStaticObjectTemplate.cpp

示例3: LOGSTRING3

inline TInt DMemSamplerImpl::GatherThreads()
    {
    // The thread memory consumption
    
    NKern::ThreadEnterCS(); // Prevent us from dying or suspending whilst holding a DMutex
    DObjectCon& threads = *Kern::Containers()[EThread];
    threads.Wait(); // Obtain the container mutex so the list does get changed under us
    
    this->iThreadCount = 0; 
    this->iNewThreadCount = 0;
    this->iTotalMemoryOk = false;           

    TInt totalThreadCount = threads.Count();

    for(TInt i(0);i<totalThreadCount;i++)
        {
        DThread* t = (DThread*)(threads)[i];

        LOGSTRING3("Processing thread %d, tag: 0x%x",i,TAG(t));

        if( (TAG(t) & PROFILER_MEM_THREAD_MARK) == 0)
            {
            LOGSTRING4("Marking thread %d/%d, old tag 0x%x",i,(totalThreadCount-1), TAG(t));
            // this thread's chunk has not been reported yet
            this->threadNamesToReport[iNewThreadCount] = t;
            iNewThreadCount++;
            // tag the thread
            TAG(t) |= PROFILER_MEM_THREAD_MARK;
            }

        // the chunk has been tagged, add heap chunks to the list
        this->threadsToSample[this->iThreadCount] = t;
        this->iThreadCount++;
        LOGSTRING2("Added thread %d to threads to sample",i);
        }
    
    if(this->iThreadCount > 0 || this->iNewThreadCount > 0)
        {
        this->iThreadsProcessing = EStartingToProcess;
        
        // process the first sample
        TInt length = this->ProcessThreads();
        
        if(length == 0)
            {
            this->iThreadsProcessing = ENothingToProcess;
            }
        threads.Signal();  // Release the container mutex
        NKern::ThreadLeaveCS();  // End of critical section
        return length;
        }
    
    LOGTEXT("MemSamplerImpl::SampleImpl - Error, no threads"); 
    threads.Signal();  // Release the container mutex
    NKern::ThreadLeaveCS();  // End of critical section
    return 0;
    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:57,代码来源:MemSamplerImpl.cpp

示例4: pagemain

int pagemain(int argc, char** argv) {
  struct html_builder builderv;
  struct html_builder *builder = &builderv;
  UNUSED(argc);
  UNUSED(argv);
  char output[MAXOUTPUT] = { 0 };
  
  webpage_start(builder, "Brainfuck", "Brainfuck-fortolker");

  TAG(("article"),
    TAG(("header"),
      TAG(("h1"), TEXT("Brainfuck-fortolker"));
    TAG(("p"), TEXT("Har du også svært ved at programmere i C, men kan sagtens finde ud af at programmere i Brianfuck?"));
    TAG(("p"), TEXT("Så er denne fortolker noget for dig!"));
    if ( getenv("CONTENT_LENGTH") != NULL ) {
      if ( handle_postdata(output) == 0 ) {
    TAG(("p", "style", "font-weight: bold;"), TEXT("Her er dit nye C-program:"));
    TAG(("pre"), TEXT(output));
      } else {
    TAG(("p", "style", "font-weight: bold;"), TEXT("Hva sulan!  Dit Brainfuck-kode kunne ikke oversættes til C!"));
      }
    } else {
    TAG(("form", "method", "post"),/*, "enctype", "multipart/form-data"),*/
      TAG(("fieldset"),
        TAG(("legend"), TEXT("Brainfuck til C"));
        TAG(("label", "for", "brainfuck-program"), TEXT("Programmet:"));
        TAG(("textarea", "type", "text", "id", "brainfuck-program", "name", "brainfuck-program", "rows", "15", "cols", "52"), TEXT(""));
        TAG(("input", "type", "submit", "name", "brainfuck-submit", "value", "Oversæt!"), );
        )
      )
    }
开发者ID:svip,项目名称:THC,代码行数:31,代码来源:brainfuck.c

示例5: switch

cell factor_vm::object_class(cell obj)
{
	switch(TAG(obj))
	{
	case TUPLE_TYPE:
		return untag<tuple>(obj)->layout;
	case OBJECT_TYPE:
		return untag<object>(obj)->h.value;
	default:
		return tag_fixnum(TAG(obj));
	}
}
开发者ID:chris-ream,项目名称:factor,代码行数:12,代码来源:dispatch.cpp

示例6: DEBUG_WARNING

/**
 * Loads the template data from an iff file. We should already be in the form
 * for this template.
 *
 * @param file		file to load from
 */
void ServerPlayerQuestObjectTemplate::load(Iff &file)
{
static const int MAX_NAME_SIZE = 256;
char paramName[MAX_NAME_SIZE];

	if (file.getCurrentName() != ServerPlayerQuestObjectTemplate_tag)
	{
		ServerTangibleObjectTemplate::load(file);
		return;
	}

	file.enterForm();
	m_templateVersion = file.getCurrentName();
	if (m_templateVersion == TAG(D,E,R,V))
	{
		file.enterForm();
		file.enterChunk();
		std::string baseFilename;
		file.read_string(baseFilename);
		file.exitChunk();
		const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
		DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
		if (m_baseData == base && base != NULL)
			base->releaseReference();
		else
		{
			if (m_baseData != NULL)
				m_baseData->releaseReference();
			m_baseData = base;
		}
		file.exitForm();
		m_templateVersion = file.getCurrentName();
	}
	if (getHighestTemplateVersion() != TAG(0,0,0,0))
	{
		if (DataLint::isEnabled())
			DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
		m_versionOk = false;
	}

	file.enterForm();

	file.enterChunk();
	int paramCount = file.read_int32();
	file.exitChunk();
	UNREF(paramName);
	UNREF(paramCount);

	file.exitForm();
	ServerTangibleObjectTemplate::load(file);
	file.exitForm();
	return;
}	// ServerPlayerQuestObjectTemplate::load
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:59,代码来源:ServerPlayerQuestObjectTemplate.cpp

示例7: op_errormessage

P op_errormessage(void)
{
  LBIG e, pid, port;
  P nb, tnb; 
  B *m, *s;

  if (o_6 < FLOORopds) goto baderror;
  if (CLASS(o_6) != NUM) goto baderror;
  if (! VALUE(o_6, &pid)) goto baderror;
  if (TAG(o_5) != (ARRAY | BYTETYPE)) goto baderror;
  if (CLASS(o_4) != NUM) goto baderror;
  if (! VALUE(o_4, &port)) goto baderror;
  if (TAG(o_3) != (ARRAY | BYTETYPE)) goto baderror;
  if (CLASS(o_2) != NUM) goto baderror;
  if (!VALUE(o_2, &e)) goto baderror;
  if (TAG(o_1) != (ARRAY | BYTETYPE)) goto baderror;

  s = (B *)VALUE_BASE(o_1); 
  tnb = ARRAY_SIZE(o_1);
  nb = dm_snprintf((char*) s, tnb, "On %*s port %llu, pid %llu: ",
		   (int) ARRAY_SIZE(o_5),
		   (char*) VALUE_BASE(o_5),
                   (unsigned long long) port,
		   (unsigned long long) pid);
  s += nb;
  tnb -= nb;

  if ((P)e < 0) /*Clib error */
    nb = dm_snprintf((char*) s, tnb, "errno: %s",
		     (char*) strerror(-(int)e));
  else { /* one of our error codes: decode */
    m = geterror((P) e);
    nb = strlen((char*) m);
    if (nb > tnb) nb = tnb;
    moveB(m, s, nb);
  }
  s += nb;
  tnb -= nb;

  nb = dm_snprintf((char*)s, tnb, " in %*s\n",
		   (int) ARRAY_SIZE(o_3),
		   (char*) VALUE_BASE(o_3));

  ARRAY_SIZE(o_1) = (P)(s + nb) - VALUE_BASE(o_1);
  moveframe(o_1,o_6);
  FREEopds = o_5;
  return OK;

 baderror:
  printf("**Error with corrupted error info on operand stack!\n");
  return op_halt();
}
开发者ID:apeyser,项目名称:Deuterostome,代码行数:52,代码来源:dm-dnode.c

示例8: _dialogLoadInit

static void
_dialogLoadInit (
        Dialog    *dialog,
        vresource  res
    )
{
    vclassSendSuper (_dialogClass, vobjectLOAD_INIT, (dialog, res));

    dialog->completeItem = (completeitem *)
        vdialogFindItem ((vdialog *) dialog, TAG ("CompleteItem"));
    dialog->completeList = (completelist *)
        vdialogFindItem ((vdialog *) dialog, TAG ("CompleteList"));
}
开发者ID:cortlandstarrett,项目名称:generator,代码行数:13,代码来源:complete.c

示例9: gc_initialize

static void gc_initialize(unsigned int heap_size)
{
    gc_space_size = heap_size;
    gc_free = gc_cur_space = malloc(gc_space_size);
    memset(gc_cur_space, 0xcd, gc_space_size);
    gc_to_space = malloc(gc_space_size);
    memset(gc_to_space, 0xfd, gc_space_size);
    heap_end = gc_cur_space + gc_space_size;

    if (TAG(gc_cur_space) != 0 || TAG(gc_to_space) != 0) {
        error_exit("memory not aligned\n");
    }
}
开发者ID:nobutaka,项目名称:nanopass,代码行数:13,代码来源:startup.c

示例10: check_gost

static int
check_gost(const dst_private_t *priv, isc_boolean_t external) {

	if (external)
		return ((priv->nelements == 0)? 0 : -1);

	if (priv->nelements != GOST_NTAGS)
		return (-1);
	if ((priv->elements[0].tag != TAG(DST_ALG_ECCGOST, 0)) &&
	    (priv->elements[0].tag != TAG(DST_ALG_ECCGOST, 1)))
		return (-1);
	return (0);
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:13,代码来源:dst_parse.c

示例11: bdd_lookup_in_cache31

int
bdd_lookup_in_cache31(cmu_bdd_manager bddm, int tag, INT_PTR d1, INT_PTR d2, INT_PTR d3, INT_PTR *result)
{
  long hash;
  cache_entry *bin;
  cache_entry p;
  cache_entry q;
  bdd f;
  void (*return_fn)(cmu_bdd_manager, cache_entry);

  bddm->op_cache.lookups++;
  hash=HASH3(d1, d2, d3);
  BDD_REDUCE(hash, bddm->op_cache.size);
  bin=bddm->op_cache.table[hash].entry;
  if ((p=bin[0]))
    {
      q=CACHE_POINTER(p);
      if (q->slot[0] != d1 || q->slot[1] != d2 || q->slot[2] != d3 || TAG(p) != tag)
	{
	if ((p=bin[1]))
	  {
	    q=CACHE_POINTER(p);
	    if (q->slot[0] != d1 || q->slot[1] != d2 || q->slot[2] != d3 || TAG(p) != tag)
	      return (0);
	    bin[1]=bin[0];
	    bin[0]=p;
	  }
	else
	  return (0);
	}
    }
  else
    return (0);
  bddm->op_cache.hits++;
  if ((return_fn=bddm->op_cache.return_fn[TAG(p)]))
    {
    if (return_fn == RETURN_BDD_FN)
      {
	f=(bdd)q->slot[3];
	{
	  BDD_SETUP(f);
	  BDD_TEMP_INCREFS(f);
	}
      }
    else
      (*return_fn)(bddm, q);
    }
  *result=q->slot[3];
  return (1);
}
开发者ID:lucadealfaro,项目名称:ticc,代码行数:50,代码来源:bddcache.c

示例12: create_task_grid

static int create_task_grid(unsigned piter)
{
	unsigned i, j;
	int ret;

/*	FPRINTF(stderr, "start iter %d...\n", piter); */
	callback_cnt = (ni*nj);

	/* create non-entry tasks */
	for (j = 0; j < nj; j++)
	for (i = 1; i < ni; i++)
	{
		/* create a new task */
		struct starpu_task *task = starpu_task_create();
		task->callback_func = callback_cpu;
		/* jb->argcb = &coords[i][j]; */
		task->cl = &cl;
		task->cl_arg = NULL;

		task->use_tag = 1;
		task->tag_id = TAG(i, j, piter);

		/* express deps : (i,j) depends on (i-1, j-1) & (i-1, j+1) */
		express_deps(i, j, piter);

		ret = starpu_task_submit(task);
		if (ret == -ENODEV) return 77;
		STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
	}

	/* create entry tasks */
	for (j = 0; j < nj; j++)
	{
		/* create a new task */
		struct starpu_task *task = starpu_task_create();
		task->callback_func = callback_cpu;
		task->cl = &cl;
		task->cl_arg = NULL;

		task->use_tag = 1;
		/* this is an entry task */
		task->tag_id = TAG(0, j, piter);

		ret = starpu_task_submit(task);
		if (ret == -ENODEV) return 77;
		STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
	}
	return 0;
}
开发者ID:excess-project,项目名称:starpu-ex-1.2.0rc5,代码行数:49,代码来源:tag_example.c

示例13: op_screensize

P op_screensize(void)
{
#if X_DISPLAY_MISSING
	return NO_XWINDOWS;
#else
  if (dvtdisplay == NULL) return NO_XWINDOWS;
  if (o2 > CEILopds) return OPDS_OVF;
  TAG(o1) = TAG(o2) = NUM | LONGBIGTYPE; 
  ATTR(o1) = ATTR(o2) = 0;
  LONGBIG_VAL(o1) = rootwindowattr.width;
  LONGBIG_VAL(o2) = rootwindowattr.height;
  FREEopds = o3;
  return OK;
#endif
}
开发者ID:apeyser,项目名称:Deuterostome,代码行数:15,代码来源:dm9.c

示例14: TAG

cell factor_vm::lookup_method(cell obj, cell methods)
{
	cell tag = TAG(obj);
	cell method = array_nth(untag<array>(methods),tag);

	if(tag == TUPLE_TYPE)
	{
		if(TAG(method) == ARRAY_TYPE)
			return lookup_tuple_method(obj,method);
		else
			return method;
	}
	else
		return method;
}
开发者ID:mcandre,项目名称:factor,代码行数:15,代码来源:dispatch.cpp

示例15: combinations

// n k | (n/k)
DM_INLINE_STATIC P combinations(void) {
  P n, k, i, j;

  if (o_2 < FLOORopds) return OPDS_UNF;
  if (CLASS(o_1) != NUM) return OPD_CLA;
  if (CLASS(o_2) != NUM) return OPD_CLA;
  if (! PVALUE(o_2, &n)) return UNDF_VAL;
  if (! PVALUE(o_1, &k)) return UNDF_VAL;
  if (n < 0 || k < 0 || n < k) return RNG_CHK;
  if (n > max_kn) return RNG_CHK;

  TAG(o_2) = (NUM | DOUBLETYPE);
  ATTR(o_2) = 0;
  FREEopds = o_1;
  if (n == k || k == 0) {
    *(D*) NUM_VAL(o_1) = 1;
    return OK;
  }

  if (n <= max_n) {
    *(D*) NUM_VAL(o_1) = binom[n][k];
    return OK;
  }

  for (i = max_n+1; i <= n; ++i) {
    binom[i][0] = binom[i][i] = 1;
    for (j = 1; j < i; ++j) {
      binom[i][j] = binom[i-1][j-1] + binom[i-1][j];
    }
  }
  max_n = n;

  *(D*) NUM_VAL(o_1) = binom[n][k];
  return OK;
}
开发者ID:apeyser,项目名称:Deuterostome,代码行数:36,代码来源:stats.c


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