Skip to content

Commit

Permalink
Fix C++ build
Browse files Browse the repository at this point in the history
  • Loading branch information
externl committed Dec 10, 2015
1 parent 8e54535 commit 3ff0f0e
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 14 deletions.
6 changes: 3 additions & 3 deletions cpp/src/Freeze/MapI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ Freeze::IteratorHelperI::IteratorHelperI(const MapHelperI& m, bool readOnly,
//
// Need to start a transaction
//
#ifdef ICE_CPP11
#ifdef ICE_CPP11_COMPILER
_tx.reset(new Tx(_map));
#else
_tx = new Tx(_map);
Expand Down Expand Up @@ -939,7 +939,7 @@ Freeze::IteratorHelperI::cleanup()

// this can raise an exception when committing the transaction
// (only for read/write iterators)
#ifdef ICE_CPP11
#ifdef ICE_CPP11_COMPILER
_tx.reset();
#else
_tx = 0;
Expand Down Expand Up @@ -1474,7 +1474,7 @@ Freeze::MapHelperI::clear()
IteratorHelperI::TxPtr tx;
if(txn == 0)
{
#ifdef ICE_CPP11
#ifdef ICE_CPP11_COMPILER
tx.reset(new IteratorHelperI::Tx(*this));
#else
tx = new IteratorHelperI::Tx(*this);
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/Freeze/MapI.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <Freeze/Map.h>
#include <Freeze/ConnectionI.h>
#ifdef ICE_CPP11
#ifdef ICE_CPP11_COMPILER
# include <memory>
#endif

Expand Down Expand Up @@ -68,7 +68,7 @@ class IteratorHelperI : public IteratorHelper
close();

class Tx
#ifndef ICE_CPP11
#ifndef ICE_CPP11_COMPILER
: public IceUtil::SimpleShared
#endif
{
Expand All @@ -90,7 +90,7 @@ class IteratorHelperI : public IteratorHelper
bool _dead;
};

#ifdef ICE_CPP11
#ifdef ICE_CPP11_COMPILER
typedef std::shared_ptr<Tx> TxPtr;
#else
typedef IceUtil::Handle<Tx> TxPtr;
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/FreezeScript/AssignVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ FreezeScript::AssignVisitor::isCompatible(const Slice::TypePtr& dest, const Slic
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
{
return false;
}
Expand Down Expand Up @@ -352,6 +353,7 @@ FreezeScript::AssignVisitor::isCompatible(const Slice::TypePtr& dest, const Slic
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
{
return false;
}
Expand Down Expand Up @@ -380,6 +382,7 @@ FreezeScript::AssignVisitor::isCompatible(const Slice::TypePtr& dest, const Slic
}
case Slice::Builtin::KindObject:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
{
return false;
}
Expand All @@ -399,6 +402,7 @@ FreezeScript::AssignVisitor::isCompatible(const Slice::TypePtr& dest, const Slic
return false;
}
case Slice::Builtin::KindObject:
case Slice::Builtin::KindValue:
{
//
// Allow transformation from Object to class. Validation has to
Expand Down
8 changes: 7 additions & 1 deletion cpp/src/FreezeScript/Data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ FreezeScript::DataFactory::createObject(const Slice::TypePtr& type, bool readOnl
else
{
Slice::BuiltinPtr b = Slice::BuiltinPtr::dynamicCast(type);
if(b && b->kind() == Slice::Builtin::KindObject)
if(b && (b->kind() == Slice::Builtin::KindObject || b->kind() == Slice::Builtin::KindValue))
{
obj = new ObjectRef(this, b, readOnly);
}
Expand Down Expand Up @@ -326,6 +326,7 @@ FreezeScript::DataFactory::createImpl(const Slice::TypePtr& type, bool readOnly)
return new StringData(this, builtin, _errorReporter, readOnly);

case Slice::Builtin::KindObject:
case Slice::Builtin::KindValue:
return new ObjectRef(this, builtin, readOnly);

case Slice::Builtin::KindObjectProxy:
Expand Down Expand Up @@ -652,6 +653,7 @@ FreezeScript::IntegerData::marshal(const Ice::OutputStreamPtr& out) const
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
assert(false);
}
}
Expand Down Expand Up @@ -697,6 +699,7 @@ FreezeScript::IntegerData::unmarshal(const Ice::InputStreamPtr& in)
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
assert(false);
}
}
Expand Down Expand Up @@ -825,6 +828,7 @@ FreezeScript::IntegerData::rangeCheck(Ice::Long value, bool fatal) const
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
assert(false);
}

Expand Down Expand Up @@ -929,6 +933,7 @@ FreezeScript::DoubleData::marshal(const Ice::OutputStreamPtr& out) const
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
assert(false);
}
}
Expand Down Expand Up @@ -960,6 +965,7 @@ FreezeScript::DoubleData::unmarshal(const Ice::InputStreamPtr& in)
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
assert(false);
}
}
Expand Down
11 changes: 6 additions & 5 deletions cpp/src/FreezeScript/DumpDescriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ FreezeScript::IfDescriptor::IfDescriptor(const DescriptorPtr& parent, int line,
const IceXML::Attributes& attributes) :
Descriptor(parent, line, factory, errorReporter),
ExecutableContainerDescriptor(parent, line, factory, errorReporter, attributes, "if")

