Skip to content

Commit

Permalink
Patch from issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
SeppoPakonen committed Jul 16, 2021
1 parent 93d2ae8 commit f35ea28
Show file tree
Hide file tree
Showing 38 changed files with 89 additions and 84 deletions.
4 changes: 2 additions & 2 deletions src/Fog/FogCharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ FogCharacter::FogCharacter()
FogCharacter::FogCharacter(const PrimId& rawId, const PrimId& binId, unsigned long aValue, CharacterType characterType)
:
_raw_id(rawId),
_bin_id(binId),
_character_type(characterType),
_value(aValue) {}
_value(aValue),
_bin_id(binId) {}

FogCharacter::~FogCharacter() {}

Expand Down
8 changes: 4 additions & 4 deletions src/Fog/FogCodeTokens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ TMPL_HACK_FIX_DO(FogCodeTokens)

FogCodeTokens::FogCodeTokens()
:
_executable_tokens(0),
_source_lines(0)
_source_lines(0),
_executable_tokens(0)
{}


FogCodeTokens::FogCodeTokens(const This& tokenList)
:
Super(tokenList),
_tokens(tokenList._tokens),
_executable_tokens(tokenList._executable_tokens),
_source_lines(tokenList._source_lines)
_source_lines(tokenList._source_lines),
_executable_tokens(tokenList._executable_tokens)
{}

