예제 #1
0
파일: Setting.cpp 프로젝트: mariuz/haiku
BVariant
OptionsSetting::DefaultValue() const
{
	SettingsOption* option = DefaultOption();
	return option != NULL
		? BVariant(option->ID(), B_VARIANT_DONT_COPY_DATA) : BVariant();
}
예제 #2
0
파일: DwarfTypes.cpp 프로젝트: RAZVOR/haiku
status_t
DwarfType::CreateDerivedArrayType(int64 lowerBound, int64 elementCount,
	bool extendExisting, ArrayType*& _resultType)
{
	DwarfArrayType* resultType = NULL;
	BReference<DwarfType> baseTypeReference;
	if (extendExisting)
		resultType = dynamic_cast<DwarfArrayType*>(this);

	if (resultType == NULL) {
		resultType = new(std::nothrow)
			DwarfArrayType(fTypeContext, fName, NULL, this);
		baseTypeReference.SetTo(resultType, true);
	}

	if (resultType == NULL)
		return B_NO_MEMORY;

	DwarfSubrangeType* subrangeType = new(std::nothrow) DwarfSubrangeType(
		fTypeContext, fName, NULL, resultType, BVariant(lowerBound),
		BVariant(lowerBound + elementCount - 1));
	if (subrangeType == NULL)
		return B_NO_MEMORY;

	BReference<DwarfSubrangeType> subrangeReference(subrangeType, true);

	DwarfArrayDimension* dimension = new(std::nothrow) DwarfArrayDimension(
		subrangeType);
	if (dimension == NULL)
		return B_NO_MEMORY;
	BReference<DwarfArrayDimension> dimensionReference(dimension, true);

	if (!resultType->AddDimension(dimension))
		return B_NO_MEMORY;

	baseTypeReference.Detach();

	_resultType = resultType;
	return B_OK;
}
예제 #3
0
	void OptionItemSelected(Settings* settings, SettingsOption* option)
	{
		settings->SetValue(fSetting,
			BVariant(option->ID(), B_VARIANT_DONT_COPY_DATA));
	}