OSDN Git Service

fifo: index is now a class instead of a struct
authorGlenn Kasten <gkasten@google.com>
Fri, 2 Dec 2016 23:04:39 +0000 (15:04 -0800)
committerGlenn Kasten <gkasten@google.com>
Fri, 2 Dec 2016 23:21:15 +0000 (15:21 -0800)
And confirm that it is POD with static_assert.

Test: builds OK
Change-Id: I9a703c38e9c67e406a1ac6a699a1ffd851efcb8a

audio_utils/include/audio_utils/fifo_index.h

index 55eb0b4..b8834d0 100644 (file)
@@ -27,7 +27,7 @@
  * If in shared memory, exactly one process must explicitly call the constructor via placement new.
  * \see #audio_utils_fifo_sync
  */
-struct audio_utils_fifo_index {
+class audio_utils_fifo_index {
 
 public:
     audio_utils_fifo_index() : mIndex(0) { }
@@ -46,4 +46,7 @@ private:
     static_assert(sizeof(mIndex) == sizeof(uint32_t), "mIndex must be 32 bits");
 };
 
+static_assert(sizeof(audio_utils_fifo_index) == sizeof(uint32_t),
+        "audio_utils_fifo_index must be 32 bits");
+
 #endif  // !ANDROID_AUDIO_FIFO_INDEX_H