Changeset f205c18f in rtems


Ignore:
Timestamp:
Apr 17, 2013, 10:19:33 AM (6 years ago)
Author:
Ralf Corsépius <ralf.corsepius@…>
Branches:
4.11, master
Children:
ef8e851
Parents:
7b369af
git-author:
Ralf Corsépius <ralf.corsepius@…> (04/17/13 10:19:33)
git-committer:
Ralf Corsépius <ralf.corsepius@…> (04/17/13 10:23:34)
Message:

Use uint32_t instead of long. Use unsigned defines (Prevent overflows on 16bit targets)

Location:
testsuites/libtests/flashdisk01
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/flashdisk01/init.c

    r7b369af rf205c18f  
    4242#define FLASHDISK_DEVICE_COUNT 1
    4343
    44 #define FLASHDISK_SEGMENT_COUNT 4
     44#define FLASHDISK_SEGMENT_COUNT 4U
    4545
    4646#define FLASHDISK_SEGMENT_SIZE (16 * 1024)
    4747
    48 #define FLASHDISK_BLOCK_SIZE 512
     48#define FLASHDISK_BLOCK_SIZE 512U
    4949
    5050#define FLASHDISK_BLOCKS_PER_SEGMENT \
     
    348348#define CONFIGURE_MAXIMUM_SEMAPHORES 1
    349349
    350 #define CONFIGURE_MINIMUM_TASK_STACK_SIZE (32 * 1024)
     350#define CONFIGURE_MINIMUM_TASK_STACK_SIZE (32U * 1024U)
    351351
    352352#define CONFIGURE_EXTRA_TASK_STACKS (8 * 1024)
  • testsuites/libtests/flashdisk01/test-file-system.c

    r7b369af rf205c18f  
    3737#define ASSERT_SC(sc) assert((sc) == RTEMS_SUCCESSFUL)
    3838
    39 #define BUFFER_SIZE (32 * 1024)
     39#define BUFFER_SIZE (32U * 1024U)
    4040
    4141#define HEADER_SIZE 8
     
    148148static unsigned get_bucket_with_random(unsigned count, long random)
    149149{
    150   long unsigned unit = (1U << 31) / count;
    151   long unsigned bucket = (long unsigned) random / unit;
     150  uint32_t unit = ((uint32_t) 1U << 31) / count;
     151  uint32_t bucket = (uint32_t) random / unit;
    152152
    153153  if (bucket != count) {
Note: See TracChangeset for help on using the changeset viewer.