Changeset 1fcff14 in rtems


Ignore:
Timestamp:
Nov 14, 2009, 9:09:34 PM (10 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, master
Children:
87bd3ee
Parents:
787519fb
Message:

2009-11-14 Ralf Corsépius <ralf.corsepius@…>

  • rtems++/Task1.cc, rtems++/Task2.cc: Spray PRI* macros to eliminate several dozens of warnings.
Location:
testsuites/libtests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/ChangeLog

    r787519fb r1fcff14  
     12009-11-14      Ralf Corsépius <ralf.corsepius@rtems.org>
     2
     3        * rtems++/Task1.cc, rtems++/Task2.cc: Spray PRI* macros to eliminate
     4        several dozens of warnings.
     5
    162009-11-13      Ralf Corsépius <ralf.corsepius@rtems.org>
    27
  • testsuites/libtests/rtems++/Task1.cc

    r787519fb r1fcff14  
    2727#include "System.h"
    2828
     29/* c.f. cpukit/score/include/rtems/score/priority.h */
     30#define PRIiPriority_Control PRIi32
     31/* rtems_task_priority is a typedef to Priority_Control */
     32#define PRIirtems_task_priority PRIiPriority_Control
     33
     34/* c.f. cpukit/rtems/include/rtems/rtems/modes.h */
     35#define PRIXModes_Control PRIX32
     36/* rtems_mode is a typedef to Modes_Control */
     37#define PRIXrtems_mode PRIXModes_Control
     38
    2939void Task1::body(rtems_task_argument argument)
    3040{
     
    191201  printf("%s - get priority - ", name_string());
    192202  get_priority(current_priority);
    193   printf("%s, priority is %i\n", last_status_string(), current_priority);
     203  printf("%s, priority is %" PRIirtems_task_priority "\n", last_status_string(), current_priority);
    194204
    195205  printf("%s - set priority to 512 - ", name_string());
     
    203213  printf("%s - set priority to original - ", name_string());
    204214  set_priority(current_priority, priority);
    205   printf("%s, priority was %i\n", last_status_string(), priority);
     215  printf("%s, priority was %" PRIirtems_task_priority "\n", last_status_string(), priority);
    206216
    207217  // priorities with connected object
     
    209219  printf("%s - connected object get priority - ", task_1.name_string());
    210220  task_1.get_priority(current_priority);
    211   printf("%s, priority is %i\n", task_1.last_status_string(), current_priority);
     221  printf("%s, priority is %" PRIirtems_task_priority "\n", task_1.last_status_string(), current_priority);
    212222
    213223  printf("%s - connected object set priority to 512 - ", task_1.name_string());
     
    221231  printf("%s - connected object set priority to original - ", task_1.name_string());
    222232  task_1.set_priority(current_priority, priority);
    223   printf("%s, priority was %i\n", task_1.last_status_string(), priority); 
     233  printf("%s, priority was %" PRIirtems_task_priority "\n", task_1.last_status_string(), priority); 
    224234
    225235  // priorities with self object
     
    227237  printf("%s - self object get priority - ", task_2.name_string());
    228238  task_2.get_priority(current_priority);
    229   printf("%s, priority is %i\n", task_2.last_status_string(), current_priority);
     239  printf("%s, priority is %" PRIirtems_task_priority "\n", task_2.last_status_string(), current_priority);
    230240
    231241  printf("%s - self object set priority to 512 - ", task_2.name_string());
     
    239249  printf("%s - self object set priority to original - ", task_2.name_string());
    240250  task_2.set_priority(current_priority, priority);
    241   printf("%s, priority was %i\n", task_2.last_status_string(), priority);
     251  printf("%s, priority was %" PRIirtems_task_priority "\n", task_2.last_status_string(), priority);
    242252
    243253  uint32_t   current_note;
     
    248258  printf("%s - get note - ", name_string());
    249259  get_note(0, current_note);
    250   printf("%s, note is %i\n", last_status_string(), current_note);
     260  printf("%s, note is %" PRIi32 "\n", last_status_string(), current_note);
    251261
    252262  printf("%s - get with bad notepad number - ", name_string());
    253263  get_note(100, current_note);
    254   printf("%s, note is %i\n", last_status_string(), current_note);
     264  printf("%s, note is %" PRIi32 "\n", last_status_string(), current_note);
    255265
    256266  printf("%s - set note to 0xDEADBEEF - ", name_string());
     
    260270  printf("%s - get note - ", name_string());
    261271  get_note(0, note);
    262   printf("%s, note is 0x%08X\n", last_status_string(), note);
     272  printf("%s, note is 0x%08" PRIX32 "\n", last_status_string(), note);
    263273
    264274  printf("%s - set note to original value - ", name_string());
     
    270280  printf("%s - connected object get note - ", task_1.name_string());
    271281  task_1.get_note(0, current_note);
    272   printf("%s, notepad is %i\n", task_1.last_status_string(), current_note);
     282  printf("%s, notepad is %" PRIi32 "\n", task_1.last_status_string(), current_note);
    273283
    274284  printf("%s - connected object get with bad notepad number - ", task_1.name_string());
    275285  task_1.get_note(100, current_note);
    276   printf("%s, note is %i\n", task_1.last_status_string(), current_note);
     286  printf("%s, note is %" PRIi32 "\n", task_1.last_status_string(), current_note);
    277287
    278288  printf("%s - connected object set note to 0xDEADBEEF - ", task_1.name_string());
     
    282292  printf("%s - connected object get note - ", task_1.name_string());
    283293  task_1.get_note(0, note);
    284   printf("%s, note is 0x%08X\n", task_1.last_status_string(), note);
     294  printf("%s, note is 0x%08" PRIX32 "\n", task_1.last_status_string(), note);
    285295
    286296  printf("%s - connected object set note to original value - ", task_1.name_string());
     
    292302  printf("%s - self object get note - ", task_2.name_string());
    293303  task_2.get_note(0, current_note);
    294   printf("%s, note is %i\n", task_2.last_status_string(), current_note);
     304  printf("%s, note is %" PRIi32 "\n", task_2.last_status_string(), current_note);
    295305
    296306  printf("%s - self object get with bad notepad number - ", task_2.name_string());
    297307  task_2.get_note(100, current_note);
    298   printf("%s, note is %i\n", task_2.last_status_string(), current_note);
     308  printf("%s, note is %" PRIi32 "\n", task_2.last_status_string(), current_note);
    299309
    300310  printf("%s - self object set note to 0xDEADBEEF - ", task_2.name_string());
     
    304314  printf("%s - self object get note - ", task_2.name_string());
    305315  task_2.get_note(0, note);
    306   printf("%s, notepad is 0x%08X\n", task_2.last_status_string(), note);
     316  printf("%s, notepad is 0x%08" PRIX32 "\n", task_2.last_status_string(), note);
    307317
    308318  printf("%s - self object set note to original value - ", task_2.name_string());
     
    329339  printf("%s - get mode - ", self.name_string());
    330340  task_mode.get_mode(current_mode);
    331   printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), current_mode);
     341  printf("%s,\n\t mode is 0x%08" PRIXrtems_mode ", ", task_mode.last_status_string(), current_mode);
    332342  print_mode(current_mode, RTEMS_ALL_MODES);
    333343  printf("\n");
     
    337347  printf("%s - get preemption state - ", self.name_string());
    338348  task_mode.get_preemption_state(mode);
    339   printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode);
     349  printf("%s,\n\t mode is 0x%08" PRIXrtems_mode ", ", task_mode.last_status_string(), mode);
    340350  print_mode(mode, RTEMS_PREEMPT_MASK);
    341351  printf("\n");
     
    344354  task_mode.set_preemption_state(RTEMS_PREEMPT);
    345355  task_mode.get_mode(mode);
    346   printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode);
     356  printf("%s,\n\t mode is 0x%08" PRIXrtems_mode ", ", task_mode.last_status_string(), mode);
    347357  print_mode(mode, RTEMS_ALL_MODES);
    348358  printf("\n");
     
    351361  task_mode.set_preemption_state(RTEMS_NO_PREEMPT);
    352362  task_mode.get_mode(mode);
    353   printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode);
     363  printf("%s,\n\t mode is 0x%08" PRIXrtems_mode ", ", task_mode.last_status_string(), mode);
    354364  print_mode(mode, RTEMS_ALL_MODES);
    355365  printf("\n");
     
    359369  printf("%s - get timeslice state - ", self.name_string());
    360370  task_mode.get_timeslice_state(mode);
    361   printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode);
     371  printf("%s,\n\t mode is 0x%08" PRIXrtems_mode ", ", task_mode.last_status_string(), mode);
    362372  print_mode(mode, RTEMS_TIMESLICE_MASK);
    363373  printf("\n");
     
    366376  task_mode.set_timeslice_state(RTEMS_TIMESLICE);
    367377  task_mode.get_mode(mode);
    368   printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode);
     378  printf("%s,\n\t mode is 0x%08" PRIXrtems_mode ", ", task_mode.last_status_string(), mode);
    369379  print_mode(mode, RTEMS_ALL_MODES);
    370380  printf("\n");
     
    373383  task_mode.set_timeslice_state(RTEMS_NO_TIMESLICE);
    374384  task_mode.get_mode(mode);
    375   printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode);
     385  printf("%s,\n\t mode is 0x%08" PRIXrtems_mode ", ", task_mode.last_status_string(), mode);
    376386  print_mode(mode, RTEMS_ALL_MODES);
    377387  printf("\n");
     
    381391  printf("%s - get asr state - ", self.name_string());
    382392  task_mode.get_asr_state(mode);
    383   printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode);
     393  printf("%s,\n\t mode is 0x%08" PRIXrtems_mode ", ", task_mode.last_status_string(), mode);
    384394  print_mode(mode, RTEMS_ASR_MASK);
    385395  printf("\n");
     
    388398  task_mode.set_asr_state(RTEMS_ASR);
    389399  task_mode.get_mode(mode);
    390   printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode);
     400  printf("%s,\n\t mode is 0x%08" PRIXrtems_mode ", ", task_mode.last_status_string(), mode);
    391401  print_mode(mode, RTEMS_ALL_MODES);
    392402  printf("\n");
     
    395405  task_mode.set_asr_state(RTEMS_NO_ASR);
    396406  task_mode.get_mode(mode);
    397   printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode);
     407  printf("%s,\n\t mode is 0x%08" PRIXrtems_mode ", ", task_mode.last_status_string(), mode);
    398408  print_mode(mode, RTEMS_ALL_MODES);
    399409  printf("\n");
     
    421431                     RTEMS_ASR_MASK | RTEMS_INTERRUPT_MASK);
    422432  task_mode.get_mode(mode);
    423   printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode);
     433  printf("%s,\n\t mode is 0x%08" PRIXrtems_mode ", ", task_mode.last_status_string(), mode);
    424434  print_mode(mode, RTEMS_ALL_MODES);
    425435  printf("\n");
     
    578588  printf("%s - broadcast send b1 ...\n", name_string());
    579589  mq_2.broadcast(b1, strlen(b1) + 1, count);
    580   printf("%s - mq_2 broadcast send - %s, count=%i\n",
     590  printf("%s - mq_2 broadcast send - %s, count=%" PRIi32 "\n",
    581591         name_string(), mq_2.last_status_string(), count);
    582592
     
    645655  printf("%s - flush mq_2 - ", name_string());
    646656  mq_2.flush(count);
    647   printf("%s, flushed=%i\n", mq_2.last_status_string(), count);
     657  printf("%s, flushed=%" PRIi32 "\n", mq_2.last_status_string(), count);
    648658 
    649659  printf(" * END MessageQueue Class test *\n"); 
  • testsuites/libtests/rtems++/Task2.cc

    r787519fb r1fcff14  
    5454  printf("%s - event wait forever for signal 0 from TA1 ....\n", name_string());
    5555  event.receive(RTEMS_SIGNAL_0, out);
    56   printf("%s - %s, signals out are 0x%08X\n", name_string(), event.last_status_string(), out);
     56  printf("%s - %s, signals out are 0x%08" PRIX32 "\n", name_string(), event.last_status_string(), out);
    5757
    5858  // send using task object reference
    5959  printf("%s - event wait forever for signal 0 from TA1 ....\n", name_string());
    6060  event.receive(RTEMS_SIGNAL_0, out);
    61   printf("%s - %s, signals out are 0x%08X\n", name_string(), event.last_status_string(), out);
     61  printf("%s - %s, signals out are 0x%08" PRIX32 "\n", name_string(), event.last_status_string(), out);
    6262 
    6363  printf("%s - event wait forever for signal 31 from TA1 ....\n", name_string());
    6464  event.receive(RTEMS_SIGNAL_31, out);
    65   printf("%s - %s, signals out are 0x%08X\n", name_string(), event.last_status_string(), out);
     65  printf("%s - %s, signals out are 0x%08" PRIX32 "\n", name_string(), event.last_status_string(), out);
    6666 
    6767  printf("%s - event wait forever for signal 0 and 31 from TA1 ....\n", name_string());
    6868  event.receive(RTEMS_SIGNAL_0 | RTEMS_SIGNAL_31, out, 0, rtemsEvent::wait, rtemsEvent::all);
    69   printf("%s - %s, signals out are 0x%08X\n", name_string(), event.last_status_string(), out);
     69  printf("%s - %s, signals out are 0x%08" PRIX32 "\n", name_string(), event.last_status_string(), out);
    7070
    7171  printf("%s - send event signal 1 - ", name_string());
     
    7575  printf("%s - event wait forever for signal 1 from TA2 - ", name_string());
    7676  event.receive(RTEMS_SIGNAL_1, out, 0, rtemsEvent::wait, rtemsEvent::all);
    77   printf("%s, signals out are 0x%08X\n", event.last_status_string(), out); 
     77  printf("%s, signals out are 0x%08" PRIX32 "\n", event.last_status_string(), out); 
    7878}
    7979
Note: See TracChangeset for help on using the changeset viewer.