Module: xenomai-forge
Branch: next
Commit: 98e2de4de4fd1339a05ed127613fd909a07653c0
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=98e2de4de4fd1339a05ed127613fd909a07653c0

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Mar 14 10:42:18 2014 +0100

cobalt/posix: add pedantic inits for dumb optimizers

---

 kernel/cobalt/posix/clock.c  |    2 +-
 kernel/cobalt/posix/event.c  |    2 +-
 kernel/cobalt/posix/sem.c    |    2 +-
 kernel/cobalt/posix/thread.c |    2 +-
 kernel/cobalt/posix/timer.c  |    6 +++---
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/kernel/cobalt/posix/clock.c b/kernel/cobalt/posix/clock.c
index 1bf21da..8eeb6d7 100644
--- a/kernel/cobalt/posix/clock.c
+++ b/kernel/cobalt/posix/clock.c
@@ -184,7 +184,7 @@ int cobalt_clock_gettime(clockid_t clock_id, struct 
timespec __user *u_ts)
 {
        struct timespec ts;
        xnticks_t ns;
-       int ret;
+       int ret = 0;
 
        switch (clock_id) {
        case CLOCK_REALTIME:
diff --git a/kernel/cobalt/posix/event.c b/kernel/cobalt/posix/event.c
index 57d10f0..d000291 100644
--- a/kernel/cobalt/posix/event.c
+++ b/kernel/cobalt/posix/event.c
@@ -292,7 +292,7 @@ int cobalt_event_inquire(struct cobalt_event_shadow __user 
*u_event,
                         pid_t __user *u_waitlist,
                         size_t waitsz)
 {
-       int nrpend, nrwait = 0, nrpids, ret = 0;
+       int nrpend = 0, nrwait = 0, nrpids, ret = 0;
        unsigned long pstamp, nstamp = 0;
        struct cobalt_event_info info;
        struct cobalt_event *event;
diff --git a/kernel/cobalt/posix/sem.c b/kernel/cobalt/posix/sem.c
index 98bb67e..2e3e1f4 100644
--- a/kernel/cobalt/posix/sem.c
+++ b/kernel/cobalt/posix/sem.c
@@ -779,7 +779,7 @@ int cobalt_sem_inquire(struct cobalt_sem_shadow __user 
*u_sem,
                       pid_t __user *u_waitlist,
                       size_t waitsz)
 {
-       int val, nrwait = 0, nrpids, ret = 0;
+       int val = 0, nrwait = 0, nrpids, ret = 0;
        unsigned long pstamp, nstamp = 0;
        struct cobalt_sem_info info;
        pid_t *t = NULL, fbuf[16];
diff --git a/kernel/cobalt/posix/thread.c b/kernel/cobalt/posix/thread.c
index 31f29f2..2123be9 100644
--- a/kernel/cobalt/posix/thread.c
+++ b/kernel/cobalt/posix/thread.c
@@ -1246,7 +1246,7 @@ int cobalt_sched_max_prio(int policy)
 int cobalt_sched_yield(void)
 {
        struct cobalt_thread *curr = cobalt_current_thread();
-       int ret;
+       int ret = 0;
 
        /* Maybe some extension wants to handle this. */
        if (cobalt_call_extension(sched_yield, &curr->extref, ret) && ret)
diff --git a/kernel/cobalt/posix/timer.c b/kernel/cobalt/posix/timer.c
index d04ddac..5ef0696 100644
--- a/kernel/cobalt/posix/timer.c
+++ b/kernel/cobalt/posix/timer.c
@@ -51,7 +51,7 @@ static inline struct cobalt_thread *
 timer_init(struct cobalt_timer *timer,
           const struct sigevent *__restrict__ evp)
 {
-       struct cobalt_thread *owner = cobalt_current_thread(), *target;
+       struct cobalt_thread *owner = cobalt_current_thread(), *target = NULL;
 
        /*
         * First, try to offload this operation to the extended
@@ -310,7 +310,7 @@ static inline void
 timer_gettimeout(struct cobalt_timer *__restrict__ timer,
                 struct itimerspec *__restrict__ value)
 {
-       int ret;
+       int ret = 0;
 
        if (!xntimer_running_p(&timer->timerbase)) {
                value->it_value.tv_sec = 0;
@@ -334,7 +334,7 @@ static inline int timer_set(struct cobalt_timer *timer, int 
flags,
 {                              /* nklocked, IRQs off. */
        struct cobalt_thread *thread;
        xnticks_t start, period;
-       int ret;
+       int ret = 0;
 
        /* First, try offloading the work to an extension. */
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to