Skip to content

Commit

Permalink
remove tabs, any trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Bright committed Mar 31, 2010
1 parent b793f8b commit 3addcfb
Show file tree
Hide file tree
Showing 195 changed files with 107,052 additions and 107,043 deletions.
324 changes: 162 additions & 162 deletions src/access.c

Large diffs are not rendered by default.

132 changes: 66 additions & 66 deletions src/aggregate.h
Expand Up @@ -40,36 +40,36 @@ struct AggregateDeclaration : ScopeDsymbol
Type *type;
StorageClass storage_class;
enum PROT protection;
Type *handle; // 'this' type
unsigned structsize; // size of struct
unsigned alignsize; // size of struct for alignment purposes
unsigned structalign; // struct member alignment in effect
int hasUnions; // set if aggregate has overlapping fields
Array fields; // VarDeclaration fields
unsigned sizeok; // set when structsize contains valid data
// 0: no size
// 1: size is correct
// 2: cannot determine size; fwd referenced
int isdeprecated; // !=0 if deprecated
Type *handle; // 'this' type
unsigned structsize; // size of struct
unsigned alignsize; // size of struct for alignment purposes
unsigned structalign; // struct member alignment in effect
int hasUnions; // set if aggregate has overlapping fields
Array fields; // VarDeclaration fields
unsigned sizeok; // set when structsize contains valid data
// 0: no size
// 1: size is correct
// 2: cannot determine size; fwd referenced
int isdeprecated; // !=0 if deprecated

#if DMDV2
int isnested; // !=0 if is nested
VarDeclaration *vthis; // 'this' parameter if this aggregate is nested
int isnested; // !=0 if is nested
VarDeclaration *vthis; // 'this' parameter if this aggregate is nested
#endif
// Special member functions
InvariantDeclaration *inv; // invariant
NewDeclaration *aggNew; // allocator
DeleteDeclaration *aggDelete; // deallocator
InvariantDeclaration *inv; // invariant
NewDeclaration *aggNew; // allocator
DeleteDeclaration *aggDelete; // deallocator

#if DMDV2
//CtorDeclaration *ctor;
Dsymbol *ctor; // CtorDeclaration or TemplateDeclaration
CtorDeclaration *defaultCtor; // default constructor
Dsymbol *aliasthis; // forward unresolved lookups to aliasthis
Dsymbol *ctor; // CtorDeclaration or TemplateDeclaration
CtorDeclaration *defaultCtor; // default constructor
Dsymbol *aliasthis; // forward unresolved lookups to aliasthis
#endif

FuncDeclarations dtors; // Array of destructors
FuncDeclaration *dtor; // aggregate destructor
FuncDeclarations dtors; // Array of destructors
FuncDeclaration *dtor; // aggregate destructor

#ifdef IN_GCC
Array methods; // flat list of all methods for debug information
Expand All @@ -83,7 +83,7 @@ struct AggregateDeclaration : ScopeDsymbol
static void alignmember(unsigned salign, unsigned size, unsigned *poffset);
Type *getType();
void addField(Scope *sc, VarDeclaration *v);
int isDeprecated(); // is aggregate deprecated?
int isDeprecated(); // is aggregate deprecated?
FuncDeclaration *buildDtor(Scope *sc);
int isNested();

Expand All @@ -92,15 +92,15 @@ struct AggregateDeclaration : ScopeDsymbol
void toDocBuffer(OutBuffer *buf);

// For access checking
virtual PROT getAccess(Dsymbol *smember); // determine access to smember
virtual PROT getAccess(Dsymbol *smember); // determine access to smember
int isFriendOf(AggregateDeclaration *cd);
int hasPrivateAccess(Dsymbol *smember); // does smember have private access to members of this class?
int hasPrivateAccess(Dsymbol *smember); // does smember have private access to members of this class?
void accessCheck(Loc loc, Scope *sc, Dsymbol *smember);

enum PROT prot();

// Back end
Symbol *stag; // tag symbol for debug data
Symbol *stag; // tag symbol for debug data
Symbol *sinit;
Symbol *toInitializer();

