Merge android-4.3_r3:
Android 4.3 release 3.0

# gpg: Signature made Tuesday 17 September 2013 01:16:25 AM IST using DSA key ID 9AB10E78
# gpg: Can't check signature: public key not found

* tag 'android-4.3_r3':
  Fix Windows build issues for librsloader.
diff --git a/Android.mk b/Android.mk
index 4c02056..3027f63 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,7 +1,9 @@
 
 LOCAL_PATH:=$(call my-dir)
 
-rs_base_CFLAGS := -Werror -Wall -Wno-unused-parameter -Wno-unused-variable
+rs_base_CFLAGS := -Werror -Wall -Wno-unused-parameter -Wno-unused-variable $(call-cc-cpp-option,-Qunused-arguments)
+# For gcc 4.7, C++11 narrowing is a warning...
+rs_base_CFLAGS += -Wno-error
 ifeq ($(TARGET_BUILD_PDK), true)
   rs_base_CFLAGS += -D__RS_PDK__
 endif
diff --git a/cpp/Android.mk b/cpp/Android.mk
index 145f487..de3e615 100644
--- a/cpp/Android.mk
+++ b/cpp/Android.mk
@@ -11,6 +11,7 @@
 endif
 local_cflags_for_rs_cpp += -DRS_VERSION=$(RS_VERSION)
 
+LOCAL_CFLAGS := $(call-cc-cpp-option,-Qunused-arguments)
 LOCAL_CFLAGS += $(local_cflags_for_rs_cpp)
 
 LOCAL_SRC_FILES:= \
diff --git a/cpu_ref/rsCpuIntrinsic3DLUT.cpp b/cpu_ref/rsCpuIntrinsic3DLUT.cpp
index 03f24d8..b8d245c 100644
--- a/cpu_ref/rsCpuIntrinsic3DLUT.cpp
+++ b/cpu_ref/rsCpuIntrinsic3DLUT.cpp
@@ -70,10 +70,10 @@
     const uchar *bp = (const uchar *)cp->mLUT->mHal.drvState.lod[0].mallocPtr;
 
     int4 dims = {
-        cp->mLUT->mHal.drvState.lod[0].dimX - 1,
-        cp->mLUT->mHal.drvState.lod[0].dimY - 1,
-        cp->mLUT->mHal.drvState.lod[0].dimZ - 1,
-        -1
+        static_cast<int>(cp->mLUT->mHal.drvState.lod[0].dimX - 1),
+        static_cast<int>(cp->mLUT->mHal.drvState.lod[0].dimY - 1),
+        static_cast<int>(cp->mLUT->mHal.drvState.lod[0].dimZ - 1),
+        static_cast<int>(-1)
     };
     const float4 m = (float4)(1.f / 255.f) * convert_float4(dims);
     const int4 coordMul = convert_int4(m * (float4)0x8000);
@@ -87,8 +87,8 @@
         int32_t len = (x2 - x1 - 1) >> 1;
         if(len > 0) {
             const short neon_constants[] = {
-                coordMul.x, coordMul.y, coordMul.z, 0,
-                0, 0, 0, 0xffff,
+                static_cast<short>(coordMul.x), static_cast<short>(coordMul.y), static_cast<short>(coordMul.z), static_cast<short>(0),
+                0, 0, 0, static_cast<short>(0xffff),
 
             };
 
diff --git a/cpu_ref/rsCpuIntrinsicInlines.h b/cpu_ref/rsCpuIntrinsicInlines.h
index d6644ca..71aac7d 100644
--- a/cpu_ref/rsCpuIntrinsicInlines.h
+++ b/cpu_ref/rsCpuIntrinsicInlines.h
@@ -63,7 +63,7 @@
 }
 
 static inline int4 convert_int4(float4 i) {
-    int4 f4 = {i.x, i.y, i.z, i.w};
+    int4 f4 = {static_cast<int>(i.x), static_cast<int>(i.y), static_cast<int>(i.z), static_cast<int>(i.w)};
     return f4;
 }
 
@@ -73,12 +73,12 @@
 }
 
 static inline float4 convert_float4(uchar4 i) {
-    float4 f4 = {i.x, i.y, i.z, i.w};
+    float4 f4 = {static_cast<float>(i.x), static_cast<float>(i.y), static_cast<float>(i.z), static_cast<float>(i.w)};
     return f4;
 }
 
 static inline float4 convert_float4(int4 i) {
-    float4 f4 = {i.x, i.y, i.z, i.w};
+    float4 f4 = {static_cast<float>(i.x), static_cast<float>(i.y), static_cast<float>(i.z), static_cast<float>(i.w)};
     return f4;
 }
 
diff --git a/cpu_ref/rsCpuIntrinsicYuvToRGB.cpp b/cpu_ref/rsCpuIntrinsicYuvToRGB.cpp
index 94fce1c..bec9888 100644
--- a/cpu_ref/rsCpuIntrinsicYuvToRGB.cpp
+++ b/cpu_ref/rsCpuIntrinsicYuvToRGB.cpp
@@ -88,7 +88,7 @@
         p.z = 255;
     }
 
-    return (uchar4){p.x, p.y, p.z, p.w};
+    return (uchar4){static_cast<uchar>(p.x), static_cast<uchar>(p.y), static_cast<uchar>(p.z), static_cast<uchar>(p.w)};
 }
 
 
diff --git a/driver/rsdRuntimeStubs.cpp b/driver/rsdRuntimeStubs.cpp
index cb3a5b4..9324f01 100644
--- a/driver/rsdRuntimeStubs.cpp
+++ b/driver/rsdRuntimeStubs.cpp
@@ -1286,7 +1286,9 @@
 }
 
 static void SC_debugF(const char *s, float f) {
-    ALOGD("%s %f, 0x%08x", s, f, *((int *) (&f)));
+    int i;
+    memcpy(&i, &f, sizeof(float));
+    ALOGD("%s %f, 0x%08x", s, f, i);
 }
 static void SC_debugFv2(const char *s, float f1, float f2) {
     ALOGD("%s {%f, %f}", s, f1, f2);
@@ -1307,7 +1309,9 @@
     ALOGD("%s {%f, %f, %f, %f}", s, f.x, f.y, f.z, f.w);
 }
 static void SC_debugD(const char *s, double d) {
-    ALOGD("%s %f, 0x%08llx", s, d, *((long long *) (&d)));
+    long long ll;
+    memcpy(&ll, &d, sizeof(long long));
+    ALOGD("%s %f, 0x%08llx", s, d, ll);
 }
 static void SC_debugFM4v4(const char *s, const float *f) {
     ALOGD("%s {%f, %f, %f, %f", s, f[0], f[4], f[8], f[12]);
diff --git a/rsStream.h b/rsStream.h
index 8a192e6..3d0e8ac 100644
--- a/rsStream.h
+++ b/rsStream.h
@@ -92,7 +92,9 @@
     }
 
     void addF(float v) {
-        uint32_t uintV = *reinterpret_cast<uint32_t*> (&v);
+        uint32_t uintV;
+	memcpy(&uintV, &v, sizeof(uint32_t));
+        //uint32_t uintV = *reinterpret_cast<uint32_t*> (&v);
         addU32(uintV);
     }
     void addI32(int32_t v) {