Skip to content

Commit

Permalink
[nasa/nos3#176] Attempted updates per cppcheck errors;
Browse files Browse the repository at this point in the history
  • Loading branch information
jlucas9 committed Jun 26, 2024
1 parent 5f6ac72 commit fbc42c0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/os/nos/inc/NOS-time.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int NOS_clock_getres (clockid_t clock_id, struct timespec * res);
int NOS_clock_gettime (clockid_t clock_id, struct timespec * tp);
int NOS_clock_nanosleep (clockid_t clock_id, int flags, const struct timespec * req, struct timespec * rem);
int NOS_clock_settime (clockid_t clock_id, const struct timespec * tp);
int NOS_timer_create (clockid_t clock_id, struct sigevent * evp, timer_t * timerid);
int NOS_timer_create (clockid_t clock_id, const struct sigevent * evp, timer_t * timerid);
int NOS_timer_delete (timer_t timerid) ;
// int NOS_timer_gettime (timer_t timerid, struct itimerspec * value); // unused
int NOS_timer_settime (timer_t timerid, int flags, const struct itimerspec * value, struct itimerspec * ovalue);
Expand Down
2 changes: 1 addition & 1 deletion src/os/nos/src/NOS-time.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ typedef struct NOS_timer_t {
static pthread_mutex_t NOS_timer_table_mutex;
static NOS_timer_t NOS_timer_table[OS_MAX_TIMEBASES];

int NOS_timer_create (clockid_t clock_id, struct sigevent * evp, timer_t * timerid)
int NOS_timer_create (clockid_t clock_id, const struct sigevent * evp, timer_t * timerid)
{
int retval = 0;
int i;
Expand Down
13 changes: 7 additions & 6 deletions src/os/nos/src/os-impl-tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@ int32 OS_Posix_InternalTaskCreate_Impl(pthread_t *pthr, const char *taskname, os

/* Set threadname for debugging */
//OS_printf("pthread_setname_np to %s in OS_TaskCreate\n", taskname);
return_code = pthread_setname_np(*pthr, taskname);
pthread_setname_np(*pthr, taskname);
//return_code = pthread_setname_np(*pthr, taskname);
//if (return_code != 0)
//{
// OS_printf("pthread_setname_np error in OS_TaskCreate: %s\n",strerror(return_code));
Expand Down Expand Up @@ -726,11 +727,11 @@ int32 OS_TaskDelay_Impl(uint32 millisecond)
sleep_end.tv_sec = millisecond / 1000;
sleep_end.tv_nsec = 1000000 * (millisecond % 1000);

if (sleep_end.tv_nsec >= 1000000000)
{
sleep_end.tv_nsec -= 1000000000;
++sleep_end.tv_sec;
}
//if (sleep_end.tv_nsec >= 1000000000)
//{
// sleep_end.tv_nsec -= 1000000000;
// ++sleep_end.tv_sec;
//}

do
{
Expand Down

0 comments on commit fbc42c0

Please sign in to comment.