Skip to content

Commit

Permalink
<SONARCLOUD> Local integration and Test complete
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjalchanda08 authored and akashkollipara committed Jan 13, 2022
1 parent 0cd2b3e commit 91ea17e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.scannerwork
sonar-cfamily-reproducer.zip
temp
out/
toolchain/
Expand Down
11 changes: 11 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sonar.login=a15620523b79247d23371f05082ab54e16fbb805
sonar.organization=cyancore
sonar.projectKey=VisorFolks_cyancore
sonar.sources=src
sonar.cfamily.build-wrapper-output=toolchain/bw-output
sonar.verbose=false
sonar.host.url=https://sonarcloud.io
sonar.verbose=true
sonar.cfamily.threads=8
sonar.cfamily.cache.enabled=true
sonar.cfamily.cache.path=toolchain/bw-output/cfamily_cache
2 changes: 1 addition & 1 deletion src/lib/libc/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int vprintf(const char *fmt, va_list args)
break;
case 'c':
str = va_arg(args, char *);
ret += console_putc((int)str);
ret += console_putc((int)str[0]);
break;
case 's':
str = va_arg(args, char *);
Expand Down
19 changes: 0 additions & 19 deletions src/lib/libposix/include/posix/errno.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,6 @@

#include <status.h>

/* Undefine all errnos to avoid redefinition errors with system errnos. */
#undef EPERM
#undef ENOENT
#undef EBADF
#undef EAGAIN
#undef ENOMEM
#undef EEXIST
#undef EBUSY
#undef EINVAL
#undef ENOSPC
#undef ERANGE
#undef ENAMETOOLONG
#undef EDEADLK
#undef EOVERFLOW
#undef ENOSYS
#undef EMSGSIZE
#undef ENOTSUP
#undef ETIMEDOUT

/**
* @name Definition of POSIX errnos.
*/
Expand Down
46 changes: 31 additions & 15 deletions src/lib/libposix/src/posix_semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
********************/
static int s_sem_wait( sem_t * sem )
{
sret_t sem_sys_ret;
ASSERT_IF_FALSE(sem == NULL, int);
sret_t sem_sys_ret=
{
.status = SUCCESS
};
ASSERT_IF_FALSE(sem != NULL, int);

super_call(scall_id_sem_wait, (unsigned int) *sem, RST_VAL, RST_VAL, &sem_sys_ret);
super_call(scall_id_sem_wait, (uintptr_t) *sem, RST_VAL, RST_VAL, &sem_sys_ret);

return sem_sys_ret.status;
}
Expand All @@ -33,10 +36,13 @@ static int s_sem_wait( sem_t * sem )
********************/
int sem_destroy( sem_t * sem )
{
sret_t sem_sys_ret;
ASSERT_IF_FALSE(sem == NULL, int);
sret_t sem_sys_ret=
{
.status = SUCCESS
};
ASSERT_IF_FALSE(sem != NULL, int);

super_call(scall_id_sem_destroy, (unsigned int) *sem, RST_VAL, RST_VAL, &sem_sys_ret);
super_call(scall_id_sem_destroy, (uintptr_t) *sem, RST_VAL, RST_VAL, &sem_sys_ret);
RET_ERR_IF_FALSE(sem_sys_ret.status == SUCCESS, sem_sys_ret.status, int);

*sem = (sem_t) NULL;
Expand All @@ -47,10 +53,13 @@ int sem_destroy( sem_t * sem )
int sem_getvalue( sem_t * sem,
int * sval )
{
sret_t sem_sys_ret;
ASSERT_IF_FALSE(sem == NULL, int);
sret_t sem_sys_ret=
{
.status = SUCCESS
};
ASSERT_IF_FALSE(sem != NULL, int);

super_call(scall_id_sem_getvalue, (unsigned int) *sem, RST_VAL, RST_VAL, &sem_sys_ret);
super_call(scall_id_sem_getvalue, (uintptr_t) *sem, RST_VAL, RST_VAL, &sem_sys_ret);
RET_ERR_IF_FALSE(sem_sys_ret.status == SUCCESS, sem_sys_ret.status, int);

*sval = (int) sem_sys_ret.p;
Expand All @@ -62,8 +71,12 @@ int sem_init( sem_t * sem,
int pshared _UNUSED,
unsigned value )
{
sret_t sem_sys_ret;
ASSERT_IF_FALSE(sem == NULL, int);
sret_t sem_sys_ret=
{
.status = SUCCESS
};

ASSERT_IF_FALSE(sem != NULL, int);

super_call(scall_id_sem_init, value, RST_VAL, RST_VAL, &sem_sys_ret);
RET_ERR_IF_FALSE(sem_sys_ret.status == SUCCESS, sem_sys_ret.status, int);
Expand All @@ -75,18 +88,21 @@ int sem_init( sem_t * sem,

int sem_post( sem_t * sem )
{
sret_t sem_sys_ret;
ASSERT_IF_FALSE(sem == NULL, int);
sret_t sem_sys_ret=
{
.status = SUCCESS
};
ASSERT_IF_FALSE(sem != NULL, int);

super_call(scall_id_sem_post, (unsigned int) *sem, RST_VAL, RST_VAL, &sem_sys_ret);
super_call(scall_id_sem_post, (uintptr_t) *sem, RST_VAL, RST_VAL, &sem_sys_ret);

return sem_sys_ret.status;
}

int sem_timedwait( sem_t * sem,
const struct timespec * abstime )
{
ASSERT_IF_FALSE(sem == NULL, int);
ASSERT_IF_FALSE(sem != NULL, int);

int err = SUCCESS;
TickType_t abs_ticks;
Expand Down

0 comments on commit 91ea17e

Please sign in to comment.