Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
fix Issue 13148 - ModuleInfo fields are unnecessary changed to const
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Jul 17, 2014
1 parent e3074a4 commit 090cf82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/object.di
Expand Up @@ -277,10 +277,10 @@ class MemberInfo_function : MemberInfo

struct ModuleInfo
{
const:
uint _flags;
uint _index;

const:
@property uint index() nothrow pure;
@property uint flags() nothrow pure;
@property void function() tlsctor() nothrow pure;
Expand Down
15 changes: 11 additions & 4 deletions src/object_.d
Expand Up @@ -1589,10 +1589,10 @@ enum

struct ModuleInfo
{
const:
uint _flags;
uint _index; // index into _moduleinfo_array[]

const:
private void* addrOf(int flag) nothrow pure
in
{
Expand Down Expand Up @@ -1725,15 +1725,22 @@ const:
// return null;
}

alias int delegate(immutable(ModuleInfo*)) ApplyDg;

static int opApply(scope ApplyDg dg)
static int opApply(scope int delegate(immutable(ModuleInfo*)) dg)
{
import rt.minfo;
return rt.minfo.moduleinfos_apply(dg);
}
}

unittest
{
ModuleInfo mi;
foreach (m; ModuleInfo)
{
mi = *m;
break;
}
}

///////////////////////////////////////////////////////////////////////////////
// Monitor
Expand Down

0 comments on commit 090cf82

Please sign in to comment.