QString CFormulaNode::getMathMLNodeDescription()
{
	QString res = _T("");
	if( isAutodetectContent() )
	{
		QString res = getMathMLNodeDescription_IterateParent();
		if( res.length() ) return res;
		res = _T("autodetected by content");
	}
	else if( !isRWMMLSupport() )
		res = _T("unsupported in MathML");
	else if( isIgnoreContentConversion() )
		res = _T("auxiliary");
	else if( to_mathml_data.type.length() && 
			 !xml_strcmp(to_mathml_data.type, "table") &&
			 to_mathml_data.name.length() )
		res = _T("<mtable>");
	else if( to_mathml_data.type.length() && !xml_strcmp(to_mathml_data.type, "bracket") )
		res = _T("<mfence>");
	else if( to_mathml_data.name.length() )
	{
		QString op = _T("");
		if( to_mathml_data.name == FBL_TAG_apply )
			op = getApplyOp();
		res = QString( _T("\"") ) + to_mathml_data.name + QString( _T("\"") );
		if( op.length() )
			res += QString( _T(" (") ) + op + QString( _T(")") );
	}
	else if( to_mathml_data.value.length() && to_mathml_data.type.length() )
		res = QString( _T("\"") ) + to_mathml_data.type + QString( _T("\"") );
	else if( to_mathml_data.mathml_template_string.length() && !isReferenced() )
	{
		res = _T("");
		for( long i = 0; i < to_mathml_data.mathml_template_string.length() && 
								  to_mathml_data.mathml_template_string.at(i) != QChar('\n'); i++ )
		{
			res.append( to_mathml_data.mathml_template_string.at(i) );
		}
	}

	if( res.length() == 0 )
		return getMathMLNodeDescription_IterateParent();

	res += _T(" element");
	return res;
}
Beispiel #2
0
ArrayCommon::RefCheckResult
ArrayCommon::CheckForRefs(const ArrayData* ad) {
  auto result = RefCheckResult::Pass;
  IterateV(
    ad,
    [&](const TypedValue* v) {
      if (UNLIKELY(v->m_type == KindOfRef)) {
        auto const ref = v->m_data.pref;
        if (ref->isReferenced() || ref->tv()->m_data.parr == ad) {
          result = RefCheckResult::Fail;
          return true;
        }
        result = RefCheckResult::Collapse;
      }
      return false;
    }
  );
  return result;
}
Beispiel #3
0
CFileRegion::~CFileRegion()
{	
	assert(!isReferenced());
	
	for (auto it = children_.begin(); it != children_.end(); it = children_.begin())
	{
		CFileRegion* child = *it;
		
		if (parent_)
			parent_->readopt_(child);
		else
		{
			child->orphan_();
			delete child;
		}
	}
	
	if (parent_)
		orphan_();
		
	unmap_();
}
// LCOV_EXCL_START :dpm
// -----------------------------------------------------------------------
// Print function for debugging
// -----------------------------------------------------------------------
void NAColumn::print(FILE* ofd, const char* indent, const char* title,
                     CollHeap *c, char *buf) const
{
    const Int32 A = 0x18, D = 0x19; // up-arrow, down-arrow; just to be cute
  char ckstr[3+1];
  SortOrdering cko = getClusteringKeyOrdering();
  if (cko == ASCENDING)		sprintf(ckstr, "ck%c", A);
  else if (cko == DESCENDING)	sprintf(ckstr, "ck%c", D);
  else				ckstr[0] = '\0';

  Space * space = (Space *)c;
  char mybuf[1000];
  sprintf(mybuf,"%s%s %-8s %-16s %d\t| %2s %2s %2s %3s %s %s\n",
          title, indent, colName_.data(),
          type_->getTypeSQLname(TRUE/*terse*/).data(), position_,
          isIndexKey()        ? "ik"  : "",
          isPartitioningKey() ? "hp"  : "",
          isPrimaryKey()      ? "pk"  : "",
          ckstr,
          isComputedColumn() ? computedColumnExpression_ : "",
          isReferencedForHistogram() ? "refForHist" :
          isReferenced() ? "ref" : "");
  PRINTIT(ofd, c, space, buf, mybuf);
}
Beispiel #5
0
void drawEntities(int depth)
{
	int i, drawn, removeCount;
	EntityList *el, *prev, *el2;

	/* Draw standard entities */

	if (depth == -1)
	{
		for (el=entities->next;el!=NULL;el=el->next)
		{
			self = el->entity;

			if (self->inUse == TRUE)
			{
				if (self->draw == NULL)
				{
					showErrorAndExit("%s has no draw function", self->name);
				}

				self->draw();
			}
		}
	}

	else
	{
		for (i=0;i<MAX_ENTITIES;i++)
		{
			self = drawLayer[depth][i];

			if (self == NULL)
			{
				break;
			}

			if (self->inUse == TRUE && !(self->flags & NO_DRAW) && self->layer == depth)
			{
				if (self->draw == NULL)
				{
					showErrorAndExit("%s has no draw function", self->name);
				}

				drawn = self->draw();

				/* Live for 2 minutes whilst on the screen */

				if (drawn == TRUE && (self->flags & SPAWNED_IN))
				{
					self->spawnTime = SPAWNED_IN_TIME;
				}

				else if (drawn == FALSE && (self->flags & SPAWNED_IN) && self->spawnTime <= 0 && (self->spawnTime % 60 == 0))
				{
					/* Teleport expired enemies beneath the map */

					if (self->health != 0)
					{
						self->y = (MAX_MAP_Y + 1) * TILE_SIZE;

						self->action = &entityDieNoDrop;
					}
				}
			}
		}
	}

	if (game.frames % 300 == 0)
	{
		removeCount = 0;

		prev = entities;

		for (el=entities->next;el!=NULL;el=el2)
		{
			el2 = el->next;

			if (el->entity->inUse == FALSE && isReferenced(el->entity) == FALSE)
			{
				prev->next = el2;

				removeCount++;

				free(el->entity);

				el->entity = NULL;

				free(el);

				el = NULL;
			}

			else
			{
				prev = prev->next;
			}
		}

		#if DEV == 1
		if (removeCount != 0)
		{
			printf("Removed %d entities taking up %d bytes\n", removeCount, (int)sizeof(Entity) * removeCount);
		}
		#endif
	}
}