Title: [110913] trunk/Source/_javascript_Core
Revision
110913
Author
[email protected]
Date
2012-03-15 16:58:35 -0700 (Thu, 15 Mar 2012)

Log Message

Make the array pointer parameters in the Typed Array create() methods const.
https://bugs.webkit.org/show_bug.cgi?id=81147

Patch by David Dorwin <[email protected]> on 2012-03-15
Reviewed by Kenneth Russell.

This allows const arrays to be passed to these methods.
They use PassRefPtr<Subclass> create(), which already has a const parameter.

* wtf/Int16Array.h:
(Int16Array):
(WTF::Int16Array::create):
* wtf/Int32Array.h:
(Int32Array):
(WTF::Int32Array::create):
* wtf/Int8Array.h:
(Int8Array):
(WTF::Int8Array::create):
* wtf/Uint16Array.h:
(Uint16Array):
(WTF::Uint16Array::create):
* wtf/Uint32Array.h:
(Uint32Array):
(WTF::Uint32Array::create):
* wtf/Uint8Array.h:
(Uint8Array):
(WTF::Uint8Array::create):
* wtf/Uint8ClampedArray.h:
(Uint8ClampedArray):
(WTF::Uint8ClampedArray::create):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (110912 => 110913)


--- trunk/Source/_javascript_Core/ChangeLog	2012-03-15 23:54:47 UTC (rev 110912)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-03-15 23:58:35 UTC (rev 110913)
@@ -1,3 +1,35 @@
+2012-03-15  David Dorwin  <[email protected]>
+
+        Make the array pointer parameters in the Typed Array create() methods const.
+        https://bugs.webkit.org/show_bug.cgi?id=81147
+
+        Reviewed by Kenneth Russell.
+
+        This allows const arrays to be passed to these methods.
+        They use PassRefPtr<Subclass> create(), which already has a const parameter.
+
+        * wtf/Int16Array.h:
+        (Int16Array):
+        (WTF::Int16Array::create):
+        * wtf/Int32Array.h:
+        (Int32Array):
+        (WTF::Int32Array::create):
+        * wtf/Int8Array.h:
+        (Int8Array):
+        (WTF::Int8Array::create):
+        * wtf/Uint16Array.h:
+        (Uint16Array):
+        (WTF::Uint16Array::create):
+        * wtf/Uint32Array.h:
+        (Uint32Array):
+        (WTF::Uint32Array::create):
+        * wtf/Uint8Array.h:
+        (Uint8Array):
+        (WTF::Uint8Array::create):
+        * wtf/Uint8ClampedArray.h:
+        (Uint8ClampedArray):
+        (WTF::Uint8ClampedArray::create):
+
 2012-03-15  Myles Maxfield  <[email protected]>
 
         CopiedSpace::tryAllocateOversize assumes system page size

Modified: trunk/Source/_javascript_Core/wtf/Int16Array.h (110912 => 110913)


--- trunk/Source/_javascript_Core/wtf/Int16Array.h	2012-03-15 23:54:47 UTC (rev 110912)
+++ trunk/Source/_javascript_Core/wtf/Int16Array.h	2012-03-15 23:58:35 UTC (rev 110913)
@@ -35,7 +35,7 @@
 class Int16Array : public IntegralTypedArrayBase<short> {
 public:
     static inline PassRefPtr<Int16Array> create(unsigned length);
-    static inline PassRefPtr<Int16Array> create(short* array, unsigned length);
+    static inline PassRefPtr<Int16Array> create(const short* array, unsigned length);
     static inline PassRefPtr<Int16Array> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
 
     // Can’t use "using" here due to a bug in the RVCT compiler.
@@ -61,7 +61,7 @@
     return TypedArrayBase<short>::create<Int16Array>(length);
 }
 
-PassRefPtr<Int16Array> Int16Array::create(short* array, unsigned length)
+PassRefPtr<Int16Array> Int16Array::create(const short* array, unsigned length)
 {
     return TypedArrayBase<short>::create<Int16Array>(array, length);
 }

