bkietz commented on code in PR #582:
URL: https://github.com/apache/arrow-nanoarrow/pull/582#discussion_r1714236691


##########
src/nanoarrow/ipc/encoder.c:
##########
@@ -78,30 +78,33 @@ void ArrowIpcEncoderReset(struct ArrowIpcEncoder* encoder) {
   memset(encoder, 0, sizeof(struct ArrowIpcEncoder));
 }
 
+static ArrowErrorCode ArrowIpcEncoderWriteContinuationAndSize(struct 
ArrowBuffer* out,
+                                                              size_t size) {
+  _NANOARROW_CHECK_UPPER_LIMIT(size, INT32_MAX);
+  int32_t header[] = {-1, ArrowIpcSystemEndianness() == 
NANOARROW_IPC_ENDIANNESS_BIG
+                              ? (int32_t)bswap32((uint32_t)size)
+                              : (int32_t)size};
+  return ArrowBufferAppend(out, &header, sizeof(header));

Review Comment:
   `header` works because it's an array and arrays are convertible to pointer. 
I prefer `&header` because that would be correct even if `header` were not an 
array



##########
src/nanoarrow/ipc/encoder.c:
##########
@@ -78,30 +78,33 @@ void ArrowIpcEncoderReset(struct ArrowIpcEncoder* encoder) {
   memset(encoder, 0, sizeof(struct ArrowIpcEncoder));
 }
 
+static ArrowErrorCode ArrowIpcEncoderWriteContinuationAndSize(struct 
ArrowBuffer* out,
+                                                              size_t size) {
+  _NANOARROW_CHECK_UPPER_LIMIT(size, INT32_MAX);
+  int32_t header[] = {-1, ArrowIpcSystemEndianness() == 
NANOARROW_IPC_ENDIANNESS_BIG
+                              ? (int32_t)bswap32((uint32_t)size)
+                              : (int32_t)size};

Review Comment:
   okay
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to