Skip to content

Commit

Permalink
Fix windows compile issue and revert invalid Zephyr stack index init
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Masselink <patrick.masselink@zettascale.tech>
  • Loading branch information
PatrickM-ZS committed Mar 23, 2023
1 parent 24c8e9f commit f706b9f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/core/ddsi/src/ddsi_plist.c
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ static dds_return_t valid_generic (const void *src, size_t srcoff, const enum dd
case XSTOP: return 0;
case XO: SIMPLE (XO, ddsi_octetseq_t, (x->length == 0) == (x->value == NULL)); break;
case XS: SIMPLE (XS, const char *, *x != NULL); break;
case XE1: case XE2: case XE3: SIMPLE (*desc, enum xe3_prototype, *x <= 1 + (uint32_t) *desc - XE1); break;
case XE1: case XE2: case XE3: SIMPLE (*desc, enum xe3_prototype, *x <= (int32_t) (1 + (uint32_t) *desc - XE1)); break;
case Xs: TRIVIAL (Xs, int16_t); break;
case Xi: case Xix2: case Xix3: case Xix4: TRIVIAL (Xi, int32_t); break;
case Xu: case Xux2: case Xux3: case Xux4: case Xux5: TRIVIAL (Xu, uint32_t); break;
Expand Down
4 changes: 0 additions & 4 deletions src/ddsrt/src/cdtors.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ extern void ddsrt_winsock_init(void);
extern void ddsrt_winsock_fini(void);
extern void ddsrt_time_init(void);
extern void ddsrt_time_fini(void);
#elif __ZEPHYR__
extern void ddsrt_thread_stack_init(void);
#endif

#define INIT_STATUS_OK 0x80000000u
Expand All @@ -45,8 +43,6 @@ void ddsrt_init (void)
#if _WIN32
ddsrt_winsock_init();
ddsrt_time_init();
#elif __ZEPHYR__
ddsrt_thread_stack_init();
#endif
ddsrt_random_init();
ddsrt_atomics_init();
Expand Down
7 changes: 1 addition & 6 deletions src/ddsrt/src/threads/posix/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,9 @@ static void *os_startRoutineWrapper (void *threadContext)
#error "CONFIG_MAX_PTHREAD_COUNT is insufficient to run CycloneDDS"
#endif

static int currThrIdx;
static int currThrIdx = 0;
K_THREAD_STACK_ARRAY_DEFINE(zephyr_stacks, CYCLONEDDS_THREAD_COUNT, CYCLONEDDS_THREAD_STACK_SIZE);

void
ddsrt_thread_stack_init (void)
{
currThrIdx = 0;
}
#endif

dds_return_t
Expand Down

0 comments on commit f706b9f

Please sign in to comment.