summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-12-02 19:15:24 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-12-02 19:15:24 +0000
commit35ee867eb90e35aa1084c75dbaf224be80a6e226 (patch)
tree951c6538dd4628955afa4b430f9ed67032926238
parent2002-12-02 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-35ee867eb90e35aa1084c75dbaf224be80a6e226.tar.bz2
2002-12-02 Joel Sherrill <joel@OARcorp.com>
* include/rtems/posix/timer.h, src/keygetspecific.c, src/posixtimespecsubtract.c, src/ptimer1.c, src/semunlink.c: Added casts to eliminate warnings on 16-bit targets like the h8300.
-rw-r--r--cpukit/posix/ChangeLog6
-rw-r--r--cpukit/posix/include/rtems/posix/timer.h16
-rw-r--r--cpukit/posix/src/keygetspecific.c3
-rw-r--r--cpukit/posix/src/posixtimespecsubtract.c2
-rw-r--r--cpukit/posix/src/ptimer1.c3
-rw-r--r--cpukit/posix/src/semunlink.c2
6 files changed, 21 insertions, 11 deletions
diff --git a/cpukit/posix/ChangeLog b/cpukit/posix/ChangeLog
index 36b6fb1e54..045b1018e3 100644
--- a/cpukit/posix/ChangeLog
+++ b/cpukit/posix/ChangeLog
@@ -1,3 +1,9 @@
+2002-12-02 Joel Sherrill <joel@OARcorp.com>
+
+ * include/rtems/posix/timer.h, src/keygetspecific.c,
+ src/posixtimespecsubtract.c, src/ptimer1.c, src/semunlink.c:
+ Added casts to eliminate warnings on 16-bit targets like the h8300.
+
2002-11-29 Eric Norum <eric.norum@usask.ca>
* src/sysconf.c: Add support for _SC_GETPW_R_SIZE_MAX.
diff --git a/cpukit/posix/include/rtems/posix/timer.h b/cpukit/posix/include/rtems/posix/timer.h
index ba0745b8b3..5726c270f5 100644
--- a/cpukit/posix/include/rtems/posix/timer.h
+++ b/cpukit/posix/include/rtems/posix/timer.h
@@ -13,21 +13,23 @@
#define STATE_CREATE_NEW_C 0x02 /* Created timer but not running */
#define STATE_CREATE_RUN_C 0x03 /* Created timer and running */
#define STATE_CREATE_STOP_C 0x04 /* Created, ran and stopped timer */
-#define MAX_NSEC_C 1000000000 /* Maximum number of nsec allowed */
+/* Maximum number of nsec allowed */
+#define MAX_NSEC_C (unsigned32)1000000000
#define MIN_NSEC_C 0 /* Minimum number of nsec allowew */
#define TIMER_RELATIVE_C 0 /* Indicates that the fire time is
* relative to the current one */
#define SEC_TO_TICKS_C _TOD_Ticks_per_second /* Number of ticks in a second*/
-#define NSEC_PER_SEC_C 1000000000 /* Nanoseconds in a second */
+/* Nanoseconds in a second */
+#define NSEC_PER_SEC_C (unsigned32)1000000000
#define NO_MORE_TIMERS_C 11 /* There is not available timers */
#define BAD_TIMER_C 11 /* The timer does not exist in the table */
-#define SECONDS_PER_YEAR_C ( 360 * 24 * 60 * 60 )
-#define SECONDS_PER_MONTH_C ( 30 * 24 * 60 * 60 )
-#define SECONDS_PER_DAY_C ( 24 * 60 * 60 )
-#define SECONDS_PER_HOUR_C ( 60 * 60 )
-#define SECONDS_PER_MINUTE_C ( 60 )
+#define SECONDS_PER_YEAR_C (unsigned32)(360 * 24) * (unsigned32)(60 * 60)
+#define SECONDS_PER_MONTH_C (unsigned32)( 30 * 24) * (unsigned32)(60 * 60)
+#define SECONDS_PER_DAY_C (unsigned32)( 24 * 60) * (unsigned32)(60)
+#define SECONDS_PER_HOUR_C (unsigned32)( 60 * 60 )
+#define SECONDS_PER_MINUTE_C (unsigned32)( 60 )
/*
diff --git a/cpukit/posix/src/keygetspecific.c b/cpukit/posix/src/keygetspecific.c
index b0529bd96e..ef3fd736a7 100644
--- a/cpukit/posix/src/keygetspecific.c
+++ b/cpukit/posix/src/keygetspecific.c
@@ -43,5 +43,6 @@ void *pthread_getspecific(
_Thread_Enable_dispatch();
return key_data;
}
- return (void *) POSIX_BOTTOM_REACHED();
+ (void) POSIX_BOTTOM_REACHED();
+ return (void *)NULL;
}
diff --git a/cpukit/posix/src/posixtimespecsubtract.c b/cpukit/posix/src/posixtimespecsubtract.c
index 1b6cc75902..205730468a 100644
--- a/cpukit/posix/src/posixtimespecsubtract.c
+++ b/cpukit/posix/src/posixtimespecsubtract.c
@@ -31,7 +31,7 @@ void _POSIX_Timespec_subtract(
{
struct timespec start_struct = *the_start;
struct timespec *start = &start_struct;
- unsigned int nsecs_per_sec = TOD_NANOSECONDS_PER_SECOND;
+ unsigned32 nsecs_per_sec = TOD_NANOSECONDS_PER_SECOND;
if (end->tv_nsec < start->tv_nsec) {
int seconds = (start->tv_nsec - end->tv_nsec) / nsecs_per_sec + 1;
diff --git a/cpukit/posix/src/ptimer1.c b/cpukit/posix/src/ptimer1.c
index 820f61f1a4..907645ce18 100644
--- a/cpukit/posix/src/ptimer1.c
+++ b/cpukit/posix/src/ptimer1.c
@@ -573,7 +573,8 @@ int timer_settime(
timer_struct[timer_pos].ticks =
( SEC_TO_TICKS_C * value->it_value.tv_sec ) +
- ( value->it_value.tv_nsec / ( 1000 * 1000 * 10 ) );
+ ( value->it_value.tv_nsec /
+ (1000L * (unsigned32)(1000 * 10) ));
return_v = rtems_timer_fire_after ( timerid,
timer_struct[timer_pos].ticks,
diff --git a/cpukit/posix/src/semunlink.c b/cpukit/posix/src/semunlink.c
index 29912d4281..81ba417dbf 100644
--- a/cpukit/posix/src/semunlink.c
+++ b/cpukit/posix/src/semunlink.c
@@ -50,7 +50,7 @@ int sem_unlink(
* Don't support unlinking a remote semaphore.
*/
- if ( !_Objects_Is_local_id(the_semaphore_id) ) {
+ if ( !_Objects_Is_local_id((Objects_Id)the_semaphore_id) ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( ENOSYS );
}