diff options
author | Dan Albert <danalbert@google.com> | 2014-11-20 11:31:17 -0800 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2014-11-20 11:34:32 -0800 |
commit | 36802bd18b7b4e8c87fa019c7e3068bee330d174 (patch) | |
tree | a5c4847a10d5f77a04b9a621174a774d84cb7c31 /services/camera | |
parent | de14fae779240a99c53d58ef16ce3086321ff897 (diff) | |
download | frameworks_av-36802bd18b7b4e8c87fa019c7e3068bee330d174.zip frameworks_av-36802bd18b7b4e8c87fa019c7e3068bee330d174.tar.gz frameworks_av-36802bd18b7b4e8c87fa019c7e3068bee330d174.tar.bz2 |
C++11 compatibility.
* Fix string literal concatenation to not be interpreted as UD
literals.
* Add constexpr compatibility for non-integral static members.
* Use __typeof__ instead of typeof (should become decltype once this
actually becomes C++11).
* Add an appropriate cast for atomic_uintptr_t, since moving to C++11
means moving from <stdatomic.h> to <atomic>, which has better
typechecking (hooray for not macros!).
Bug: 18466763
Change-Id: I9561dcb2526578687819ff85421ba80d8e1a9694
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/api1/client2/Parameters.h | 6 | ||||
-rw-r--r-- | services/camera/libcameraservice/device1/CameraHardwareInterface.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/services/camera/libcameraservice/api1/client2/Parameters.h b/services/camera/libcameraservice/api1/client2/Parameters.h index 815cc55..e4e9a92 100644 --- a/services/camera/libcameraservice/api1/client2/Parameters.h +++ b/services/camera/libcameraservice/api1/client2/Parameters.h @@ -19,11 +19,13 @@ #include <system/graphics.h> +#include <utils/Compat.h> #include <utils/Errors.h> +#include <utils/KeyedVector.h> #include <utils/Mutex.h> #include <utils/String8.h> #include <utils/Vector.h> -#include <utils/KeyedVector.h> + #include <camera/CameraParameters.h> #include <camera/CameraParameters2.h> #include <camera/CameraMetadata.h> @@ -187,7 +189,7 @@ struct Parameters { static const int MAX_INITIAL_PREVIEW_WIDTH = 1920; static const int MAX_INITIAL_PREVIEW_HEIGHT = 1080; // Aspect ratio tolerance - static const float ASPECT_RATIO_TOLERANCE = 0.001; + static const CONSTEXPR float ASPECT_RATIO_TOLERANCE = 0.001; // Full static camera info, object owned by someone else, such as // Camera2Device. diff --git a/services/camera/libcameraservice/device1/CameraHardwareInterface.h b/services/camera/libcameraservice/device1/CameraHardwareInterface.h index 6386838..1935c2b 100644 --- a/services/camera/libcameraservice/device1/CameraHardwareInterface.h +++ b/services/camera/libcameraservice/device1/CameraHardwareInterface.h @@ -588,7 +588,7 @@ private: #ifndef container_of #define container_of(ptr, type, member) ({ \ - const typeof(((type *) 0)->member) *__mptr = (ptr); \ + const __typeof__(((type *) 0)->member) *__mptr = (ptr); \ (type *) ((char *) __mptr - (char *)(&((type *)0)->member)); }) #endif |