Changeset 26cf027 in rtems


Ignore:
Timestamp:
Jun 17, 2010, 2:48:50 AM (9 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10
Children:
f5577ea
Parents:
a585ea1
Message:

2010-06-17 Ralf Corsépius <ralf.corsepius@…>

  • libfs/src/rfs/rtems-rfs-bitmaps-ut.c: Various 64bit fixes.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    ra585ea1 r26cf027  
    112010-06-17      Ralf Corsépius <ralf.corsepius@rtems.org>
    22
     3        * libfs/src/rfs/rtems-rfs-bitmaps-ut.c: Various 64bit fixes.
    34        * libfs/src/rfs/rtems-rfs-group.c: Various 64bit fixes.
    45
  • cpukit/libfs/src/rfs/rtems-rfs-bitmaps-ut.c

    ra585ea1 r26cf027  
    2424#include <stdio.h>
    2525#include <stdlib.h>
     26#include <inttypes.h>
    2627
    2728#include <rtems/rfs/rtems-rfs-bitmaps.h>
     
    4546    if (rc > 0)
    4647    {
    47       printf (" %2d. Test bit %ld in range (%ld,%ld] is %s: ",
     48      printf (" %2d. Test bit %" PRId32 " in range (%" PRId32 ",%ld] is %s: ",
    4849            test, bit + count, bit, bit + size - 1, !set ? "set" : "clear");
    4950      printf ("FAIL (%s)\n", strerror (rc));
     
    5455    if (!result)
    5556    {
    56       printf (" %2d. Test bit %ld in range (%ld,%ld] is %s: ",
     57      printf (" %2d. Test bit %" PRId32 " in range (%" PRId32 ",%ld] is %s: ",
    5758              test, bit + count, bit, bit + size - 1, !set ? "set" : "clear");
    5859      printf (" %s\n", !result ? "pass" : "FAIL");
     
    6162  }
    6263 
    63   printf (" %2d. Test bit range (%ld,%ld] all %s: pass\n",
     64  printf (" %2d. Test bit range (%" PRId32 ",%ld] all %s: pass\n",
    6465          test, bit, bit + size - 1, set ? "set" : "clear");
    6566
     
    8889    rtems_rfs_bitmap_map_clear (control, bit + i);
    8990 
    90   printf (" %2d. Cleared bits (%ld, %ld] (%zd)\n",
     91  printf (" %2d. Cleared bits (%" PRId32 ", %ld] (%zd)\n",
    9192          test, bit, bit + size - 1, size);
    9293 
     
    101102    if (state)
    102103    {
    103       printf (" %2d. Cleared bit still set: bit = %ld\n", test, bit + i);
     104      printf (" %2d. Cleared bit still set: bit = %" PRId32 "\n", test, bit + i);
    104105      return false;
    105106    }
     
    119120    if (!result)
    120121    {
    121       printf (" %2d. Find bit with seed = %ld: %s: bit = %ld\n",
     122      printf (" %2d. Find bit with seed = %" PRId32 ": %s: bit = %" PRId32 "\n",
    122123              test, seed, result ? "pass" : "FAIL", bit);
    123124      return false;
     
    125126  }
    126127
    127   printf (" %2d. Alloc'ed all bits (%ld, %ld] (%zd)\n",
     128  printf (" %2d. Alloc'ed all bits (%" PRId32 ", %ld] (%zd)\n",
    128129          test, bit, bit + size - 1, size);
    129130 
     
    207208  rc = rtems_rfs_bitmap_map_alloc (&control, 0, &result, &bit);
    208209  result = result && (bit == 0);
    209   printf ("  3. Find bit 0 with seed = 0: %s (%s): bit = %ld\n",
     210  printf ("  3. Find bit 0 with seed = 0: %s (%s): bit = %" PRId32 "\n",
    210211          result ? "pass" : "FAIL", strerror (rc),  bit);
    211212  rtems_rfs_exit_on_error (rc, !result, &control, buffer.buffer);
     
    213214  rc = rtems_rfs_bitmap_map_alloc (&control, size - 1, &result, &bit);
    214215  result = result && (bit == (size - 1));
    215   printf ("  4. Find bit (size - 1) with seed = (size - 1) (%zd): %s (%s): bit = %ld\n",
     216  printf ("  4. Find bit (size - 1) with seed = (size - 1) (%zd): %s (%s): bit = %" PRId32 "\n",
    216217          size - 1, result ? "pass" : "FAIL", strerror (rc), bit);
    217218  rtems_rfs_exit_on_error (rc, !result, &control, buffer.buffer);
     
    246247 
    247248  rc = rtems_rfs_bitmap_map_clear (&control, bit);
    248   printf ("  9. Clear bit %ld: %s (%s)\n",
     249  printf ("  9. Clear bit %" PRId32 ": %s (%s)\n",
    249250          bit, rc == 0 ? "PASS" : "FAIL", strerror (rc));
    250251  rtems_rfs_exit_on_error (rc, false, &control, buffer.buffer);
     
    253254  rc = rtems_rfs_bitmap_map_alloc (&control, 0, &result, &bit);
    254255  result = result && (bit == last_bit);
    255   printf (" 10. Find bit with seed = 0: %s (%s): bit = %ld\n",
     256  printf (" 10. Find bit with seed = 0: %s (%s): bit = %" PRId32 "\n",
    256257          result ? "pass" : "FAIL", strerror (rc), bit);
    257258  rtems_rfs_exit_on_error (rc, !result, &control, buffer.buffer);
     
    259260  rc = rtems_rfs_bitmap_map_alloc (&control, 0, &result, &bit);
    260261  result = !result || (bit != last_bit);
    261   printf (" 11. Fail to find bit with seed = 0: %s (%s): bit = %ld\n",
     262  printf (" 11. Fail to find bit with seed = 0: %s (%s): bit = %" PRId32 "\n",
    262263          result ? "pass" : "FAIL", strerror (rc), bit);
    263264  rtems_rfs_exit_on_error (rc, !result, &control, buffer.buffer);
     
    270271  rc = rtems_rfs_bitmap_map_alloc (&control, size - 1, &result, &bit);
    271272  result = result && (bit == 0);
    272   printf (" 13. Find bit with seed = (size - 1): %s (%s): bit = %ld\n",
     273  printf (" 13. Find bit with seed = (size - 1): %s (%s): bit = %" PRId32 "\n",
    273274          result ? "pass" : "FAIL", strerror (rc), bit);
    274275  rtems_rfs_exit_on_error (rc, !result, &control, buffer.buffer);
     
    281282  rc = rtems_rfs_bitmap_map_alloc (&control, 0, &result, &bit);
    282283  result = result && (bit == (size - 1));
    283   printf (" 15. Find bit with seed = 0: %s (%s): bit = %ld\n",
     284  printf (" 15. Find bit with seed = 0: %s (%s): bit = %" PRId32 "\n",
    284285          result ? "pass" : "FAIL", strerror (rc), bit);
    285286  rtems_rfs_exit_on_error (rc, !result, &control, buffer.buffer);
     
    291292  rc = rtems_rfs_bitmap_map_alloc (&control, size / 2, &result, &bit);
    292293  result = result && (bit == 0);
    293   printf (" 17. Find bit with seed = (size / 2) (%zd): %s (%s): bit = %ld\n",
     294  printf (" 17. Find bit with seed = (size / 2) (%zd): %s (%s): bit = %" PRId32 "\n",
    294295          size / 2, result ? "pass" : "FAIL", strerror (rc), bit);
    295296  rtems_rfs_exit_on_error (rc, !result, &control, buffer.buffer);
     
    302303  rc = rtems_rfs_bitmap_map_alloc (&control, size / 2, &result, &bit);
    303304  result = result && (bit == (size - 1));
    304   printf (" 19. Find bit with seed = (size / 2) (%zd): %s (%s): bit = %ld\n",
     305  printf (" 19. Find bit with seed = (size / 2) (%zd): %s (%s): bit = %" PRId32 "\n",
    305306          size / 2, result ? "pass" : "FAIL", strerror (rc), bit);
    306307  rtems_rfs_exit_on_error (rc, !result, &control, buffer.buffer);
     
    312313  rc = rtems_rfs_bitmap_map_alloc (&control, (size / 2) - 1, &result, &bit);
    313314  result = result && (bit == 0);
    314   printf (" 21. Find bit with seed = ((size / 2) - 1) (%zd): %s (%s): bit = %ld\n",
     315  printf (" 21. Find bit with seed = ((size / 2) - 1) (%zd): %s (%s): bit = %" PRId32 "\n",
    315316          (size / 2) - 1, result ? "pass" : "FAIL", strerror (rc), bit);
    316317  rtems_rfs_exit_on_error (rc, !result, &control, buffer.buffer);
     
    322323  rc = rtems_rfs_bitmap_map_alloc (&control, (size / 2) - 1, &result, &bit);
    323324  result = result && (bit == (size - 1));
    324   printf (" 23. Find bit with seed = ((size / 2) - 1) (%zd): %s (%s): bit = %ld\n",
     325  printf (" 23. Find bit with seed = ((size / 2) - 1) (%zd): %s (%s): bit = %" PRId32 "\n",
    325326          (size / 2) - 1, result ? "pass" : "FAIL", strerror (rc), bit);
    326327  rtems_rfs_exit_on_error (rc, !result, &control, buffer.buffer);
     
    352353    if (rc > 0)
    353354    {
    354       printf (" 26. Clear bit %ld: %s (%s)\n",
     355      printf (" 26. Clear bit %" PRId32 ": %s (%s)\n",
    355356              bit, rc == 0 ? "PASS" : "FAIL", strerror (rc));
    356357      rtems_rfs_exit_on_error (rc, false, &control, buffer.buffer);
     
    358359  }
    359360 
    360   printf (" 26. Clear bit (%ld, %ld]: %s (%s)\n",
     361  printf (" 26. Clear bit (%" PRId32 ", %" PRId32 "]: %s (%s)\n",
    361362          first_bit, last_bit, rc == 0 ? "PASS" : "FAIL", strerror (rc));
    362363 
    363364  clear = rtems_rfs_bitmap_map_free (&control);
    364365  result = clear == (last_bit - first_bit);
    365   printf (" 27. Check free count is %zd: %ld: %s (%s)\n",
     366  printf (" 27. Check free count is %zd: %" PRId32 ": %s (%s)\n",
    366367          clear, last_bit - first_bit,
    367368          result ? "pass" : "FAIL", strerror (rc));
Note: See TracChangeset for help on using the changeset viewer.