Fix 64-bit support.

Bug=55
TRAC #15606
Signed-off-by: Daniel Koch
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@697 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/common/version.h b/src/common/version.h
index 4763332..19f10cf 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -1,7 +1,7 @@
 #define MAJOR_VERSION 0
 #define MINOR_VERSION 0
 #define BUILD_VERSION 0
-#define BUILD_REVISION 696
+#define BUILD_REVISION 697
 
 #define STRINGIFY(x) #x
 #define MACRO_STRINGIFY(x) STRINGIFY(x)
diff --git a/src/libEGL/Surface.cpp b/src/libEGL/Surface.cpp
index eafe5e2..a9546ad 100644
--- a/src/libEGL/Surface.cpp
+++ b/src/libEGL/Surface.cpp
@@ -307,7 +307,7 @@
     }
 
     SetLastError(0);
-    LONG oldWndProc = SetWindowLong(mWindow, GWL_WNDPROC, reinterpret_cast<LONG>(SurfaceWindowProc));
+    LONG_PTR oldWndProc = SetWindowLongPtr(mWindow, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(SurfaceWindowProc));
     if(oldWndProc == 0 && GetLastError() != ERROR_SUCCESS)
     {
         mWindowSubclassed = false;
@@ -327,7 +327,7 @@
     }
 
     // un-subclass
-    LONG parentWndFunc = reinterpret_cast<LONG>(GetProp(mWindow, kParentWndProc));
+    LONG_PTR parentWndFunc = reinterpret_cast<LONG_PTR>(GetProp(mWindow, kParentWndProc));
 
     // Check the windowproc is still SurfaceWindowProc.
     // If this assert fails, then it is likely the application has subclassed the
@@ -336,8 +336,8 @@
     // EGL context, or to unsubclass before destroying the EGL context.
     if(parentWndFunc)
     {
-        LONG prevWndFunc = SetWindowLong(mWindow, GWL_WNDPROC, parentWndFunc);
-        ASSERT(prevWndFunc == reinterpret_cast<LONG>(SurfaceWindowProc));
+        LONG_PTR prevWndFunc = SetWindowLongPtr(mWindow, GWLP_WNDPROC, parentWndFunc);
+        ASSERT(prevWndFunc == reinterpret_cast<LONG_PTR>(SurfaceWindowProc));
     }
 
     RemoveProp(mWindow, kSurfaceProperty);
diff --git a/src/libGLESv2/VertexDataManager.cpp b/src/libGLESv2/VertexDataManager.cpp
index a7716ce..8a7d9f0 100644
--- a/src/libGLESv2/VertexDataManager.cpp
+++ b/src/libGLESv2/VertexDataManager.cpp
@@ -55,14 +55,14 @@
     }
 }
 
