summaryrefslogtreecommitdiff
path: root/src/jit/jitstd
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2015-03-25 18:14:11 +0100
committerJan Vorlicek <janvorli@microsoft.com>2015-03-26 00:27:51 +0100
commit32c2a3bc5a6b0afe26812b5bf255f43790ef979d (patch)
tree2d591e6a79c082c610e0d4c8c5d10491808fd7c8 /src/jit/jitstd
parent04aed1266c4419667b1348426ce59f843449cfdb (diff)
downloadcoreclr-32c2a3bc5a6b0afe26812b5bf255f43790ef979d.tar.gz
coreclr-32c2a3bc5a6b0afe26812b5bf255f43790ef979d.tar.bz2
coreclr-32c2a3bc5a6b0afe26812b5bf255f43790ef979d.zip
Fix warnings in the jitter code
This change fixes some of the warnings in the jitter code on Linux. With this change combined with an upcoming change in the rest of the codebase, 16 warning disabling options can be removed. The issues in the jitter were: 1) Incorrect typedefs for const_reference and const_pointer (the const was ignored) 2) Member initiazalization order in class constructor didn't correspond to the member order in some classes 3) Objects with vtables were copied via memcpy. While this is intentional, cast of the pointers to void* is required to silence clang warning 4) Comparing values of different enums - there are cases of two enums containing the same values. 5) Casting int to pointer - the cast was legal (forming a handle), adding cast to size_t in between used to fix the warning 6) "static struct" - removed the static keyword 7) Missing return value in methods with _ASSERTE 8) Class name classifier on methods in the .h 9) Specialized template member functions need to be defined out of the class
Diffstat (limited to 'src/jit/jitstd')
-rw-r--r--src/jit/jitstd/allocator.h6
-rw-r--r--src/jit/jitstd/list.h8
-rw-r--r--src/jit/jitstd/vector.h6
3 files changed, 10 insertions, 10 deletions
diff --git a/src/jit/jitstd/allocator.h b/src/jit/jitstd/allocator.h
index 2a6bd85bfd..602bba61b8 100644
--- a/src/jit/jitstd/allocator.h
+++ b/src/jit/jitstd/allocator.h
@@ -38,7 +38,7 @@ public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
- typedef const pointer const_pointer;
+ typedef const void* const_pointer;
typedef void value_type;
template <typename U>
@@ -98,8 +98,8 @@ public:
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef T& reference;
- typedef const pointer const_pointer;
- typedef const reference const_reference;
+ typedef const T* const_pointer;
+ typedef const T& const_reference;
typedef T value_type;
private:
diff --git a/src/jit/jitstd/list.h b/src/jit/jitstd/list.h
index 2c9e5a2f4f..45bec41d9c 100644
--- a/src/jit/jitstd/list.h
+++ b/src/jit/jitstd/list.h
@@ -35,8 +35,8 @@ public:
typedef Allocator allocator_type;
typedef T* pointer;
typedef T& reference;
- typedef const pointer const_pointer;
- typedef const reference const_reference;
+ typedef const T* const_pointer;
+ typedef const T& const_reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
@@ -248,9 +248,9 @@ private:
Node* m_pNext;
Node* m_pPrev;
Node(Node* pPrev, Node* pNext, const T& value)
- : m_pPrev(pPrev)
+ : m_value(value)
, m_pNext(pNext)
- , m_value(value)
+ , m_pPrev(pPrev)
{
}
};
diff --git a/src/jit/jitstd/vector.h b/src/jit/jitstd/vector.h
index dc5d209ae1..1f4ff3e2e8 100644
--- a/src/jit/jitstd/vector.h
+++ b/src/jit/jitstd/vector.h
@@ -35,8 +35,8 @@ public:
typedef Allocator allocator_type;
typedef T* pointer;
typedef T& reference;
- typedef const pointer const_pointer;
- typedef const reference const_reference;
+ typedef const T* const_pointer;
+ typedef const T& const_reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
@@ -398,7 +398,7 @@ typename vector<T, Allocator>::reference
}
template <typename T, typename Allocator>
-typename vector<T, Allocator>::reference
+typename vector<T, Allocator>::const_reference
vector<T, Allocator>::back() const
{
return operator[](m_nSize - 1);