Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto astyle #41

Closed
wants to merge 5 commits into from
Closed

Auto astyle #41

wants to merge 5 commits into from

Conversation

cmonr
Copy link
Owner

@cmonr cmonr commented Dec 14, 2018

Description

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

mbartling and others added 4 commits December 12, 2018 09:46
Safely add null termination char

Dont need extra zero term

Clean up code

Fix pollout?

Use default SIGIO.

Future work:
 - Implement non-blocking read/writes
 - Do proper SIGIO

Move CircularBufferFile into own files.

CircularBufferFile is potentially useful to other methods. This commit
makes the CircularBufferFile importable.

Update deprecated wait call to sleep_for
@cmonr
Copy link
Owner Author

cmonr commented Dec 14, 2018

Astyle quickfix

Feel free to run the following script to correct this PR's astyle issues identified by Travis CI.

git apply -3 <<'PATCH' && git commit -am "Applied suggested astyle fixes" && git push
diff --git a/platform/CircularBufferFile.cpp b/platform/CircularBufferFile.cpp
index 90272609..bb51457e 100644
--- a/platform/CircularBufferFile.cpp
+++ b/platform/CircularBufferFile.cpp
@@ -40,14 +40,14 @@ void CircularBufferFile::api_unlock(void)
     _mutex.unlock();
 }
 
-ssize_t CircularBufferFile::write(const void* buffer, size_t size)
+ssize_t CircularBufferFile::write(const void *buffer, size_t size)
 {
-    const char* b = static_cast<const char*>(buffer);
+    const char *b = static_cast<const char *>(buffer);
     if (size == 0) {
         return 0;
     }
     api_lock();
-    for ( size_t i = 0; i < size; i++) {
+    for (size_t i = 0; i < size; i++) {
         _buffer.push(b[i]);
     }
     api_unlock();
@@ -58,7 +58,7 @@ ssize_t CircularBufferFile::write(const void* buffer, size_t size)
 // Read is a forward iterator stream
 ssize_t CircularBufferFile::read(void *buffer, size_t size)
 {
-    char* b = static_cast<char*>(buffer);
+    char *b = static_cast<char *>(buffer);
     size_t i = 0;
     if (size == 0) {
         return 0;
@@ -75,7 +75,7 @@ ssize_t CircularBufferFile::read(void *buffer, size_t size)
         api_lock();
     }
     i = 0;
-    while(i < size && !_buffer.empty()) {
+    while (i < size && !_buffer.empty()) {
         _buffer.pop(b[i++]);
     }
     api_unlock();
PATCH

@cmonr cmonr force-pushed the auto-astyle branch 2 times, most recently from b26e581 to 10d1adc Compare December 14, 2018 20:45
@cmonr cmonr force-pushed the auto-astyle branch 2 times, most recently from ad8bc86 to c86fecc Compare December 15, 2018 02:55
cmonr pushed a commit that referenced this pull request Feb 28, 2019
…from 778c4db..b8b664b

b8b664b (via Mbed OS) Require dependencies from nanostack mbed_lib.json (#41)
213dbf8 Remove references to yotta (#39)
3344181 minar_hal_timer.cpp: Change license header from ARM to APACHE-2.0

git-subtree-dir: features/nanostack/sal-stack-nanostack-eventloop
git-subtree-split: b8b664b163e0f281187f988d5e0628d9f6cd7add
@cmonr cmonr closed this Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants