arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject [1/2] arrow git commit: ARROW-1624: [C++] Fix build on LLVM 4.0, remove some clang warning suppressions
Date Sat, 30 Sep 2017 18:25:13 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 4e0f799e7 -> 84e5e02fb


http://git-wip-us.apache.org/repos/asf/arrow/blob/84e5e02f/cpp/src/plasma/client.h
----------------------------------------------------------------------
diff --git a/cpp/src/plasma/client.h b/cpp/src/plasma/client.h
index 50ec55f..1459424 100644
--- a/cpp/src/plasma/client.h
+++ b/cpp/src/plasma/client.h
@@ -82,15 +82,15 @@ class ARROW_EXPORT PlasmaClient {
   /// Connect to the local plasma store and plasma manager. Return
   /// the resulting connection.
   ///
-  /// @param store_socket_name The name of the UNIX domain socket to use to
+  /// \param store_socket_name The name of the UNIX domain socket to use to
   ///        connect to the Plasma store.
-  /// @param manager_socket_name The name of the UNIX domain socket to use to
+  /// \param manager_socket_name The name of the UNIX domain socket to use to
   ///        connect to the local Plasma manager. If this is "", then this
   ///        function will not connect to a manager.
-  /// @param release_delay Number of released objects that are kept around
+  /// \param release_delay Number of released objects that are kept around
   ///        and not evicted to avoid too many munmaps.
-  /// @param num_retries number of attempts to connect to IPC socket, default 50
-  /// @return The return status.
+  /// \param num_retries number of attempts to connect to IPC socket, default 50
+  /// \return The return status.
   Status Connect(const std::string& store_socket_name,
                  const std::string& manager_socket_name, int release_delay,
                  int num_retries = -1);
@@ -98,17 +98,17 @@ class ARROW_EXPORT PlasmaClient {
   /// Create an object in the Plasma Store. Any metadata for this object must be
   /// be passed in when the object is created.
   ///
-  /// @param object_id The ID to use for the newly created object.
-  /// @param data_size The size in bytes of the space to be allocated for this
+  /// \param object_id The ID to use for the newly created object.
+  /// \param data_size The size in bytes of the space to be allocated for this
   /// object's
   ///        data (this does not include space used for metadata).
-  /// @param metadata The object's metadata. If there is no metadata, this
+  /// \param metadata The object's metadata. If there is no metadata, this
   /// pointer
   ///        should be NULL.
-  /// @param metadata_size The size in bytes of the metadata. If there is no
+  /// \param metadata_size The size in bytes of the metadata. If there is no
   ///        metadata, this should be 0.
-  /// @param data The address of the newly created object will be written here.
-  /// @return The return status.
+  /// \param data The address of the newly created object will be written here.
+  /// \return The return status.
   Status Create(const ObjectID& object_id, int64_t data_size, uint8_t* metadata,
                 int64_t metadata_size, uint8_t** data);
 
@@ -119,14 +119,14 @@ class ARROW_EXPORT PlasmaClient {
   /// but
   /// the caller should not release objects that were not retrieved.
   ///
-  /// @param object_ids The IDs of the objects to get.
-  /// @param num_object_ids The number of object IDs to get.
-  /// @param timeout_ms The amount of time in milliseconds to wait before this
+  /// \param object_ids The IDs of the objects to get.
+  /// \param num_objects The number of object IDs to get.
+  /// \param timeout_ms The amount of time in milliseconds to wait before this
   ///        request times out. If this value is -1, then no timeout is set.
-  /// @param object_buffers An array where the results will be stored. If the
+  /// \param object_buffers An array where the results will be stored. If the
   /// data
   ///        size field is -1, then the object was not retrieved.
-  /// @return The return status.
+  /// \return The return status.
   Status Get(const ObjectID* object_ids, int64_t num_objects, int64_t timeout_ms,
              ObjectBuffer* object_buffers);
 
@@ -136,8 +136,8 @@ class ARROW_EXPORT PlasmaClient {
   /// the address returned by Get is no longer valid. This should be called
   /// once for each call to Get (with the same object ID).
   ///
-  /// @param object_id The ID of the object that is no longer needed.
-  /// @return The return status.
+  /// \param object_id The ID of the object that is no longer needed.
+  /// \return The return status.
   Status Release(const ObjectID& object_id);
 
   /// Check if the object store contains a particular object and the object has
@@ -146,18 +146,18 @@ class ARROW_EXPORT PlasmaClient {
   /// @todo: We may want to indicate if the object has been created but not
   /// sealed.
   ///
-  /// @param object_id The ID of the object whose presence we are checking.
-  /// @param has_object The function will write true at this address if
+  /// \param object_id The ID of the object whose presence we are checking.
+  /// \param has_object The function will write true at this address if
   ///        the object is present and false if it is not present.
-  /// @return The return status.
+  /// \return The return status.
   Status Contains(const ObjectID& object_id, bool* has_object);
 
   /// Seal an object in the object store. The object will be immutable after
   /// this
   /// call.
   ///
-  /// @param object_id The ID of the object to seal.
-  /// @return The return status.
+  /// \param object_id The ID of the object to seal.
+  /// \return The return status.
   Status Seal(const ObjectID& object_id);
 
   /// Delete an object from the object store. This currently assumes that the
@@ -166,52 +166,51 @@ class ARROW_EXPORT PlasmaClient {
   /// @todo We may want to allow the deletion of objects that are not present or
   ///       haven't been sealed.
   ///
-  /// @param object_id The ID of the object to delete.
-  /// @return The return status.
+  /// \param object_id The ID of the object to delete.
+  /// \return The return status.
   Status Delete(const ObjectID& object_id);
 
   /// Delete objects until we have freed up num_bytes bytes or there are no more
   /// released objects that can be deleted.
   ///
-  /// @param num_bytes The number of bytes to try to free up.
-  /// @param num_bytes_evicted Out parameter for total number of bytes of space
+  /// \param num_bytes The number of bytes to try to free up.
+  /// \param num_bytes_evicted Out parameter for total number of bytes of space
   /// retrieved.
-  /// @return The return status.
+  /// \return The return status.
   Status Evict(int64_t num_bytes, int64_t& num_bytes_evicted);
 
   /// Compute the hash of an object in the object store.
   ///
-  /// @param conn The object containing the connection state.
-  /// @param object_id The ID of the object we want to hash.
-  /// @param digest A pointer at which to return the hash digest of the object.
+  /// \param object_id The ID of the object we want to hash.
+  /// \param digest A pointer at which to return the hash digest of the object.
   ///        The pointer must have at least kDigestSize bytes allocated.
-  /// @return The return status.
+  /// \return The return status.
   Status Hash(const ObjectID& object_id, uint8_t* digest);
 
   /// Subscribe to notifications when objects are sealed in the object store.
   /// Whenever an object is sealed, a message will be written to the client
   /// socket that is returned by this method.
   ///
-  /// @param fd Out parameter for the file descriptor the client should use to
+  /// \param fd Out parameter for the file descriptor the client should use to
   /// read notifications
   ///         from the object store about sealed objects.
-  /// @return The return status.
+  /// \return The return status.
   Status Subscribe(int* fd);
 
   /// Receive next object notification for this client if Subscribe has been called.
   ///
-  /// @param fd The file descriptor we are reading the notification from.
-  /// @param object_id Out parameter, the object_id of the object that was sealed.
-  /// @param data_size Out parameter, the data size of the object that was sealed.
-  /// @param metadata_size Out parameter, the metadata size of the object that was sealed.
-  /// @return The return status.
+  /// \param fd The file descriptor we are reading the notification from.
+  /// \param object_id Out parameter, the object_id of the object that was sealed.
+  /// \param data_size Out parameter, the data size of the object that was sealed.
+  /// \param metadata_size Out parameter, the metadata size of the object that was sealed.
+  /// \return The return status.
   Status GetNotification(int fd, ObjectID* object_id, int64_t* data_size,
                          int64_t* metadata_size);
 
   /// Disconnect from the local plasma instance, including the local store and
   /// manager.
   ///
-  /// @return The return status.
+  /// \return The return status.
   Status Disconnect();
 
   /// Attempt to initiate the transfer of some objects from remote Plasma
@@ -236,17 +235,17 @@ class ARROW_EXPORT PlasmaClient {
   /// This method is idempotent in the sense that it is ok to call it multiple
   /// times.
   ///
-  /// @param num_object_ids The number of object IDs fetch is being called on.
-  /// @param object_ids The IDs of the objects that fetch is being called on.
-  /// @return The return status.
+  /// \param num_object_ids The number of object IDs fetch is being called on.
+  /// \param object_ids The IDs of the objects that fetch is being called on.
+  /// \return The return status.
   Status Fetch(int num_object_ids, const ObjectID* object_ids);
 
   /// Wait for (1) a specified number of objects to be available (sealed) in the
   /// local Plasma Store or in a remote Plasma Store, or (2) for a timeout to
   /// expire. This is a blocking call.
   ///
-  /// @param num_object_requests Size of the object_requests array.
-  /// @param object_requests Object event array. Each element contains a request
+  /// \param num_object_requests Size of the object_requests array.
+  /// \param object_requests Object event array. Each element contains a request
   ///        for a particular object_id. The type of request is specified in the
   ///        "type" field.
   ///        - A PLASMA_QUERY_LOCAL request is satisfied when object_id becomes
@@ -260,36 +259,34 @@ class ARROW_EXPORT PlasmaClient {
   ///          available either at the local Plasma Store or on a remote Plasma
   ///          Store. In this case, the functions sets the "status" field to
   ///          ObjectStatus_Local or ObjectStatus_Remote.
-  /// @param num_ready_objects The number of requests in object_requests array
+  /// \param num_ready_objects The number of requests in object_requests array
   /// that
   ///        must be satisfied before the function returns, unless it timeouts.
   ///        The num_ready_objects should be no larger than num_object_requests.
-  /// @param timeout_ms Timeout value in milliseconds. If this timeout expires
+  /// \param timeout_ms Timeout value in milliseconds. If this timeout expires
   ///        before min_num_ready_objects of requests are satisfied, the
   ///        function
   ///        returns.
-  /// @param num_objects_ready Out parameter for number of satisfied requests in
+  /// \param num_objects_ready Out parameter for number of satisfied requests in
   ///        the object_requests list. If the returned number is less than
   ///        min_num_ready_objects this means that timeout expired.
-  /// @return The return status.
+  /// \return The return status.
   Status Wait(int64_t num_object_requests, ObjectRequest* object_requests,
               int num_ready_objects, int64_t timeout_ms, int* num_objects_ready);
 
   /// Transfer local object to a different plasma manager.
   ///
-  /// @param conn The object containing the connection state.
-  /// @param addr IP address of the plasma manager we are transfering to.
-  /// @param port Port of the plasma manager we are transfering to.
-  /// @object_id ObjectID of the object we are transfering.
-  /// @return The return status.
+  /// \param addr IP address of the plasma manager we are transfering to.
+  /// \param port Port of the plasma manager we are transfering to.
+  /// \param object_id ObjectID of the object we are transfering.
+  /// \return The return status.
   Status Transfer(const char* addr, int port, const ObjectID& object_id);
 
   /// Return the status of a given object. This method may query the object
   /// table.
   ///
-  /// @param conn The object containing the connection state.
-  /// @param object_id The ID of the object whose status we query.
-  /// @param object_status Out parameter for object status. Can take the
+  /// \param object_id The ID of the object whose status we query.
+  /// \param object_status Out parameter for object status. Can take the
   ///         following values.
   ///         - PLASMA_CLIENT_LOCAL, if object is stored in the local Plasma
   ///         Store.
@@ -300,13 +297,12 @@ class ARROW_EXPORT PlasmaClient {
   ///           Plasma Store.
   ///         - PLASMA_CLIENT_DOES_NOT_EXIST, if the object doesn’t exist in the
   ///           system.
-  /// @return The return status.
+  /// \return The return status.
   Status Info(const ObjectID& object_id, int* object_status);
 
   /// Get the file descriptor for the socket connection to the plasma manager.
   ///
-  /// @param conn The plasma connection.
-  /// @return The file descriptor for the manager connection. If there is no
+  /// \return The file descriptor for the manager connection. If there is no
   ///         connection to the manager, this is -1.
   int get_manager_fd();
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/84e5e02f/cpp/src/plasma/events.h
----------------------------------------------------------------------
diff --git a/cpp/src/plasma/events.h b/cpp/src/plasma/events.h
index 4291484..419c2eb 100644
--- a/cpp/src/plasma/events.h
+++ b/cpp/src/plasma/events.h
@@ -66,7 +66,6 @@ class EventLoop {
   /// Remove a file event handler from the event loop.
   ///
   /// @param fd The file descriptor of the event handler.
-  /// @return Void.
   void RemoveFileEvent(int fd);
 
   /// Register a handler that will be called after a time slice of
@@ -84,8 +83,6 @@ class EventLoop {
   int RemoveTimer(int64_t timer_id);
 
   /// \brief Run the event loop.
-  ///
-  /// @return Void.
   void Start();
 
   /// \brief Stop the event loop

http://git-wip-us.apache.org/repos/asf/arrow/blob/84e5e02f/cpp/src/plasma/eviction_policy.h
----------------------------------------------------------------------
diff --git a/cpp/src/plasma/eviction_policy.h b/cpp/src/plasma/eviction_policy.h
index dd1c873..de33dab 100644
--- a/cpp/src/plasma/eviction_policy.h
+++ b/cpp/src/plasma/eviction_policy.h
@@ -70,7 +70,6 @@ class EvictionPolicy {
   /// cache.
   ///
   /// @param object_id The object ID of the object that was created.
-  /// @return Void.
   void object_created(const ObjectID& object_id);
 
   /// This method will be called when the Plasma store needs more space, perhaps
@@ -94,7 +93,6 @@ class EvictionPolicy {
   /// @param object_id The ID of the object that is now being used.
   /// @param objects_to_evict The object IDs that were chosen for eviction will
   ///        be stored into this vector.
-  /// @return Void.
   void begin_object_access(const ObjectID& object_id,
                            std::vector<ObjectID>* objects_to_evict);
 
@@ -106,7 +104,6 @@ class EvictionPolicy {
   /// @param object_id The ID of the object that is no longer being used.
   /// @param objects_to_evict The object IDs that were chosen for eviction will
   ///        be stored into this vector.
-  /// @return Void.
   void end_object_access(const ObjectID& object_id,
                          std::vector<ObjectID>* objects_to_evict);
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/84e5e02f/cpp/src/plasma/fling.cc
----------------------------------------------------------------------
diff --git a/cpp/src/plasma/fling.cc b/cpp/src/plasma/fling.cc
index 79da4f4..14db320 100644
--- a/cpp/src/plasma/fling.cc
+++ b/cpp/src/plasma/fling.cc
@@ -64,8 +64,9 @@ int recv_fd(int conn) {
   for (struct cmsghdr* header = CMSG_FIRSTHDR(&msg); header != NULL;
        header = CMSG_NXTHDR(&msg, header))
     if (header->cmsg_level == SOL_SOCKET && header->cmsg_type == SCM_RIGHTS)
{
-      ssize_t count =
-          (header->cmsg_len - (CMSG_DATA(header) - (unsigned char*)header)) / sizeof(int);
+      ssize_t count = (header->cmsg_len -
+                       (CMSG_DATA(header) - reinterpret_cast<unsigned char*>(header)))
/
+                      sizeof(int);
       for (int i = 0; i < count; ++i) {
         int fd = (reinterpret_cast<int*>(CMSG_DATA(header)))[i];
         if (found_fd == -1) {

http://git-wip-us.apache.org/repos/asf/arrow/blob/84e5e02f/cpp/src/plasma/io.cc
----------------------------------------------------------------------
diff --git a/cpp/src/plasma/io.cc b/cpp/src/plasma/io.cc
index 9bb4339..fc0010b 100644
--- a/cpp/src/plasma/io.cc
+++ b/cpp/src/plasma/io.cc
@@ -26,10 +26,6 @@
 
 using arrow::Status;
 
-/* Number of times we try binding to a socket. */
-#define NUM_BIND_ATTEMPTS 5
-#define BIND_TIMEOUT_MS 100
-
 /* Number of times we try connecting to a socket. */
 #define NUM_CONNECT_ATTEMPTS 50
 #define CONNECT_TIMEOUT_MS 100
@@ -134,7 +130,8 @@ int bind_ipc_sock(const std::string& pathname, bool shall_listen)
{
   }
   strncpy(socket_address.sun_path, pathname.c_str(), pathname.size() + 1);
 
-  if (bind(socket_fd, (struct sockaddr*)&socket_address, sizeof(socket_address)) != 0)
{
+  if (bind(socket_fd, reinterpret_cast<struct sockaddr*>(&socket_address),
+           sizeof(socket_address)) != 0) {
     ARROW_LOG(ERROR) << "Bind failed for pathname " << pathname;
     close(socket_fd);
     return -1;
@@ -197,8 +194,8 @@ int connect_ipc_sock(const std::string& pathname) {
   }
   strncpy(socket_address.sun_path, pathname.c_str(), pathname.size() + 1);
 
-  if (connect(socket_fd, (struct sockaddr*)&socket_address, sizeof(socket_address)) !=
-      0) {
+  if (connect(socket_fd, reinterpret_cast<struct sockaddr*>(&socket_address),
+              sizeof(socket_address)) != 0) {
     close(socket_fd);
     return -1;
   }

http://git-wip-us.apache.org/repos/asf/arrow/blob/84e5e02f/cpp/src/plasma/protocol.cc
----------------------------------------------------------------------
diff --git a/cpp/src/plasma/protocol.cc b/cpp/src/plasma/protocol.cc
index 305e3d5..2261b6a 100644
--- a/cpp/src/plasma/protocol.cc
+++ b/cpp/src/plasma/protocol.cc
@@ -79,8 +79,9 @@ Status SendCreateReply(int sock, ObjectID object_id, PlasmaObject* object,
   PlasmaObjectSpec plasma_object(object->handle.store_fd, object->handle.mmap_size,
                                  object->data_offset, object->data_size,
                                  object->metadata_offset, object->metadata_size);
-  auto message = CreatePlasmaCreateReply(fbb, fbb.CreateString(object_id.binary()),
-                                         &plasma_object, (PlasmaError)error_code);
+  auto message =
+      CreatePlasmaCreateReply(fbb, fbb.CreateString(object_id.binary()), &plasma_object,
+                              static_cast<PlasmaError>(error_code));
   return PlasmaSend(sock, MessageType_PlasmaCreateReply, &fbb, message);
 }
 
@@ -123,7 +124,7 @@ Status ReadSealRequest(uint8_t* data, size_t size, ObjectID* object_id,
 Status SendSealReply(int sock, ObjectID object_id, int error) {
   flatbuffers::FlatBufferBuilder fbb;
   auto message = CreatePlasmaSealReply(fbb, fbb.CreateString(object_id.binary()),
-                                       (PlasmaError)error);
+                                       static_cast<PlasmaError>(error));
   return PlasmaSend(sock, MessageType_PlasmaSealReply, &fbb, message);
 }
 
@@ -154,7 +155,7 @@ Status ReadReleaseRequest(uint8_t* data, size_t size, ObjectID* object_id)
{
 Status SendReleaseReply(int sock, ObjectID object_id, int error) {
   flatbuffers::FlatBufferBuilder fbb;
   auto message = CreatePlasmaReleaseReply(fbb, fbb.CreateString(object_id.binary()),
-                                          (PlasmaError)error);
+                                          static_cast<PlasmaError>(error));
   return PlasmaSend(sock, MessageType_PlasmaReleaseReply, &fbb, message);
 }
 
@@ -185,7 +186,7 @@ Status ReadDeleteRequest(uint8_t* data, size_t size, ObjectID* object_id)
{
 Status SendDeleteReply(int sock, ObjectID object_id, int error) {
   flatbuffers::FlatBufferBuilder fbb;
   auto message = CreatePlasmaDeleteReply(fbb, fbb.CreateString(object_id.binary()),
-                                         (PlasmaError)error);
+                                         static_cast<PlasmaError>(error));
   return PlasmaSend(sock, MessageType_PlasmaDeleteReply, &fbb, message);
 }
 
@@ -526,8 +527,8 @@ Status ReadDataReply(uint8_t* data, size_t size, ObjectID* object_id,
   auto message = flatbuffers::GetRoot<PlasmaDataReply>(data);
   DCHECK(verify_flatbuffer(message, data, size));
   *object_id = ObjectID::from_binary(message->object_id()->str());
-  *object_size = (int64_t)message->object_size();
-  *metadata_size = (int64_t)message->metadata_size();
+  *object_size = static_cast<int64_t>(message->object_size());
+  *metadata_size = static_cast<int64_t>(message->metadata_size());
   return Status::OK();
 }
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/84e5e02f/cpp/src/plasma/store.cc
----------------------------------------------------------------------
diff --git a/cpp/src/plasma/store.cc b/cpp/src/plasma/store.cc
index aaa2bad..72d199b 100644
--- a/cpp/src/plasma/store.cc
+++ b/cpp/src/plasma/store.cc
@@ -458,8 +458,7 @@ void PlasmaStore::disconnect_client(int client_fd) {
 /// be
 /// buffered, and this will be called again when the send buffer has room.
 ///
-/// @param client The client to send the notification to.
-/// @return Void.
+/// @param client_fd The client to send the notification to.
 void PlasmaStore::send_notifications(int client_fd) {
   auto it = pending_notifications_.find(client_fd);
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/84e5e02f/cpp/src/plasma/store.h
----------------------------------------------------------------------
diff --git a/cpp/src/plasma/store.h b/cpp/src/plasma/store.h
index 61a3a24..d03d11f 100644
--- a/cpp/src/plasma/store.h
+++ b/cpp/src/plasma/store.h
@@ -77,7 +77,6 @@ class PlasmaStore {
   /// be called on objects that are returned by the eviction policy to evict.
   ///
   /// @param object_ids Object IDs of the objects to be deleted.
-  /// @return Void.
   void delete_objects(const std::vector<ObjectID>& object_ids);
 
   /// Process a get request from a client. This method assumes that we will
@@ -91,7 +90,6 @@ class PlasmaStore {
   /// @param client The client making this request.
   /// @param object_ids Object IDs of the objects to be gotten.
   /// @param timeout_ms The timeout for the get request in milliseconds.
-  /// @return Void.
   void process_get_request(Client* client, const std::vector<ObjectID>& object_ids,
                            int64_t timeout_ms);
 
@@ -101,7 +99,6 @@ class PlasmaStore {
   /// @param digest The digest of the object. This is used to tell if two
   /// objects
   ///        with the same object ID are the same.
-  /// @return Void.
   void seal_object(const ObjectID& object_id, unsigned char digest[]);
 
   /// Check if the plasma store contains an object:
@@ -115,25 +112,21 @@ class PlasmaStore {
   ///
   /// @param object_id The object ID of the object that is being released.
   /// @param client The client making this request.
-  /// @param Void.
   void release_object(const ObjectID& object_id, Client* client);
 
   /// Subscribe a file descriptor to updates about new sealed objects.
   ///
   /// @param client The client making this request.
-  /// @return Void.
   void subscribe_to_updates(Client* client);
 
   /// Connect a new client to the PlasmaStore.
   ///
   /// @param listener_sock The socket that is listening to incoming connections.
-  /// @return Void.
   void connect_client(int listener_sock);
 
   /// Disconnect a client from the PlasmaStore.
   ///
   /// @param client_fd The client file descriptor that is disconnected.
-  /// @return Void.
   void disconnect_client(int client_fd);
 
   void send_notifications(int client_fd);

http://git-wip-us.apache.org/repos/asf/arrow/blob/84e5e02f/cpp/src/plasma/test/serialization_tests.cc
----------------------------------------------------------------------
diff --git a/cpp/src/plasma/test/serialization_tests.cc b/cpp/src/plasma/test/serialization_tests.cc
index c76f5ce..7c9d901 100644
--- a/cpp/src/plasma/test/serialization_tests.cc
+++ b/cpp/src/plasma/test/serialization_tests.cc
@@ -43,7 +43,7 @@ int create_temp_file(void) {
  * Seek to the beginning of a file and read a message from it.
  *
  * @param fd File descriptor of the file.
- * @param message type Message type that we expect in the file.
+ * @param message_type Message type that we expect in the file.
  *
  * @return Pointer to the content of the message. Needs to be freed by the
  * caller.
@@ -226,7 +226,7 @@ TEST(PlasmaSerialization, DeleteReply) {
 
 TEST(PlasmaSerialization, StatusRequest) {
   int fd = create_temp_file();
-  int64_t num_objects = 2;
+  constexpr int64_t num_objects = 2;
   ObjectID object_ids[num_objects];
   object_ids[0] = ObjectID::from_random();
   object_ids[1] = ObjectID::from_random();
@@ -249,10 +249,11 @@ TEST(PlasmaSerialization, StatusReply) {
   ARROW_CHECK_OK(SendStatusReply(fd, object_ids, object_statuses, 2));
   std::vector<uint8_t> data = read_message_from_file(fd, MessageType_PlasmaStatusReply);
   int64_t num_objects = ReadStatusReply_num_objects(data.data(), data.size());
-  ObjectID object_ids_read[num_objects];
-  int object_statuses_read[num_objects];
-  ARROW_CHECK_OK(ReadStatusReply(data.data(), data.size(), object_ids_read,
-                                 object_statuses_read, num_objects));
+
+  std::vector<ObjectID> object_ids_read(num_objects);
+  std::vector<int> object_statuses_read(num_objects);
+  ARROW_CHECK_OK(ReadStatusReply(data.data(), data.size(), object_ids_read.data(),
+                                 object_statuses_read.data(), num_objects));
   ASSERT_EQ(object_ids[0], object_ids_read[0]);
   ASSERT_EQ(object_ids[1], object_ids_read[1]);
   ASSERT_EQ(object_statuses[0], object_statuses_read[0]);

http://git-wip-us.apache.org/repos/asf/arrow/blob/84e5e02f/cpp/src/plasma/thirdparty/ae/ae_epoll.c
----------------------------------------------------------------------
diff --git a/cpp/src/plasma/thirdparty/ae/ae_epoll.c b/cpp/src/plasma/thirdparty/ae/ae_epoll.c
index 410aac7..2f70550 100644
--- a/cpp/src/plasma/thirdparty/ae/ae_epoll.c
+++ b/cpp/src/plasma/thirdparty/ae/ae_epoll.c
@@ -72,7 +72,8 @@ static void aeApiFree(aeEventLoop *eventLoop) {
 
 static int aeApiAddEvent(aeEventLoop *eventLoop, int fd, int mask) {
     aeApiState *state = eventLoop->apidata;
-    struct epoll_event ee = {0}; /* avoid valgrind warning */
+    struct epoll_event ee;
+    memset(&ee, 0, sizeof(struct epoll_event)); // avoid valgrind warning
     /* If the fd was already monitored for some event, we need a MOD
      * operation. Otherwise we need an ADD operation. */
     int op = eventLoop->events[fd].mask == AE_NONE ?
@@ -89,7 +90,8 @@ static int aeApiAddEvent(aeEventLoop *eventLoop, int fd, int mask) {
 
 static void aeApiDelEvent(aeEventLoop *eventLoop, int fd, int delmask) {
     aeApiState *state = eventLoop->apidata;
-    struct epoll_event ee = {0}; /* avoid valgrind warning */
+    struct epoll_event ee;
+    memset(&ee, 0, sizeof(struct epoll_event)); // avoid valgrind warning
     int mask = eventLoop->events[fd].mask & (~delmask);
 
     ee.events = 0;


Mime
View raw message