Modified: trunk/Source/_javascript_Core/wtf/Int32Array.h (110912 => 110913)


--- trunk/Source/_javascript_Core/wtf/Int32Array.h	2012-03-15 23:54:47 UTC (rev 110912)
+++ trunk/Source/_javascript_Core/wtf/Int32Array.h	2012-03-15 23:58:35 UTC (rev 110913)
@@ -34,7 +34,7 @@
 class Int32Array : public IntegralTypedArrayBase<int> {
 public:
     static inline PassRefPtr<Int32Array> create(unsigned length);
-    static inline PassRefPtr<Int32Array> create(int* array, unsigned length);
+    static inline PassRefPtr<Int32Array> create(const int* array, unsigned length);
     static inline PassRefPtr<Int32Array> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
 
     // Can’t use "using" here due to a bug in the RVCT compiler.
@@ -60,7 +60,7 @@
     return TypedArrayBase<int>::create<Int32Array>(length);
 }
 
-PassRefPtr<Int32Array> Int32Array::create(int* array, unsigned length)
+PassRefPtr<Int32Array> Int32Array::create(const int* array, unsigned length)
 {
     return TypedArrayBase<int>::create<Int32Array>(array, length);
 }

Modified: trunk/Source/_javascript_Core/wtf/Int8Array.h (110912 => 110913)


--- trunk/Source/_javascript_Core/wtf/Int8Array.h	2012-03-15 23:54:47 UTC (rev 110912)
+++ trunk/Source/_javascript_Core/wtf/Int8Array.h	2012-03-15 23:58:35 UTC (rev 110913)
@@ -36,7 +36,7 @@
 class Int8Array : public IntegralTypedArrayBase<signed char> {
 public:
     static inline PassRefPtr<Int8Array> create(unsigned length);
-    static inline PassRefPtr<Int8Array> create(signed char* array, unsigned length);
+    static inline PassRefPtr<Int8Array> create(const signed char* array, unsigned length);
     static inline PassRefPtr<Int8Array> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
 
     // Can’t use "using" here due to a bug in the RVCT compiler.
@@ -62,7 +62,7 @@
     return TypedArrayBase<signed char>::create<Int8Array>(length);
 }
 
-PassRefPtr<Int8Array> Int8Array::create(signed char* array, unsigned length)
+PassRefPtr<Int8Array> Int8Array::create(const signed char* array, unsigned length)
 {
     return TypedArrayBase<signed char>::create<Int8Array>(array, length);
 }

Modified: trunk/Source/_javascript_Core/wtf/Uint16Array.h (110912 => 110913)


--- trunk/Source/_javascript_Core/wtf/Uint16Array.h	2012-03-15 23:54:47 UTC (rev 110912)
+++ trunk/Source/_javascript_Core/wtf/Uint16Array.h	2012-03-15 23:58:35 UTC (rev 110913)
@@ -36,7 +36,7 @@
 class Uint16Array : public IntegralTypedArrayBase<unsigned short> {
 public:
     static inline PassRefPtr<Uint16Array> create(unsigned length);
-    static inline PassRefPtr<Uint16Array> create(unsigned short* array, unsigned length);
+    static inline PassRefPtr<Uint16Array> create(const unsigned short* array, unsigned length);
     static inline PassRefPtr<Uint16Array> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
 
     // Can’t use "using" here due to a bug in the RVCT compiler.
@@ -62,7 +62,7 @@
     return TypedArrayBase<unsigned short>::create<Uint16Array>(length);
 }
 
-PassRefPtr<Uint16Array> Uint16Array::create(unsigned short* array, unsigned length)
+PassRefPtr<Uint16Array> Uint16Array::create(const unsigned short* array, unsigned length)
 {
     return TypedArrayBase<unsigned short>::create<Uint16Array>(array, length);
 }

Modified: trunk/Source/_javascript_Core/wtf/Uint32Array.h (110912 => 110913)