FogCodeTokens::~FogCodeTokens() {}
Expand Down
2 changes: 1 addition & 1 deletion src/Fog/FogEmitContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ FogStaticEmitContext::FogStaticEmitContext(FogStream& s, FogToken& aToken, ForUs
:
_static_token(aToken),
_in_scope(IN_ANY_SCOPE),
_for_use_as(forUseAs),
_s(s),
_for_use_as(forUseAs),
_separator(0),
_terminator(0) {}

Expand Down
4 changes: 2 additions & 2 deletions src/Fog/FogFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ FogFunction *FogFunction::deduce_specialisation(FogMakeSpecifierContext& makeSpe
// Initialise map of parameters to be deduced.
//
FogExprSetOfRef deducedValues;
for (int i1 = firstNumber+1; i1 <= lastNumber; i1++)
for (size_t i1 = firstNumber+1; i1 <= lastNumber; i1++)
{
const FogTemplateParameterSpecifier& tP = templateParameters.template_parameter_number(i1);
const FogName& tPN = tP.name();
Expand Down Expand Up @@ -492,7 +492,7 @@ FogFunction *FogFunction::deduce_specialisation(FogMakeSpecifierContext& makeSpe
if (failedDeductions)
return 0;
FogListOfExprRef exprList(new FogListOfExpr, FogListOfExprRef::ADOPT);
for (int i2 = firstNumber+1; i2 <= lastNumber; i2++)
for (size_t i2 = firstNumber+1; i2 <= lastNumber; i2++)
{
const FogTemplateParameterSpecifier& tP = templateParameters.template_parameter_number(i2);
const FogName& tPN = tP.name();
Expand Down
2 changes: 1 addition & 1 deletion src/Fog/FogInline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool FogInline_Flyweights::initialise()
_flyweights[p->_inline_enum] = flyWeights[p->_inline_enum].pointer();
}
_flyweights[FogInline::EXPLICIT_IF_SHORT] = &FogTokenType::get_inline(FogTokenType::INLINE);
for (int i = 0; i < (sizeof(_flyweights)/sizeof(_flyweights[0])); i++)
for (size_t i = 0; i < (sizeof(_flyweights)/sizeof(_flyweights[0])); i++)
{
if (!_flyweights[i])
{
Expand Down
12 changes: 6 additions & 6 deletions src/Fog/FogIterationDomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ TMPL_HACK_FIX_DO(FogIterationDomain)
FogIterationDomain::FogIterationDomain()
:
_meta_type(FogMetaType::void_type()),
_executable_tokens(0),
_source_lines(0)
_source_lines(0),
_executable_tokens(0)
{}

FogIterationDomain::FogIterationDomain(const FogMetaType& metaType)
:
_meta_type(metaType),
_executable_tokens(0),
_source_lines(0)
_source_lines(0),
_executable_tokens(0)
{}

FogIterationDomain::FogIterationDomain(const This& tokenList)
:
Super(tokenList),
_meta_type(tokenList._meta_type),
_tokens(tokenList._tokens),
_executable_tokens(tokenList._executable_tokens),
_source_lines(tokenList._source_lines)
_source_lines(tokenList._source_lines),
_executable_tokens(tokenList._executable_tokens)
{}

FogIterationDomain::~FogIterationDomain() {}
Expand Down
4 changes: 2 additions & 2 deletions src/Fog/FogLexerInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const char *FogLexerInput::get(FogTokenContext& tokenContext)
}
for ( ; !p->is_empty(); p->pop())
{
const char *stateName = stateName = p->get(tokenContext);
const char *stateName = p->get(tokenContext);
if (stateName)
{
if (tokenContext.token().is_line() && _token.is_null())
Expand Down Expand Up @@ -772,7 +772,7 @@ const char *FogLexerInput_Stream::peek(FogTokenRef& tokenValue, size_t nextIndex
while (nextIndex < _contents.tally()) // If replaying.
{
tokenValue = _contents[nextIndex++];
if (!tokenValue->is_skip(skipWhite));
if (!tokenValue->is_skip(skipWhite))
return "<INPUT_REPEEK>";
}
return _lexer.peek(tokenValue, skipWhite);
Expand Down
2 changes: 1 addition & 1 deletion src/Fog/FogMakeSemantics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ bool FogMakeSemantics::make_specifier(FogBaseMakeSpecifierContext& aContext, Fog
if (scopeSpecifier)
return aContext.adopt_specifier(new FogTypeParameterSpecifier(aContext, *scopeSpecifier));
ERRMSG("BUG -- should have made template-type-parameter from an elaborated-type-specifier");
false;
return false;
}
// case MAKE_USING: return new FogUsingSpecifier(aContext, *aName);
case MAKE_VALUE_PARAMETER:
Expand Down
16 changes: 8 additions & 8 deletions src/Fog/FogMetaVariableSlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,21 @@ FogMetaEntity *FogMetaVariableSlot::get_meta_entity(FogScopeContext& inScope) co
FogMetaEntity *metaEntity = NULL;//found_meta_entities[this];

if (!metaEntity) {
inToken = get_scope_in(inScope);
inToken = get_scope_in(inScope);

VERBOSE(printf("DEBUG inToken %x\n", &inToken);)
VERBOSE(printf("DEBUG inToken %x\n", &inToken);)

if (!inToken)
return 0;
if (!inToken)
return 0;

VERBOSE(printf("DEBUG find entity %s\n", id().str());)
VERBOSE(printf("DEBUG find entity %s\n", id().str());)

metaEntity = inToken->find_meta_entity(id());
metaEntity = inToken->find_meta_entity(id());

VERBOSE(if (metaEntity) {std::strstream str;metaEntity->print_viz(str);printf("DEBUG found %x %s\n", metaEntity, str.str());})
VERBOSE(if (metaEntity) {std::strstream str;metaEntity->print_viz(str);printf("DEBUG found %x %s\n", metaEntity, str.str());})
}
else {
VERBOSE(printf("DEBUG old entity %x\n", metaEntity);)
VERBOSE(printf("DEBUG old entity %x\n", metaEntity);)
}


Expand Down
2 changes: 1 addition & 1 deletion src/Fog/FogMultipleId.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ FogMultipleId::FogMultipleId(const FogElementType& elementType)
FogMultipleId::FogMultipleId(const This& thatName)
:
Super(thatName),
_element_type(thatName._element_type),
_tokens(thatName._tokens),
_element_type(thatName._element_type),
_resolved_id(thatName._resolved_id),
_resolved(thatName._resolved),
_resolved_in(thatName._resolved_in),
Expand Down
4 changes: 2 additions & 2 deletions src/Fog/FogParseContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ FogDeclarationParseContext::FogDeclarationParseContext(FogToken& aToken)

FogDeclarationParseContext::FogDeclarationParseContext(FogToken& aToken, FogScopeContext& _scope_context)
:
_static_token(aToken),
FogParseContext(_scope_context)
FogParseContext(_scope_context),
_static_token(aToken)
// _target_file(0)
{}

Expand Down
2 changes: 1 addition & 1 deletion src/Fog/FogParseContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class FogDecoratedParseContext : public FogParseContext
private:
FogParseContext& _parse_context;
protected:
FogDecoratedParseContext(FogParseContext& parseContext) : _parse_context(parseContext), FogParseContext(parseContext) {}
FogDecoratedParseContext(FogParseContext& parseContext) : FogParseContext(parseContext), _parse_context(parseContext) {}
FogParseContext& parse_context() { return _parse_context; }
public:
virtual const FogAccess& access() const;
Expand Down
2 changes: 1 addition & 1 deletion src/Fog/FogParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7413,7 +7413,7 @@ case 768:
{ yyval.declaration = YACC_DERIVED_CLAUSE(yyvsp[-4].expression, yyvsp[-1].subspace); ;
break;}
case 769:
{ yyval.declaration = yyval.declaration = YACC_DERIVED_CLAUSE(yyvsp[-8].expression, yyvsp[-5].subspace); YACC_UNBANG(yyvsp[-2].bang, "Bad object-statement."); ;
{ yyval.declaration = YACC_DERIVED_CLAUSE(yyvsp[-8].expression, yyvsp[-5].subspace); YACC_UNBANG(yyvsp[-2].bang, "Bad object-statement."); ;
break;}
case 772:
{ yyval.function_body = YACC_CTOR_FUNCTION_BLOCK(0, yyvsp[-1].mem_initializers); ;
Expand Down
2 changes: 1 addition & 1 deletion src/Fog/FogParser.y
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ object_statement: ';'
| derived_clause object_statement { $$ = YACC_DERIVED_CLAUSE($1, $2); }
| derived_clause ':' '{' object_statement_seq.opt '}' { $$ = YACC_DERIVED_CLAUSE($1, $4); }
| derived_clause ':' '{' object_statement_seq.opt looping_object_statement '#' bang error '#'
{ $$ = $$ = YACC_DERIVED_CLAUSE($1, $4); YACC_UNBANG($7, "Bad object-statement."); }
{ $$ = YACC_DERIVED_CLAUSE($1, $4); YACC_UNBANG($7, "Bad object-statement."); }
function_used_block: function_block
| function_try_block
| ctor_initializer ';' { $$ = YACC_CTOR_FUNCTION_BLOCK(0, $1); }
Expand Down
4 changes: 2 additions & 2 deletions src/Fog/FogRoot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ TMPL_HACK_FIX_DO(FogRoot)
FogRoot::FogRoot()
:
Super(FogTag::namespace_tag(), *this, *PrimIdHandle("$null$")),
_reader(*this),
_program("?"),
_reader(*this),
_root_context(*this) {}

FogRoot::FogRoot(const PrimId& anId)
:
Super(FogTag::namespace_tag(), *this, *PrimIdHandle(anId ? anId.str() : "<unnamed>")),
_reader(*this),
_program("?"),
_reader(*this),
_meta_base(new FogAuto(*this), FogScopeRef::ADOPT),
_std(new FogStd(*this), FogScopeRef::ADOPT),
_root_context(*this) {
Expand Down
4 changes: 2 additions & 2 deletions src/Fog/FogScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ FogScope::FogScope(const FogTag& aTag, FogScope& parentScope, const PrimId& anId
:
Super(parentScope, anId, anId),
_nested(&parentScope == this ? 0 : parentScope.nesting_depth()+1), // Avoid recursion for global scope.
_templates(*this),
_tag(aTag),
_braced(false),
_is_leaf(FogLazyBool::make_undecided()),
_is_frozen(false),
_done_meta_construct(false),
_inline_usage(0)
_inline_usage(0),
_templates(*this)
{}

FogScope::~FogScope() {}
Expand Down
4 changes: 2 additions & 2 deletions src/Fog/FogScopeContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ class FogDecoratedScopeContext : public FogScopeContext
private:
This& operator=(const This& scopeContext);
protected:
FogDecoratedScopeContext(FogScopeContext& scopeContext) : _context(scopeContext), Super(scopeContext, 123) {}
FogDecoratedScopeContext(This& scopeContext) : _context(scopeContext), Super(scopeContext, 123) {}
FogDecoratedScopeContext(FogScopeContext& scopeContext) : Super(scopeContext, 123), _context(scopeContext) {}
FogDecoratedScopeContext(This& scopeContext) : Super(scopeContext, 123), _context(scopeContext) {}
public:
FogScopeContext& scope_context() { return _context; }
const FogScopeContext& scope_context() const { return _context; }
Expand Down
8 changes: 4 additions & 4 deletions src/Fog/FogSourceFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ TMPL_HACK_FIX_DO(FogSourceFile)

FogSourceFile::FogSourceFile()
:
_has_been_read(false),
_source_type(FogSourceFileType::invalid())
_source_type(FogSourceFileType::invalid()),
_has_been_read(false)
{}

FogSourceFile::FogSourceFile(const PrimId& pathedId, const PrimId& fileIdent,
const FogSourceFileType& sourceType)
:
_pathed_id(pathedId),
_short_id(fileIdent),
_has_been_read(false),
_source_type(sourceType)
_source_type(sourceType),
_has_been_read(false)
{}

// const FogMetaType *FogSourceFile::meta_type() const { return &FogMetaType::source_file_type(); }
Expand Down
4 changes: 2 additions & 2 deletions src/Fog/FogString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ FogString::FogString()
FogString::FogString(const PrimId& rawId, const PrimId& binId, StringType stringType)
:
_raw_id(rawId),
_bin_id(binId),
_string_type(stringType)
_string_type(stringType),
_bin_id(binId)
{}

FogString::~FogString() {}
Expand Down
2 changes: 1 addition & 1 deletion src/Fog/FogSubstituteParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,7 @@ void FogSubstituteParser::substitute_hash_id(FogKeyword *anId)
const FogTokenListOfRef& theTokens = replacementMacro.tokens();
bool gotWhite = false; // Flag compressing multi-white, stripping trailing white.
bool gotNonWhite = false; // Flag stripping leading white.
for (int i = 0; i < theTokens.tally(); ++i)
for (size_t i = 0; i < theTokens.tally(); ++i)
{
const FogToken& theToken = *theTokens[i];
if (theToken.is_white())
Expand Down
6 changes: 3 additions & 3 deletions src/Fog/FogTargetFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ TMPL_HACK_FIX_DO(FogTargetFile)
FogTargetFile::FogTargetFile()
:
_source_file(0),
_is_input(false),
_explicit_guard(false),
_is_interface(false),
_is_input(false),
_file_number(0),
_min_usage_number(0),
_max_usage_number(0),
Expand All @@ -45,10 +45,10 @@ FogTargetFile::FogTargetFile(const FogSourceFile& sourceFile)
_pathed_id(sourceFile.unique_id()),
_short_id(sourceFile.short_id()),
_source_file(&sourceFile),
_is_input(false),
_utility(FogUtility::pool_utility()),
_explicit_guard(false),
_is_interface(false),
_is_input(false),
_file_number(0),
_min_usage_number(0),
_max_usage_number(0),
Expand All @@ -62,10 +62,10 @@ FogTargetFile::FogTargetFile(const PrimId& pathedId, const PrimId& fileIdent)
_pathed_id(pathedId),
_short_id(fileIdent),
_source_file(0),
_is_input(false),
_utility(FogUtility::pool_utility()),
_explicit_guard(false),
_is_interface(false),
_is_input(false),
_file_number(0),
_min_usage_number(0),
_max_usage_number(0),
Expand Down
8 changes: 4 additions & 4 deletions src/Fog/FogTemplateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ TYPEINFO_SINGLE(FogTemplateManager, Super)

FogTemplateManager::FogTemplateManager(FogEntity& primaryEntity)
:
_classification(NON_TEMPLATE),
_primary(primaryEntity)
_primary(primaryEntity),
_classification(NON_TEMPLATE)
{}

FogTemplateManager::FogTemplateManager(FogEntity& primaryEntity, FogMakerContext& makerContext)
:
_classification(classify_primary(makerContext)),
_primary(primaryEntity),
_classification(classify_primary(makerContext)),
_parameter_specifiers(is_templated() ? makerContext.template_parameters() : 0)
{
// install_parameters(makerContext); -- must be in caller to ensure that parent has become at least a FogScope
Expand All @@ -34,8 +34,8 @@ FogTemplateManager::FogTemplateManager(FogEntity& primaryEntity, FogMakerContext

FogTemplateManager::FogTemplateManager(FogMakeTemplateContext& makeTemplateContext)
:
_classification(classify_secondary(makeTemplateContext)),
_primary(makeTemplateContext.primary()),
_classification(classify_secondary(makeTemplateContext)),
_arguments(makeTemplateContext.template_args()),
_parameter_specifiers(makeTemplateContext.template_parameters())
{
Expand Down
2 changes: 1 addition & 1 deletion src/Fog/FogUsage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ TMPL_HACK_FIX_DO(FogUsage)
FogUsage::FogUsage()
:
// _entity(FogEntity::mutable_null()),
_entity(0),
// _type(NAME),
_type(INVALID),
_entity(0),
_file(0),
_usage_number(0)
{}
Expand Down
2 changes: 1 addition & 1 deletion src/Fog/FogUsageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void FogUsageManager::compile() {
while (true) {
FogUsage *nextUsage = endUsage->pick_cyclic_use_of(*this);
if (nextUsage == endUsage) {
int i = 0;
i = 0;
}

if (!nextUsage) // Only occurs if a bug has left endUsage acyclic
Expand Down
2 changes: 2 additions & 0 deletions src/Prim/Prim.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,14 @@ PRIM_AND_SHARED_MAP(T)

#define PRIM_THAT_AND_LIST(T) PRIM_AND_LIST(T)
#define PRIM_THAT_AND_1LIST(T) PRIM_AND_1LIST(T)
/*
// typedef PrimSinglyLinkedListOfRefToConst<name2(T,That)> name2(T,1ListOfRefToConst); \
// typedef PrimSinglyLinkedListOfRef<name2(T,That)> name2(T,1ListOfRef); \
// typedef PrimSinglyLinkedListOfRefToConstIterator<name2(T,That)> name2(T,1ListOfRefToConstIterator); \
// typedef PrimSinglyLinkedListOfRefIterator<name2(T,That)> name2(T,1ListOfRefIterator); \
// typedef PrimConstSinglyLinkedListOfRefToConstIterator<name2(T,That)> name2(T,Const1ListOfRefToConstIterator); \
// typedef PrimConstSinglyLinkedListOfRefIterator<name2(T,That)> name2(T,1LinkedListOfRefIterator);
*/
#define PRIM_THAT_AND_MAP(T) PRIM_AND_MAP(T)
#define PRIM_THAT_AND_REF(T) PRIM_AND_REF(T)
#define PRIM_THAT_WITH_REF(T) PRIM_WITH_REF(T)
Expand Down
Loading

0 comments on commit f35ea28

Please sign in to comment.