From fb5785cce6630acb0cccda767844f106282dcd06 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Thu, 22 Oct 2009 11:56:01 +0000 Subject: [PATCH] =?UTF-8?q?2009-10-22=09Ralf=20Cors=C3=A9pius=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * libblock/include/rtems/flashdisk.h: Use UINT32_C consts to avoid implicit int-cast overflows in RTEMS_FDISK_KBYTES. --- cpukit/ChangeLog | 5 +++++ cpukit/libblock/include/rtems/flashdisk.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 446e351805..1d9acacc52 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,8 @@ +2009-10-22 Ralf Corsépius + + * libblock/include/rtems/flashdisk.h: Use UINT32_C consts to + avoid implicit int-cast overflows in RTEMS_FDISK_KBYTES. + 2009-10-22 Ralf Corsépius * libcsupport/include/rtems/error.h: Use ordinal constants for diff --git a/cpukit/libblock/include/rtems/flashdisk.h b/cpukit/libblock/include/rtems/flashdisk.h index 4240060596..37ef9a6a25 100644 --- a/cpukit/libblock/include/rtems/flashdisk.h +++ b/cpukit/libblock/include/rtems/flashdisk.h @@ -95,7 +95,7 @@ typedef struct rtems_fdisk_segment_desc /** * Return the number of kilo-bytes. */ -#define RTEMS_FDISK_KBYTES(_k) ((_k) * 1024) +#define RTEMS_FDISK_KBYTES(_k) (UINT32_C(1024) * (_k)) /** * Forward declaration of the device descriptor.