Skip to content

Commit

Permalink
Implement 'expandtabs'
Browse files Browse the repository at this point in the history
Add .vimrc to ensure that expandtabs is always done.

Signed-off-by: John Bowler <[email protected]>
  • Loading branch information
jbowler committed Oct 10, 2023
1 parent cffa3f0 commit 06f5b28
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 30 deletions.
1 change: 1 addition & 0 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set expandtab
2 changes: 1 addition & 1 deletion generator/abstractmetabuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class AbstractMetaBuilder
bool isEnum(const QStringList &qualified_name);

void fixQObjectForScope (TypeDatabase *types,
NamespaceModelItem item);
NamespaceModelItem item);

// QtScript
QSet<QString> qtMetaTypeDeclaredTypeNames() const
Expand Down
16 changes: 8 additions & 8 deletions generator/parser/codemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,16 @@ struct TypeInfo

private:
struct TypeInfo_flags {
uint m_constant: 1;
uint m_constexpr: 1;
uint m_volatile: 1;
uint m_constant: 1;
uint m_constexpr: 1;
uint m_volatile: 1;
uint m_mutable: 1;
uint m_friend: 1;
uint m_auto: 1;
uint m_reference: 1;
uint m_functionPointer: 1;
uint m_indirections: 6;
inline bool equals(TypeInfo_flags other) const {
uint m_reference: 1;
uint m_functionPointer: 1;
uint m_indirections: 6;
inline bool equals(TypeInfo_flags other) const {
/* m_auto and m_friend don't matter here */
return m_constant == other.m_constant
&& m_constexpr == other.m_constexpr
Expand All @@ -196,7 +196,7 @@ struct TypeInfo
&& m_reference == other.m_reference
&& m_functionPointer == other.m_functionPointer
&& m_indirections == other.m_indirections;
}
}
} m_flags {0, 0, 0, 0, 0, 0, 0, 0, 0};

QStringList m_qualifiedName;
Expand Down
2 changes: 1 addition & 1 deletion generator/parser/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct ListNode

template <class Tp>
inline const ListNode<Tp> *snoc(const ListNode<Tp> *list,
const Tp &element, pool *p)
const Tp &element, pool *p)
{
if (!list)
return ListNode<Tp>::create(element, p);
Expand Down
18 changes: 9 additions & 9 deletions generator/parser/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ class Parser
bool parseEnumSpecifier(TypeSpecifierAST *&node);
bool parseEnumerator(EnumeratorAST *&node);
bool parseEqualityExpression(ExpressionAST *&node,
bool templArgs = false);
bool templArgs = false);
bool parseExceptionSpecification(ExceptionSpecificationAST *&node);
bool parseExclusiveOrExpression(ExpressionAST *&node,
bool templArgs = false);
bool templArgs = false);
bool parseExpression(ExpressionAST *&node);
bool parseExpressionOrDeclarationStatement(StatementAST *&node);
bool parseExpressionStatement(StatementAST *&node);
Expand All @@ -113,7 +113,7 @@ class Parser
bool parseFunctionSpecifier(const ListNode<std::size_t> *&node);
bool parseIfStatement(StatementAST *&node);
bool parseInclusiveOrExpression(ExpressionAST *&node,
bool templArgs = false);
bool templArgs = false);
bool parseInitDeclarator(InitDeclaratorAST *&node);
bool parseInitDeclaratorList(const ListNode<InitDeclaratorAST*> *&node);
bool parseInitializer(InitializerAST *&node);
Expand All @@ -122,9 +122,9 @@ class Parser
bool parseLinkageBody(LinkageBodyAST *&node);
bool parseLinkageSpecification(DeclarationAST *&node);
bool parseLogicalAndExpression(ExpressionAST *&node,
bool templArgs = false);
bool templArgs = false);
bool parseLogicalOrExpression(ExpressionAST *&node,
bool templArgs = false);
bool templArgs = false);
bool parseMemInitializer(MemInitializerAST *&node);
bool parseMemInitializerList(const ListNode<MemInitializerAST*> *&node);
bool parseMemberSpecification(DeclarationAST *&node);
Expand All @@ -148,17 +148,17 @@ class Parser
bool parsePtrOperator(PtrOperatorAST *&node);
bool parsePtrToMember(PtrToMemberAST *&node);
bool parseRelationalExpression(ExpressionAST *&node,
bool templArgs = false);
bool templArgs = false);
bool parseShiftExpression(ExpressionAST *&node);
bool parseSimpleTypeSpecifier(TypeSpecifierAST *&node,
bool onlyIntegral = false);
bool onlyIntegral = false);
bool parseStatement(StatementAST *&node);
bool parseStorageClassSpecifier(const ListNode<std::size_t> *&node);
bool parseStringLiteral(StringLiteralAST *&node);
bool parseSwitchStatement(StatementAST *&node);
bool parseTemplateArgument(TemplateArgumentAST *&node);
bool parseTemplateArgumentList(const ListNode<TemplateArgumentAST*> *&node,
bool reportError = true);
bool reportError = true);
bool parseTemplateDeclaration(DeclarationAST *&node);
bool parseTemplateParameter(TemplateParameterAST *&node);
bool parseTemplateParameterList(const ListNode<TemplateParameterAST*> *&node);
Expand All @@ -173,7 +173,7 @@ class Parser
bool parseTypedef(DeclarationAST *&node);
bool parseUnaryExpression(ExpressionAST *&node);
bool parseUnqualifiedName(UnqualifiedNameAST *&node,
bool parseTemplateId = true);
bool parseTemplateId = true);
bool parseUsing(DeclarationAST *&node);
bool parseUsingDirective(DeclarationAST *&node);
bool parseWhileStatement(StatementAST *&node);
Expand Down
16 changes: 8 additions & 8 deletions generator/parser/rxx_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,20 @@ template <class _Tp> class rxx_allocator {
const size_type bytes = __n * sizeof(_Tp);

if (_M_current_block == 0
|| _S_block_size < _M_current_index + bytes)
|| _S_block_size < _M_current_index + bytes)
{
++_M_block_index;
++_M_block_index;

_M_storage = reinterpret_cast<char**>
(::realloc(_M_storage, sizeof(char*) * (1 + _M_block_index)));
_M_storage = reinterpret_cast<char**>
(::realloc(_M_storage, sizeof(char*) * (1 + _M_block_index)));

_M_current_block = _M_storage[_M_block_index] = reinterpret_cast<char*>
(new char[_S_block_size]);
_M_current_block = _M_storage[_M_block_index] = reinterpret_cast<char*>
(new char[_S_block_size]);

#if defined(RXX_ALLOCATOR_INIT_0) // ### make it a policy
::memset(_M_current_block, 0, _S_block_size);
::memset(_M_current_block, 0, _S_block_size);
#endif
_M_current_index = 0;
_M_current_index = 0;
}

pointer p = reinterpret_cast<pointer>
Expand Down
4 changes: 2 additions & 2 deletions generator/parser/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class NameTable
NameSymbol *name = _M_storage.value(key);
if (!name)
{
name = new NameSymbol(str, len);
_M_storage.insert(key, name);
name = new NameSymbol(str, len);
_M_storage.insert(key, name);
}

return name;
Expand Down
2 changes: 1 addition & 1 deletion generator/typesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ class ComplexTypeEntry : public TypeEntry
public:
enum TypeFlag {
ForceAbstract = 0x1,
DeleteInMainThread = 0x2,
DeleteInMainThread = 0x2,
Deprecated = 0x4
};
typedef QFlags<TypeFlag> TypeFlags;
Expand Down

0 comments on commit 06f5b28

Please sign in to comment.