Expand All @@ -110,7 +110,7 @@ struct AggregateDeclaration : ScopeDsymbol
struct AnonymousAggregateDeclaration : AggregateDeclaration
{
AnonymousAggregateDeclaration()
: AggregateDeclaration(0, NULL)
: AggregateDeclaration(0, NULL)
{
}

Expand All @@ -119,14 +119,14 @@ struct AnonymousAggregateDeclaration : AggregateDeclaration

struct StructDeclaration : AggregateDeclaration
{
int zeroInit; // !=0 if initialize with 0 fill
int zeroInit; // !=0 if initialize with 0 fill
#if DMDV2
int hasIdentityAssign; // !=0 if has identity opAssign
FuncDeclaration *cpctor; // generated copy-constructor, if any
FuncDeclaration *eq; // bool opEquals(ref const T), if any
int hasIdentityAssign; // !=0 if has identity opAssign
FuncDeclaration *cpctor; // generated copy-constructor, if any
FuncDeclaration *eq; // bool opEquals(ref const T), if any

FuncDeclarations postblits; // Array of postblit functions
FuncDeclaration *postblit; // aggregate postblit
FuncDeclarations postblits; // Array of postblit functions
FuncDeclaration *postblit; // aggregate postblit
#endif

StructDeclaration(Loc loc, Identifier *id);
Expand All @@ -149,11 +149,11 @@ struct StructDeclaration : AggregateDeclaration
#endif
void toDocBuffer(OutBuffer *buf);

PROT getAccess(Dsymbol *smember); // determine access to smember
PROT getAccess(Dsymbol *smember); // determine access to smember

void toObjFile(int multiobj); // compile to .obj file
void toObjFile(int multiobj); // compile to .obj file
void toDt(dt_t **pdt);
void toDebug(); // to symbolic debug info
void toDebug(); // to symbolic debug info

StructDeclaration *isStructDeclaration() { return this; }
};
Expand All @@ -169,17 +169,17 @@ struct UnionDeclaration : StructDeclaration

struct BaseClass
{
Type *type; // (before semantic processing)
enum PROT protection; // protection for the base interface
Type *type; // (before semantic processing)
enum PROT protection; // protection for the base interface

ClassDeclaration *base;
int offset; // 'this' pointer offset
Array vtbl; // for interfaces: Array of FuncDeclaration's
// making up the vtbl[]
int offset; // 'this' pointer offset
Array vtbl; // for interfaces: Array of FuncDeclaration's
// making up the vtbl[]

int baseInterfaces_dim;
BaseClass *baseInterfaces; // if BaseClass is an interface, these
// are a copy of the InterfaceDeclaration::interfaces
BaseClass *baseInterfaces; // if BaseClass is an interface, these
// are a copy of the InterfaceDeclaration::interfaces

BaseClass();
BaseClass(Type *type, enum PROT protection);
Expand All @@ -189,46 +189,46 @@ struct BaseClass
};

#if DMDV2
#define CLASSINFO_SIZE (0x3C+12+4) // value of ClassInfo.size
#define CLASSINFO_SIZE (0x3C+12+4) // value of ClassInfo.size
#else
#define CLASSINFO_SIZE (0x3C+12+4) // value of ClassInfo.size
#define CLASSINFO_SIZE (0x3C+12+4) // value of ClassInfo.size
#endif

struct ClassDeclaration : AggregateDeclaration
{
static ClassDeclaration *object;
static ClassDeclaration *classinfo;

ClassDeclaration *baseClass; // NULL only if this is Object
ClassDeclaration *baseClass; // NULL only if this is Object
#if DMDV1
CtorDeclaration *ctor;
CtorDeclaration *defaultCtor; // default constructor
CtorDeclaration *defaultCtor; // default constructor
#endif
FuncDeclaration *staticCtor;
FuncDeclaration *staticDtor;
Array vtbl; // Array of FuncDeclaration's making up the vtbl[]
Array vtblFinal; // More FuncDeclaration's that aren't in vtbl[]
Array vtbl; // Array of FuncDeclaration's making up the vtbl[]
Array vtblFinal; // More FuncDeclaration's that aren't in vtbl[]

BaseClasses baseclasses; // Array of BaseClass's; first is super,
// rest are Interface's
BaseClasses baseclasses; // Array of BaseClass's; first is super,
// rest are Interface's

int interfaces_dim;
BaseClass **interfaces; // interfaces[interfaces_dim] for this class
// (does not include baseClass)
BaseClass **interfaces; // interfaces[interfaces_dim] for this class
// (does not include baseClass)

BaseClasses *vtblInterfaces; // array of base interfaces that have
// their own vtbl[]
BaseClasses *vtblInterfaces; // array of base interfaces that have
// their own vtbl[]

TypeInfoClassDeclaration *vclassinfo; // the ClassInfo object for this ClassDeclaration
int com; // !=0 if this is a COM class (meaning
// it derives from IUnknown)
int isauto; // !=0 if this is an auto class
int isabstract; // !=0 if abstract class
TypeInfoClassDeclaration *vclassinfo; // the ClassInfo object for this ClassDeclaration
int com; // !=0 if this is a COM class (meaning
// it derives from IUnknown)
int isauto; // !=0 if this is an auto class
int isabstract; // !=0 if abstract class
#if DMDV1
int isnested; // !=0 if is nested
VarDeclaration *vthis; // 'this' parameter if this class is nested
int isnested; // !=0 if is nested
VarDeclaration *vthis; // 'this' parameter if this class is nested
#endif
int inuse; // to prevent recursive attempts
int inuse; // to prevent recursive attempts

ClassDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses);
Dsymbol *syntaxCopy(Dsymbol *s);
Expand Down Expand Up @@ -259,12 +259,12 @@ struct ClassDeclaration : AggregateDeclaration
char *mangle();
void toDocBuffer(OutBuffer *buf);

PROT getAccess(Dsymbol *smember); // determine access to smember
PROT getAccess(Dsymbol *smember); // determine access to smember

void addLocalClass(ClassDeclarations *);

// Back end
void toObjFile(int multiobj); // compile to .obj file
void toObjFile(int multiobj); // compile to .obj file
void toDebug();
unsigned baseVtblOffset(BaseClass *bc);
Symbol *toSymbol();
Expand All @@ -280,7 +280,7 @@ struct ClassDeclaration : AggregateDeclaration
struct InterfaceDeclaration : ClassDeclaration
{
#if DMDV2
int cpp; // !=0 if this is a C++ interface
int cpp; // !=0 if this is a C++ interface
#endif
InterfaceDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses);
Dsymbol *syntaxCopy(Dsymbol *s);
Expand All @@ -294,7 +294,7 @@ struct InterfaceDeclaration : ClassDeclaration
#endif
virtual int isCOMinterface();

void toObjFile(int multiobj); // compile to .obj file
void toObjFile(int multiobj); // compile to .obj file
Symbol *toSymbol();

InterfaceDeclaration *isInterfaceDeclaration() { return this; }
Expand Down
18 changes: 9 additions & 9 deletions src/aliasthis.c
Expand Up @@ -22,7 +22,7 @@


AliasThis::AliasThis(Loc loc, Identifier *ident)
: Dsymbol(NULL) // it's anonymous (no identifier)
: Dsymbol(NULL) // it's anonymous (no identifier)
{
this->loc = loc;
this->ident = ident;
Expand All @@ -41,20 +41,20 @@ void AliasThis::semantic(Scope *sc)
{
Dsymbol *parent = sc->parent;
if (parent)
parent = parent->pastMixin();
parent = parent->pastMixin();
AggregateDeclaration *ad = NULL;
if (parent)
ad = parent->isAggregateDeclaration();
ad = parent->isAggregateDeclaration();
if (ad)
{
if (ad->aliasthis)
error("there can be only one alias this");
assert(ad->members);
Dsymbol *s = ad->search(loc, ident, 0);
ad->aliasthis = s;
if (ad->aliasthis)
error("there can be only one alias this");
assert(ad->members);
Dsymbol *s = ad->search(loc, ident, 0);
ad->aliasthis = s;
}
else
error("alias this can only appear in struct or class declaration, not %s", parent ? parent->toChars() : "nowhere");
error("alias this can only appear in struct or class declaration, not %s", parent ? parent->toChars() : "nowhere");
}

const char *AliasThis::kind()
Expand Down

0 comments on commit 3addcfb

Please sign in to comment.