Fixed minor compilation warnings

Warnings outputed by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

* pcl/pcl.c:385:17: warning: unused variable ‘r’ [-Wunused-variable]

* Use pre-compilation directive to avoid defining unused function when not needed:

  * pcl/pcl.c:62:12: warning: ‘co_ctx_stackdir’ defined but not used [-Wunused-function]
    static int co_ctx_stackdir(void)

  * pcl/pcl.c:54:12: warning: ‘co_ctx_sdir’ defined but not used [-Wunused-function]
    static int co_ctx_sdir(unsigned long psp)

Signed-off-by: Pierre Souchay <pierre@souchay.net>
This commit is contained in:
Pierre Souchay
2020-03-23 18:20:08 +01:00
parent 3382277e97
commit f19c3f7d23

View File

@@ -51,6 +51,7 @@ static co_ctx_t ctx_caller;
#endif /* #if defined(CO_USE_SIGCONTEXT) */
#if defined(CO_HAS_SIGSTACK)
static int co_ctx_sdir(unsigned long psp)
{
int nav = 0;
@@ -65,6 +66,7 @@ static int co_ctx_stackdir(void)
return co_ctx_sdir((unsigned long) &cav);
}
#endif
#if defined(CO_USE_UCONEXT)
@@ -382,7 +384,7 @@ static void co_runner(void)
coroutine_t co_create(void (*func)(void *), void *data, void *stack, int size)
{
int alloc = 0, r = CO_STK_COROSIZE;
int alloc = 0;
coroutine *co;
if ((size &= ~(sizeof(long) - 1)) < CO_MIN_SIZE)