--- trunk/Source/_javascript_Core/wtf/Uint32Array.h	2012-03-15 23:54:47 UTC (rev 110912)
+++ trunk/Source/_javascript_Core/wtf/Uint32Array.h	2012-03-15 23:58:35 UTC (rev 110913)
@@ -36,7 +36,7 @@
 class Uint32Array : public IntegralTypedArrayBase<unsigned int> {
 public:
     static inline PassRefPtr<Uint32Array> create(unsigned length);
-    static inline PassRefPtr<Uint32Array> create(unsigned int* array, unsigned length);
+    static inline PassRefPtr<Uint32Array> create(const unsigned int* array, unsigned length);
     static inline PassRefPtr<Uint32Array> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
 
     // Can’t use "using" here due to a bug in the RVCT compiler.
@@ -62,7 +62,7 @@
     return TypedArrayBase<unsigned int>::create<Uint32Array>(length);
 }
 
-PassRefPtr<Uint32Array> Uint32Array::create(unsigned int* array, unsigned length)
+PassRefPtr<Uint32Array> Uint32Array::create(const unsigned int* array, unsigned length)
 {
     return TypedArrayBase<unsigned int>::create<Uint32Array>(array, length);
 }

Modified: trunk/Source/_javascript_Core/wtf/Uint8Array.h (110912 => 110913)


--- trunk/Source/_javascript_Core/wtf/Uint8Array.h	2012-03-15 23:54:47 UTC (rev 110912)
+++ trunk/Source/_javascript_Core/wtf/Uint8Array.h	2012-03-15 23:58:35 UTC (rev 110913)
@@ -36,7 +36,7 @@
 class Uint8Array : public IntegralTypedArrayBase<unsigned char> {
 public:
     static inline PassRefPtr<Uint8Array> create(unsigned length);
-    static inline PassRefPtr<Uint8Array> create(unsigned char* array, unsigned length);
+    static inline PassRefPtr<Uint8Array> create(const unsigned char* array, unsigned length);
     static inline PassRefPtr<Uint8Array> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
 
     // Can’t use "using" here due to a bug in the RVCT compiler.
@@ -62,7 +62,7 @@
     return TypedArrayBase<unsigned char>::create<Uint8Array>(length);
 }
 
-PassRefPtr<Uint8Array> Uint8Array::create(unsigned char* array, unsigned length)
+PassRefPtr<Uint8Array> Uint8Array::create(const unsigned char* array, unsigned length)
 {
     return TypedArrayBase<unsigned char>::create<Uint8Array>(array, length);
 }

Modified: trunk/Source/_javascript_Core/wtf/Uint8ClampedArray.h (110912 => 110913)


--- trunk/Source/_javascript_Core/wtf/Uint8ClampedArray.h	2012-03-15 23:54:47 UTC (rev 110912)
+++ trunk/Source/_javascript_Core/wtf/Uint8ClampedArray.h	2012-03-15 23:58:35 UTC (rev 110913)
@@ -35,7 +35,7 @@
 class Uint8ClampedArray : public Uint8Array {
 public:
     static inline PassRefPtr<Uint8ClampedArray> create(unsigned length);
-    static inline PassRefPtr<Uint8ClampedArray> create(unsigned char* array, unsigned length);
+    static inline PassRefPtr<Uint8ClampedArray> create(const unsigned char* array, unsigned length);
     static inline PassRefPtr<Uint8ClampedArray> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
 
     // Can’t use "using" here due to a bug in the RVCT compiler.
@@ -61,7 +61,7 @@
     return TypedArrayBase<unsigned char>::create<Uint8ClampedArray>(length);
 }
 
-PassRefPtr<Uint8ClampedArray> Uint8ClampedArray::create(unsigned char* array, unsigned length)
+PassRefPtr<Uint8ClampedArray> Uint8ClampedArray::create(const unsigned char* array, unsigned length)
 {
     return TypedArrayBase<unsigned char>::create<Uint8ClampedArray>(array, length);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to