Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: third_party/qcms/google.patch

Issue 11365242: Fix compiler warning in qcms with gcc/arm (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/qcms/README.chromium ('k') | third_party/qcms/src/transform.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/qcms/google.patch
diff --git a/third_party/qcms/google.patch b/third_party/qcms/google.patch
index 1084bfc267ef6c033a06770c0e082251c7f270da..67886c9d1a31fc577dd363c576807552caa75029 100644
--- a/third_party/qcms/google.patch
+++ b/third_party/qcms/google.patch
@@ -313,7 +313,7 @@ index 6a5faf9..fa7f2d1 100644
+ dest[b_out] = otdata_b[output[2]];
}
diff --git a/third_party/qcms/src/transform.c b/third_party/qcms/src/transform.c
-index 9a6562b..1f4e72b 100644
+index 9a6562b..7312ced 100644
--- a/third_party/qcms/src/transform.c
+++ b/third_party/qcms/src/transform.c
@@ -181,11 +181,20 @@ compute_chromatic_adaption(struct CIE_XYZ source_white_point,
@@ -707,7 +707,7 @@ index 9a6562b..1f4e72b 100644
/* don't precache if we do not have the TRC curves */
if (!profile->redTRC || !profile->greenTRC || !profile->blueTRC)
-@@ -1224,14 +1224,14 @@
+@@ -1157,14 +1224,14 @@ qcms_transform* qcms_transform_create(
return NULL;
}
if (precache) {
@@ -724,7 +724,25 @@ index 9a6562b..1f4e72b 100644
/* Microsoft Compiler for x64 doesn't support MMX.
* SSE code uses MMX so that we disable on x64 */
} else
-@@ -1262,7 +1329,17 @@ __attribute__((__force_align_arg_pointer__))
+@@ -1256,13 +1323,34 @@ qcms_transform* qcms_transform_create(
+ return transform;
+ }
+
+-#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
++/* __force_align_arg_pointer__ is an x86-only attribute, and gcc/clang warns on unused
++ * attributes. Don't use this on ARM or AMD64. __has_attribute can detect the presence
++ * of the attribute but is currently only supported by clang */
++#if defined(__has_attribute)
++#define HAS_FORCE_ALIGN_ARG_POINTER __has_attribute(__force_align_arg_pointer__)
++#elif defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) && !defined(__arm__)
++#define HAS_FORCE_ALIGN_ARG_POINTER 1
++#else
++#define HAS_FORCE_ALIGN_ARG_POINTER 0
++#endif
++
++#if HAS_FORCE_ALIGN_ARG_POINTER
+ /* we need this to avoid crashes when gcc assumes the stack is 128bit aligned */
+ __attribute__((__force_align_arg_pointer__))
#endif
void qcms_transform_data(qcms_transform *transform, void *src, void *dest, size_t length)
{
@@ -781,27 +799,3 @@ index e8447e5..f68699d 100644
}
struct matrix build_colorant_matrix(qcms_profile *p)
-diff --git a/third_party/qcms/src/transform.c b/third_party/qcms/src/transform.c
-index 976c498..44ce9b5 100644
---- a/third_party/qcms/src/transform.c
-+++ b/third_party/qcms/src/transform.c
-@@ -1324,8 +1324,18 @@ qcms_transform* qcms_transform_create(
- }
-
- #if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
-+#if !defined(__has_attribute)
-+/* Assume that the compiler supports the provided attribute. */
-+#define __has_attribute(x) 1
-+#endif
-+#if __has_attribute(__force_align_arg_pointer__)
- /* we need this to avoid crashes when gcc assumes the stack is 128bit aligned */
- __attribute__((__force_align_arg_pointer__))
-+#else
-+/* __force_align_arg_pointer__ is an x86-only attribute, and clang warns on used
-+ * attributes. Don't use this on ARM.
-+ */
-+#endif
- #endif
- void qcms_transform_data(qcms_transform *transform, void *src, void *dest, size_t length)
- {
-
« no previous file with comments | « third_party/qcms/README.chromium ('k') | third_party/qcms/src/transform.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698