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

Commit

Permalink
Merge pull request #974 from MartinNowak/nothrowIssues
Browse files Browse the repository at this point in the history
fix nothrow issues
  • Loading branch information
9rnsr committed Oct 2, 2014
2 parents 2daddd4 + 9cf21d4 commit b8a107a
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core/cpuid.d
Expand Up @@ -377,7 +377,7 @@ __gshared uint max_cpuid, max_extended_cpuid;
void getcacheinfoCPUID2()
{
// We are only interested in the data caches
void decipherCpuid2(ubyte x) @nogc {
void decipherCpuid2(ubyte x) @nogc nothrow {
if (x==0) return;
// Values from http://www.sandpile.org/ia32/cpuid.htm.
// Includes Itanium and non-Intel CPUs.
Expand Down
2 changes: 2 additions & 0 deletions src/core/sys/windows/dll.d
Expand Up @@ -342,6 +342,8 @@ public:
if( !entry )
return false;

scope (failure) assert(0); // enforce nothrow, Bugzilla 13561

if( !enumProcessThreads(
function (uint id, void* context) nothrow {
dll_aux.LdrpTlsListEntry* entry = cast(dll_aux.LdrpTlsListEntry*) context;
Expand Down
10 changes: 5 additions & 5 deletions src/core/thread.d
Expand Up @@ -1466,7 +1466,7 @@ private:
///////////////////////////////////////////////////////////////////////////


final void pushContext( Context* c )
final void pushContext( Context* c ) nothrow
in
{
assert( !c.within );
Expand All @@ -1478,7 +1478,7 @@ private:
}


final void popContext()
final void popContext() nothrow
in
{
assert( m_curr && m_curr.within );
Expand All @@ -1491,7 +1491,7 @@ private:
}


final Context* topContext()
final Context* topContext() nothrow
in
{
assert( m_curr );
Expand Down Expand Up @@ -3116,7 +3116,7 @@ private void* getStackBottom() nothrow
* Returns:
* The address of the stack top.
*/
extern (C) void* thread_stackTop()
extern (C) void* thread_stackTop() nothrow
in
{
// Not strictly required, but it gives us more flexibility.
Expand All @@ -3138,7 +3138,7 @@ body
* Returns:
* The address of the stack bottom.
*/
extern (C) void* thread_stackBottom()
extern (C) void* thread_stackBottom() nothrow
in
{
assert(Thread.getThis());
Expand Down
2 changes: 2 additions & 0 deletions src/rt/arraybyte.d
Expand Up @@ -27,6 +27,8 @@ version (unittest)
*/
int cpuid;
const int CPUID_MAX = 4;

nothrow:
@property bool mmx() { return cpuid == 1 && core.cpuid.mmx; }
@property bool sse() { return cpuid == 2 && core.cpuid.sse; }
@property bool sse2() { return cpuid == 3 && core.cpuid.sse2; }
Expand Down
2 changes: 2 additions & 0 deletions src/rt/arraydouble.d
Expand Up @@ -26,6 +26,8 @@ version (unittest)
*/
int cpuid;
const int CPUID_MAX = 5;

nothrow:
@property bool mmx() { return cpuid == 1 && core.cpuid.mmx; }
@property bool sse() { return cpuid == 2 && core.cpuid.sse; }
@property bool sse2() { return cpuid == 3 && core.cpuid.sse2; }
Expand Down
2 changes: 2 additions & 0 deletions src/rt/arrayfloat.d
Expand Up @@ -25,6 +25,8 @@ version (unittest)
*/
int cpuid;
const int CPUID_MAX = 5;

nothrow:
@property bool mmx() { return cpuid == 1 && core.cpuid.mmx; }
@property bool sse() { return cpuid == 2 && core.cpuid.sse; }
@property bool sse2() { return cpuid == 3 && core.cpuid.sse2; }
Expand Down
2 changes: 2 additions & 0 deletions src/rt/arrayint.d
Expand Up @@ -26,6 +26,8 @@ version (unittest)
*/
uint cpuid;
enum CPUID_MAX = 14;

nothrow:
@property bool mmx() { return cpuid == 1 && core.cpuid.mmx; }
@property bool sse() { return cpuid == 2 && core.cpuid.sse; }
@property bool sse2() { return cpuid == 3 && core.cpuid.sse2; }
Expand Down
2 changes: 2 additions & 0 deletions src/rt/arrayreal.d
Expand Up @@ -25,6 +25,8 @@ version (unittest)
*/
int cpuid;
const int CPUID_MAX = 1;

nothrow:
@property bool mmx() { return cpuid == 1 && core.cpuid.mmx; }
@property bool sse() { return cpuid == 2 && core.cpuid.sse; }
@property bool sse2() { return cpuid == 3 && core.cpuid.sse2; }
Expand Down
2 changes: 2 additions & 0 deletions src/rt/arrayshort.d
Expand Up @@ -26,6 +26,8 @@ version (unittest)
*/
int cpuid;
const int CPUID_MAX = 4;

nothrow:
@property bool mmx() { return cpuid == 1 && core.cpuid.mmx; }
@property bool sse() { return cpuid == 2 && core.cpuid.sse; }
@property bool sse2() { return cpuid == 3 && core.cpuid.sse2; }
Expand Down

0 comments on commit b8a107a

Please sign in to comment.