aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2012-11-18 15:40:08 -0800
committerSteve Kondik <shade@chemlab.org>2012-11-18 15:40:08 -0800
commit41e4a032ef9f599ea597dcdff1797f0ea49bdd97 (patch)
tree902c7654243d6dfd662c157c5d57e1aa2e88696a
parentfb9d57017268c5cbe74145e3a677b473b14e0e36 (diff)
parentdeba48b32d593851724bdce88dd9b754c4722645 (diff)
downloadexternal_libpng-41e4a032ef9f599ea597dcdff1797f0ea49bdd97.zip
external_libpng-41e4a032ef9f599ea597dcdff1797f0ea49bdd97.tar.gz
external_libpng-41e4a032ef9f599ea597dcdff1797f0ea49bdd97.tar.bz2
Merge branch 'jb-mr1-release' of https://android.googlesource.com/platform/external/libpng into mr1-staging
Change-Id: I47ac09bc237a707c0f744e7757c89f0c83744602
-rw-r--r--Android.mk27
-rw-r--r--ThirdPartyProject.prop10
-rw-r--r--png.c38
3 files changed, 15 insertions, 60 deletions
diff --git a/Android.mk b/Android.mk
index e1a5714..dacbabc 100644
--- a/Android.mk
+++ b/Android.mk
@@ -22,7 +22,7 @@ common_SRC_FILES := \
pngwtran.c \
pngwutil.c
-common_CFLAGS := -fvisibility=hidden ## -fomit-frame-pointer
+common_CFLAGS := -std=gnu89 -fvisibility=hidden ## -fomit-frame-pointer
ifeq ($(HOST_OS),windows)
ifeq ($(USE_MINGW),)
@@ -64,9 +64,9 @@ ifeq ($(ARCH_ARM_HAVE_NEON),true)
endif
include $(CLEAR_VARS)
-
+LOCAL_CLANG := true
LOCAL_SRC_FILES := $(common_SRC_FILES)
-LOCAL_CFLAGS += $(common_CFLAGS)
+LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv
LOCAL_C_INCLUDES += $(common_C_INCLUDES) \
external/zlib
LOCAL_SHARED_LIBRARIES := \
@@ -79,18 +79,13 @@ LOCAL_COPY_HEADERS := $(common_COPY_HEADERS)
include $(BUILD_STATIC_LIBRARY)
+# For testing
+# =====================================================
include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(common_SRC_FILES)
-LOCAL_CFLAGS += $(common_CFLAGS)
-LOCAL_C_INCLUDES += $(common_C_INCLUDES) \
- external/zlib
-LOCAL_SHARED_LIBRARIES := \
- libz
-
-LOCAL_MODULE:= libpng
-
-LOCAL_PRELINK_MODULE := false
-
-include $(BUILD_SHARED_LIBRARY)
+LOCAL_C_INCLUDES:= $(common_C_INCLUDES) external/zlib
+LOCAL_SRC_FILES:= $(common_SRC_FILES) pngtest.c
+LOCAL_MODULE := pngtest
+LOCAL_SHARED_LIBRARIES:= libz
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
diff --git a/ThirdPartyProject.prop b/ThirdPartyProject.prop
deleted file mode 100644
index b5e1445..0000000
--- a/ThirdPartyProject.prop
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2010 Google Inc. All Rights Reserved.
-#Fri Jul 16 10:03:09 PDT 2010
-currentVersion=1.4.3
-version=1.2.38
-isNative=true
-feedurl=http\://www.libpng.org/pub/png/libpng.html
-name=libpng
-keywords=libpng
-onDevice=true
-homepage=http\://www.libpng.org/pub/png/libpng.html
diff --git a/png.c b/png.c
index 95ea40a..5fea8b1 100644
--- a/png.c
+++ b/png.c
@@ -15,6 +15,7 @@
#define PNG_NO_EXTERN
#define PNG_NO_PEDANTIC_WARNINGS
#include "png.h"
+#include <stdint.h>
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_2_46 Your_png_h_is_not_version_1_2_46;
@@ -844,44 +845,13 @@ png_convert_size(size_t size)
#ifdef PNG_cHRM_SUPPORTED
#ifdef PNG_CHECK_cHRM_SUPPORTED
-/*
- * Multiply two 32-bit numbers, V1 and V2, using 32-bit
- * arithmetic, to produce a 64 bit result in the HI/LO words.
- *
- * A B
- * x C D
- * ------
- * AD || BD
- * AC || CB || 0
- *
- * where A and B are the high and low 16-bit words of V1,
- * C and D are the 16-bit words of V2, AD is the product of
- * A and D, and X || Y is (X << 16) + Y.
-*/
-
void /* PRIVATE */
png_64bit_product (long v1, long v2, unsigned long *hi_product,
unsigned long *lo_product)
{
- int a, b, c, d;
- long lo, hi, x, y;
-
- a = (v1 >> 16) & 0xffff;
- b = v1 & 0xffff;
- c = (v2 >> 16) & 0xffff;
- d = v2 & 0xffff;
-
- lo = b * d; /* BD */
- x = a * d + c * b; /* AD + CB */
- y = ((lo >> 16) & 0xffff) + x;
-
- lo = (lo & 0xffff) | ((y & 0xffff) << 16);
- hi = (y >> 16) & 0xffff;
-
- hi += a * c; /* AC */
-
- *hi_product = (unsigned long)hi;
- *lo_product = (unsigned long)lo;
+ int64_t x = (int64_t)v1 * (int64_t)v2;
+ *hi_product = (unsigned long) (x >> 32);
+ *lo_product = (unsigned long) x;
}
int /* PRIVATE */