Skip to content

Commit 8d38036

Browse files
authored
Use stdioERRNO_THREAD_LOCAL_OFFSET macro for ERRNO setter/getter (#82)
Use stdioERRNO_THREAD_LOCAL_OFFSET macro for ERRNO setter/getter Description ----------- The previously used ffconfigCWD_THREAD_LOCAL_INDEX has the same value but the stdioERRNO_THREAD_LOCAL_OFFSET macro is more concise. The compilation will be unchanged as the preprocessor will generate the same output as before. Test Steps ----------- No need to test. This is just for more clarity in the codebase and navigation. Checklist: ---------- <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] I have tested my changes. No regression in existing tests. - [ ] I have modified and/or added unit-tests to cover the code changes in this Pull Request. Related Issue ----------- <!-- If any, please provide issue ID. --> By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent a395e7b commit 8d38036

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/ff_stdio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@
136136
/* Cast from a numeric value to a pointer. */
137137
void * pvValue = ( void * ) ( xErrno );
138138

139-
vTaskSetThreadLocalStoragePointer( NULL, ffconfigCWD_THREAD_LOCAL_INDEX, pvValue );
139+
vTaskSetThreadLocalStoragePointer( NULL, stdioERRNO_THREAD_LOCAL_OFFSET, pvValue );
140140
}
141141

142142
static portINLINE int stdioGET_ERRNO( void )
143143
{
144144
void * pvResult;
145145

146-
pvResult = pvTaskGetThreadLocalStoragePointer( ( TaskHandle_t ) NULL, ffconfigCWD_THREAD_LOCAL_INDEX );
146+
pvResult = pvTaskGetThreadLocalStoragePointer( ( TaskHandle_t ) NULL, stdioERRNO_THREAD_LOCAL_OFFSET );
147147
/* Cast from a pointer to a number of the same size. */
148148
intptr_t xErrno = ( intptr_t ) pvResult;
149149
/* Cast it to an integer. */

0 commit comments

Comments
 (0)