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

Side by Side Diff: third_party/qcms/src/transform.c

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/qcms/google.patch ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* vim: set ts=8 sw=8 noexpandtab: */ 1 /* vim: set ts=8 sw=8 noexpandtab: */
2 // qcms 2 // qcms
3 // Copyright (C) 2009 Mozilla Corporation 3 // Copyright (C) 2009 Mozilla Corporation
4 // Copyright (C) 1998-2007 Marti Maria 4 // Copyright (C) 1998-2007 Marti Maria
5 // 5 //
6 // Permission is hereby granted, free of charge, to any person obtaining 6 // Permission is hereby granted, free of charge, to any person obtaining
7 // a copy of this software and associated documentation files (the "Software"), 7 // a copy of this software and associated documentation files (the "Software"),
8 // to deal in the Software without restriction, including without limitation 8 // to deal in the Software without restriction, including without limitation
9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 // and/or sell copies of the Software, and to permit persons to whom the Softwar e 10 // and/or sell copies of the Software, and to permit persons to whom the Softwar e
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 } 1316 }
1317 } 1317 }
1318 } else { 1318 } else {
1319 assert(0 && "unexpected colorspace"); 1319 assert(0 && "unexpected colorspace");
1320 transform_free(transform); 1320 transform_free(transform);
1321 return NULL; 1321 return NULL;
1322 } 1322 }
1323 return transform; 1323 return transform;
1324 } 1324 }
1325 1325
1326 #if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) 1326 /* __force_align_arg_pointer__ is an x86-only attribute, and gcc/clang warns on unused
1327 #if !defined(__has_attribute) 1327 * attributes. Don't use this on ARM or AMD64. __has_attribute can detect the pr esence
1328 /* Assume that the compiler supports the provided attribute. */ 1328 * of the attribute but is currently only supported by clang */
1329 #define __has_attribute(x) 1 1329 #if defined(__has_attribute)
1330 #define HAS_FORCE_ALIGN_ARG_POINTER __has_attribute(__force_align_arg_pointer__)
1331 #elif defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) && !defin ed(__arm__)
1332 #define HAS_FORCE_ALIGN_ARG_POINTER 1
1333 #else
1334 #define HAS_FORCE_ALIGN_ARG_POINTER 0
1330 #endif 1335 #endif
1331 #if __has_attribute(__force_align_arg_pointer__) 1336
1337 #if HAS_FORCE_ALIGN_ARG_POINTER
1332 /* we need this to avoid crashes when gcc assumes the stack is 128bit aligned */ 1338 /* we need this to avoid crashes when gcc assumes the stack is 128bit aligned */
1333 __attribute__((__force_align_arg_pointer__)) 1339 __attribute__((__force_align_arg_pointer__))
1334 #else
1335 /* __force_align_arg_pointer__ is an x86-only attribute, and clang warns on used
1336 * attributes. Don't use this on ARM.
1337 */
1338 #endif
1339 #endif 1340 #endif
1340 void qcms_transform_data(qcms_transform *transform, void *src, void *dest, size_ t length) 1341 void qcms_transform_data(qcms_transform *transform, void *src, void *dest, size_ t length)
1341 { 1342 {
1342 static const struct _qcms_format_type output_rgbx = { 0, 2 }; 1343 static const struct _qcms_format_type output_rgbx = { 0, 2 };
1343 1344
1344 transform->transform_fn(transform, src, dest, length, output_rgbx); 1345 transform->transform_fn(transform, src, dest, length, output_rgbx);
1345 } 1346 }
1346 1347
1347 void qcms_transform_data_type(qcms_transform *transform, void *src, void *dest, size_t length, qcms_output_type type) 1348 void qcms_transform_data_type(qcms_transform *transform, void *src, void *dest, size_t length, qcms_output_type type)
1348 { 1349 {
1349 static const struct _qcms_format_type output_rgbx = { 0, 2 }; 1350 static const struct _qcms_format_type output_rgbx = { 0, 2 };
1350 static const struct _qcms_format_type output_bgrx = { 2, 0 }; 1351 static const struct _qcms_format_type output_bgrx = { 2, 0 };
1351 1352
1352 transform->transform_fn(transform, src, dest, length, type == QCMS_OUTPU T_BGRX ? output_bgrx : output_rgbx); 1353 transform->transform_fn(transform, src, dest, length, type == QCMS_OUTPU T_BGRX ? output_bgrx : output_rgbx);
1353 } 1354 }
1354 1355
1355 qcms_bool qcms_supports_iccv4; 1356 qcms_bool qcms_supports_iccv4;
1356 void qcms_enable_iccv4() 1357 void qcms_enable_iccv4()
1357 { 1358 {
1358 qcms_supports_iccv4 = true; 1359 qcms_supports_iccv4 = true;
1359 } 1360 }
OLDNEW
« no previous file with comments | « third_party/qcms/google.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698