-UINT VertexDataManager::writeAttributeData(ArrayVertexBuffer *vertexBuffer, GLint start, GLsizei count, const VertexAttribute &attribute)
+std::size_t VertexDataManager::writeAttributeData(ArrayVertexBuffer *vertexBuffer, GLint start, GLsizei count, const VertexAttribute &attribute)
 {
     Buffer *buffer = attribute.mBoundBuffer.get();
 
     int inputStride = attribute.stride();
     int elementSize = attribute.typeSize();
     const FormatConverter &converter = formatConverter(attribute);
-    UINT streamOffset = 0;
+    std::size_t streamOffset = 0;
 
     void *output = NULL;
     
@@ -189,7 +189,7 @@
                 StaticVertexBuffer *staticBuffer = buffer ? buffer->getStaticVertexBuffer() : NULL;
                 ArrayVertexBuffer *vertexBuffer = staticBuffer ? staticBuffer : static_cast<ArrayVertexBuffer*>(mStreamingBuffer);
 
-                UINT streamOffset = -1;
+                std::size_t streamOffset = -1;
 
                 if (staticBuffer)
                 {
@@ -662,7 +662,7 @@
 {
 }
 
-void *StaticVertexBuffer::map(const VertexAttribute &attribute, std::size_t requiredSpace, UINT *streamOffset)
+void *StaticVertexBuffer::map(const VertexAttribute &attribute, std::size_t requiredSpace, std::size_t *streamOffset)
 {
     void *mapPtr = NULL;
 
diff --git a/src/libGLESv2/VertexDataManager.h b/src/libGLESv2/VertexDataManager.h
index 1bd8351..e2f11f7 100644
--- a/src/libGLESv2/VertexDataManager.h
+++ b/src/libGLESv2/VertexDataManager.h
@@ -35,7 +35,7 @@
 class VertexBuffer
 {
   public:
-    VertexBuffer(IDirect3DDevice9 *device, UINT size, DWORD usageFlags);
+    VertexBuffer(IDirect3DDevice9 *device, std::size_t size, DWORD usageFlags);
     virtual ~VertexBuffer();
 
     void unmap();
@@ -60,28 +60,28 @@
 class ArrayVertexBuffer : public VertexBuffer
 {
   public:
-    ArrayVertexBuffer(IDirect3DDevice9 *device, UINT size, DWORD usageFlags);
+    ArrayVertexBuffer(IDirect3DDevice9 *device, std::size_t size, DWORD usageFlags);
     ~ArrayVertexBuffer();
 
-    UINT size() const { return mBufferSize; }
-    virtual void *map(const VertexAttribute &attribute, UINT requiredSpace, UINT *streamOffset) = 0;
+    std::size_t size() const { return mBufferSize; }
+    virtual void *map(const VertexAttribute &attribute, std::size_t requiredSpace, std::size_t *streamOffset) = 0;
     virtual void reserveRequiredSpace() = 0;
     void addRequiredSpace(UINT requiredSpace);
     void addRequiredSpaceFor(ArrayVertexBuffer *buffer);
 
   protected:
-    UINT mBufferSize;
-    UINT mWritePosition;
-    UINT mRequiredSpace;
+    std::size_t mBufferSize;
+    std::size_t mWritePosition;
+    std::size_t mRequiredSpace;
 };
 
 class StreamingVertexBuffer : public ArrayVertexBuffer
 {
   public:
-    StreamingVertexBuffer(IDirect3DDevice9 *device, UINT initialSize);
+    StreamingVertexBuffer(IDirect3DDevice9 *device, std::size_t initialSize);
     ~StreamingVertexBuffer();
 
-    void *map(const VertexAttribute &attribute, UINT requiredSpace, UINT *streamOffset);
+    void *map(const VertexAttribute &attribute, std::size_t requiredSpace, std::size_t *streamOffset);
     void reserveRequiredSpace();
 };
 
@@ -91,7 +91,7 @@
     explicit StaticVertexBuffer(IDirect3DDevice9 *device);
     ~StaticVertexBuffer();
 
-    void *map(const VertexAttribute &attribute, UINT requiredSpace, UINT *streamOffset);
+    void *map(const VertexAttribute &attribute, std::size_t requiredSpace, std::size_t *streamOffset);
     void reserveRequiredSpace();
 
     UINT lookupAttribute(const VertexAttribute &attribute);   // Returns the offset into the vertex buffer, or -1 if not found
@@ -104,7 +104,7 @@
         bool normalized;
         int attributeOffset;
 
-        UINT streamOffset;
+        std::size_t streamOffset;
     };
 
     std::vector<VertexElement> mCache;
@@ -123,8 +123,8 @@
   private:
     DISALLOW_COPY_AND_ASSIGN(VertexDataManager);
 
-    UINT spaceRequired(const VertexAttribute &attrib, std::size_t count) const;
-    UINT writeAttributeData(ArrayVertexBuffer *vertexBuffer, GLint start, GLsizei count, const VertexAttribute &attribute);
+    std::size_t spaceRequired(const VertexAttribute &attrib, std::size_t count) const;
+    std::size_t writeAttributeData(ArrayVertexBuffer *vertexBuffer, GLint start, GLsizei count, const VertexAttribute &attribute);
 
     Context *const mContext;
     IDirect3DDevice9 *const mDevice;