Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

The attachment writer interface should take a const void* instead of void* #24

Closed
lrvega opened this issue Jun 8, 2017 · 2 comments
Closed
Assignees
Milestone

Comments

@lrvega
Copy link

lrvega commented Jun 8, 2017

diff -uNr a/ACL/test/Transport/Common/TestableAttachmentWriter.cpp b/ACL/test/Transport/Common/TestableAttachmentWriter.cpp
--- a/ACL/test/Transport/Common/TestableAttachmentWriter.cpp	2017-05-26 19:19:00.000000000 -0400
+++ b/ACL/test/Transport/Common/TestableAttachmentWriter.cpp	2017-06-07 13:53:42.403607000 -0400
@@ -29,7 +29,7 @@
         InProcessAttachmentWriter{dummySDS}, m_writer{std::move(writer)}, m_hasWriteBeenInvoked{false} {
 }
 
-std::size_t TestableAttachmentWriter::write(void* buf, std::size_t numBytes, WriteStatus* writeStatus) {
+std::size_t TestableAttachmentWriter::write(const void* buf, std::size_t numBytes, WriteStatus* writeStatus) {
 
     bool simulatePause = false;
 
@@ -55,4 +55,4 @@
 }
 
 } // namespace acl
-} // namespace alexaClientSDK
\ No newline at end of file
+} // namespace alexaClientSDK
diff -uNr a/ACL/test/Transport/Common/TestableAttachmentWriter.h b/ACL/test/Transport/Common/TestableAttachmentWriter.h
--- a/ACL/test/Transport/Common/TestableAttachmentWriter.h	2017-05-26 19:19:00.000000000 -0400
+++ b/ACL/test/Transport/Common/TestableAttachmentWriter.h	2017-06-07 13:53:22.383608000 -0400
@@ -40,7 +40,7 @@
     TestableAttachmentWriter(std::shared_ptr<avsCommon::utils::sds::InProcessSDS> dummySDS,
                              std::unique_ptr<avsCommon::avs::attachment::AttachmentWriter> writer);
 
-    std::size_t write(void* buf, std::size_t numBytes, WriteStatus* writeStatus) override;
+    std::size_t write(const void* buf, std::size_t numBytes, WriteStatus* writeStatus) override;
 
     void close() override;
 
@@ -54,4 +54,4 @@
 } // namespace acl
 } // namespace alexaClientSDK
 
-#endif // ALEXA_CLIENT_SDK_ACL_TEST_TRANSPORT_TESTABLE_ATTACHMENT_WRITER_H_
\ No newline at end of file
+#endif // ALEXA_CLIENT_SDK_ACL_TEST_TRANSPORT_TESTABLE_ATTACHMENT_WRITER_H_
diff -uNr a/AVSCommon/AVS/include/AVSCommon/AVS/Attachment/AttachmentWriter.h b/AVSCommon/AVS/include/AVSCommon/AVS/Attachment/AttachmentWriter.h
--- a/AVSCommon/AVS/include/AVSCommon/AVS/Attachment/AttachmentWriter.h	2017-05-26 19:19:00.000000000 -0400
+++ b/AVSCommon/AVS/include/AVSCommon/AVS/Attachment/AttachmentWriter.h	2017-06-07 13:42:36.439616000 -0400
@@ -59,7 +59,7 @@
      * @param[out] writeStatus The out-parameter where the resulting state of the write will be expressed.
      * @return The number of bytes written as a result of this call.
      */
-    virtual std::size_t write(void* buf, std::size_t numBytes, WriteStatus* writeStatus) = 0;
+    virtual std::size_t write(const void* buf, std::size_t numBytes, WriteStatus* writeStatus) = 0;
 
     /**
      * The close function.  An implementation will take care of any resource management when a writer no longer
diff -uNr a/AVSCommon/AVS/include/AVSCommon/AVS/Attachment/InProcessAttachmentWriter.h b/AVSCommon/AVS/include/AVSCommon/AVS/Attachment/InProcessAttachmentWriter.h
--- a/AVSCommon/AVS/include/AVSCommon/AVS/Attachment/InProcessAttachmentWriter.h	2017-05-26 19:19:00.000000000 -0400
+++ b/AVSCommon/AVS/include/AVSCommon/AVS/Attachment/InProcessAttachmentWriter.h	2017-06-07 13:42:36.439616000 -0400
@@ -52,7 +52,7 @@
      */
     ~InProcessAttachmentWriter();
 
-    std::size_t write(void* buf, std::size_t numBytes, WriteStatus* writeStatus) override;
+    std::size_t write(const void* buf, std::size_t numBytes, WriteStatus* writeStatus) override;
 
     void close() override;
 
diff -uNr a/AVSCommon/AVS/src/Attachment/InProcessAttachmentWriter.cpp b/AVSCommon/AVS/src/Attachment/InProcessAttachmentWriter.cpp
--- a/AVSCommon/AVS/src/Attachment/InProcessAttachmentWriter.cpp	2017-05-26 19:19:00.000000000 -0400
+++ b/AVSCommon/AVS/src/Attachment/InProcessAttachmentWriter.cpp	2017-06-07 13:42:36.439616000 -0400
@@ -62,7 +62,7 @@
     close();
 }
 
-std::size_t InProcessAttachmentWriter::write(void* buff, std::size_t numBytes, WriteStatus* writeStatus) {
+std::size_t InProcessAttachmentWriter::write(const void* buff, std::size_t numBytes, WriteStatus* writeStatus) {
     if (!writeStatus) {
         ACSDK_ERROR(LX("writeFailed").d("reason", "writeStatus is nullptr"));
         return 0;
@scotthea-amazon
Copy link
Contributor

Hi lrvega,
Thank you very much for catching this! We will work it in to an upcoming release.
-SWH

@scotthea-amazon scotthea-amazon self-assigned this Jun 8, 2017
kjkh pushed a commit that referenced this issue Jun 9, 2017
Changes in this update
-Implemented Sensory wake word detector functionality
-Removed the need for a std::recursive_mutex in MessageRouter
-Added AIP unit test
-Added handleDirectiveImmediately functionality to SpeechSynthesizer
-Added memory profiles for:
AIP
SpeechSynthesizer
ContextManager
AVSUtils
AVSCommon
-Bug fix for MultipartParser.h compiler warning
-Suppression of sensitive log data even in debug builds. Use cmake parameter -DACSDK_EMIT_SENSITIVE_LOGS=ON to allow logging of sensitive information in DEBUG builds
-Fix crash in ACL when attempting to use more than 10 streams
-Updated MediaPlayer to use autoaudiosink instead of requiring pulseaudio
-Updated MediaPlayer build to suppport local builds of GStreamer
-Fixes for the following Github issues:
#5
#8
#9
#10
#17
#24
@scotthea-amazon
Copy link
Contributor

A fix for this has been pushed in version 0.4.1.

@JamieMeyers JamieMeyers added this to the 0.4.1 milestone Jun 13, 2017
@xuqifu xuqifu mentioned this issue Jul 12, 2018
6 tasks
Guillaume0477 pushed a commit to Guillaume0477/avs-device-sdk that referenced this issue Sep 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants