use modern construct 'nullptr' instead of 'NULL' or '0'
[platform/core/uifw/dali-core.git] / dali / internal / common / message-buffer.h
index 8e1a17a..c8cb1bc 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_MESSAGE_BUFFER_H__
-#define __DALI_INTERNAL_MESSAGE_BUFFER_H__
+#ifndef DALI_INTERNAL_MESSAGE_BUFFER_H
+#define DALI_INTERNAL_MESSAGE_BUFFER_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,8 @@
  */
 
 // EXTERNAL INCLUDES
-#include <cstddef>
+#include <cstddef> // size_t
+#include <cstdint> // uint32_t
 
 namespace Dali
 {
@@ -33,7 +34,7 @@ namespace Internal
 class MessageBuffer
 {
 public:
-  typedef std::ptrdiff_t WordType;
+  using WordType = std::ptrdiff_t;
 
   /**
    * Create a new MessageBuffer
@@ -53,7 +54,7 @@ public:
    * @param[in] size The message size with respect to the size of type "char".
    * @return A pointer to the address allocated for the message, aligned to a word boundary
    */
-  unsigned int* ReserveMessageSlot( std::size_t size );
+  uint32_t* ReserveMessageSlot( std::size_t size );
 
   /**
    * Query the capacity of the message buffer.
@@ -81,7 +82,7 @@ public:
     // Inlined for performance
     WordType* Get()
     {
-      return ( 0 != mMessageSize ) ? mCurrent : NULL;
+      return ( 0 != mMessageSize ) ? mCurrent : nullptr;
     }
 
     // Inlined for performance
@@ -149,4 +150,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_MESSAGE_BUFFER_H__
+#endif // DALI_INTERNAL_MESSAGE_BUFFER_H