{
DescriptorErrorContext ctx(_errorReporter, "if", _line);

Expand Down Expand Up @@ -1013,7 +1013,7 @@ FreezeScript::IterateDescriptor::IterateDescriptor(const DescriptorPtr& parent,
const IceXML::Attributes& attributes) :
Descriptor(parent, line, factory, errorReporter),
ExecutableContainerDescriptor(parent, line, factory, errorReporter, attributes, "iterate")

{
DescriptorErrorContext ctx(_errorReporter, "iterate", _line);

Expand Down Expand Up @@ -1156,7 +1156,7 @@ FreezeScript::DumpDescriptor::DumpDescriptor(const DescriptorPtr& parent, int li
const Slice::UnitPtr& unit) :
Descriptor(parent, line, factory, errorReporter),
ExecutableContainerDescriptor(parent, line, factory, errorReporter, attributes, "dump"),
_base(true),
_base(true),
_contents(true)
{
DescriptorErrorContext ctx(_errorReporter, "dump", _line);
Expand Down Expand Up @@ -1238,7 +1238,7 @@ FreezeScript::RecordDescriptor::RecordDescriptor(const DescriptorPtr& parent, in
const IceXML::Attributes& attributes,
const Slice::UnitPtr& unit,
const FreezeScript::ObjectFactoryPtr& objectFactory) :
Descriptor(parent, line, factory, errorReporter),
Descriptor(parent, line, factory, errorReporter),
ExecutableContainerDescriptor(parent, line, factory, errorReporter, attributes, "record"),
_unit(unit),
_objectFactory(objectFactory)
Expand Down Expand Up @@ -1339,7 +1339,7 @@ FreezeScript::DatabaseDescriptor::DatabaseDescriptor(const DescriptorPtr& parent
const ErrorReporterPtr& errorReporter,
const IceXML::Attributes& attributes,
const Slice::UnitPtr& unit) :
Descriptor(parent, line, factory, errorReporter),
Descriptor(parent, line, factory, errorReporter),
ExecutableContainerDescriptor(parent, line, factory, errorReporter, attributes, "database"),
_unit(unit)
{
Expand Down Expand Up @@ -1604,6 +1604,7 @@ FreezeScript::SymbolTableI::getConstantValue(const string& name) const
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
assert(false);
}
}
Expand Down
8 changes: 8 additions & 0 deletions cpp/src/FreezeScript/TransformAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ FreezeScript::AnalyzeTransformVisitor::compareTypes(const string& desc, const Ty
case Builtin::KindObject:
case Builtin::KindObjectProxy:
case Builtin::KindLocalObject:
case Builtin::KindValue:
{
break;
}
Expand Down Expand Up @@ -563,6 +564,7 @@ FreezeScript::AnalyzeTransformVisitor::compareTypes(const string& desc, const Ty
case Builtin::KindObject:
case Builtin::KindObjectProxy:
case Builtin::KindLocalObject:
case Builtin::KindValue:
{
break;
}
Expand Down Expand Up @@ -591,6 +593,7 @@ FreezeScript::AnalyzeTransformVisitor::compareTypes(const string& desc, const Ty
case Builtin::KindObject:
case Builtin::KindObjectProxy:
case Builtin::KindLocalObject:
case Builtin::KindValue:
{
break;
}
Expand Down Expand Up @@ -619,6 +622,7 @@ FreezeScript::AnalyzeTransformVisitor::compareTypes(const string& desc, const Ty
case Builtin::KindObject:
case Builtin::KindObjectProxy:
case Builtin::KindLocalObject:
case Builtin::KindValue:
{
break;
}
Expand Down Expand Up @@ -647,6 +651,7 @@ FreezeScript::AnalyzeTransformVisitor::compareTypes(const string& desc, const Ty
case Builtin::KindObject:
case Builtin::KindObjectProxy:
case Builtin::KindLocalObject:
case Builtin::KindValue:
{
break;
}
Expand Down Expand Up @@ -675,6 +680,7 @@ FreezeScript::AnalyzeTransformVisitor::compareTypes(const string& desc, const Ty
case Builtin::KindObject:
case Builtin::KindObjectProxy:
case Builtin::KindLocalObject:
case Builtin::KindValue:
{
break;
}
Expand All @@ -698,6 +704,7 @@ FreezeScript::AnalyzeTransformVisitor::compareTypes(const string& desc, const Ty
case Builtin::KindDouble:
case Builtin::KindString:
case Builtin::KindObjectProxy:
case Builtin::KindValue:
{
return;
}
Expand All @@ -724,6 +731,7 @@ FreezeScript::AnalyzeTransformVisitor::compareTypes(const string& desc, const Ty
break;
}
case Builtin::KindObject:
case Builtin::KindValue:
{
//
// Allow change from Object to class. Validation has to
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/FreezeScript/TransformVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ FreezeScript::TransformVisitor::isCompatible(const Slice::TypePtr& dest, const S
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
{
return false;
}
Expand Down Expand Up @@ -695,6 +696,7 @@ FreezeScript::TransformVisitor::isCompatible(const Slice::TypePtr& dest, const S
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
{
return false;
}
Expand Down Expand Up @@ -723,6 +725,7 @@ FreezeScript::TransformVisitor::isCompatible(const Slice::TypePtr& dest, const S
}
case Slice::Builtin::KindObject:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
{
return false;
}
Expand All @@ -742,6 +745,7 @@ FreezeScript::TransformVisitor::isCompatible(const Slice::TypePtr& dest, const S
return false;
}
case Slice::Builtin::KindObject:
case Slice::Builtin::KindValue:
{
//
// Allow transformation from Object to class. Validation has to
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/FreezeScript/Transformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2138,7 +2138,7 @@ FreezeScript::DatabaseDescriptor::execute(const SymbolTablePtr& st)
Freeze::Catalog catalog(_info->connection, Freeze::catalogName());
Freeze::CatalogData catalogData;
catalogData.evictor = false;
catalogData.key = _info->newKeyType->typeId();
catalogData.key = _info->newKeyType->typeId();
catalogData.value = _info->newValueType->typeId();
catalog.put(Freeze::Catalog::value_type(_info->newDbName, catalogData));
}
Expand Down Expand Up @@ -2413,6 +2413,7 @@ FreezeScript::SymbolTableI::getConstantValue(const string& name) const
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
case Slice::Builtin::KindValue:
assert(false);
}
}
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/slice2freezej/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ FreezeGenerator::varToObject(const TypePtr& type, const string& param)
case Builtin::KindObject:
case Builtin::KindObjectProxy:
case Builtin::KindLocalObject:
case Builtin::KindValue:
break;
}
}
Expand Down Expand Up @@ -254,6 +255,7 @@ FreezeGenerator::objectToVar(const TypePtr& type, const string& param)
case Builtin::KindObject:
case Builtin::KindObjectProxy:
case Builtin::KindLocalObject:
case Builtin::KindValue:
break;
}
}
Expand Down Expand Up @@ -987,6 +989,7 @@ FreezeGenerator::generate(UnitPtr& u, const Dict& dict)
case Builtin::KindObject:
case Builtin::KindObjectProxy:
case Builtin::KindLocalObject:
case Builtin::KindValue:
{
writeMarshalUnmarshalCode(out, "", type, OptionalNone, false, 0, "__r", false, iter, false, metaData,
patchParams);
Expand Down Expand Up @@ -1136,6 +1139,7 @@ FreezeGenerator::generate(UnitPtr& u, const Dict& dict)
case Builtin::KindObject:
case Builtin::KindObjectProxy:
case Builtin::KindLocalObject:
case Builtin::KindValue:
{
writeMarshalUnmarshalCode(out, "", indexTypes[i], OptionalNone, false, 0, "r", false, iter, false,
metaData, patchParams);
Expand Down
2 changes: 1 addition & 1 deletion slice/Freeze/DB.ice
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sequence<byte> Key;
* A database value, represented as a sequence of bytes.
*
**/
sequence<byte> Value;
sequence<byte> \Value;

};

0 comments on commit 3ff0f0e

Please sign in to comment.