Changeset 0893220 in rtems


Ignore:
Timestamp:
Nov 29, 2009, 12:12:39 PM (9 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, master
Children:
0a7278e
Parents:
33c3b54d
Message:

Whitespace removal.

Location:
cpukit
Files:
55 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libi2c/libi2c.c

    r33c3b54d r0893220  
    33/* libi2c Implementation */
    44
    5 /* 
     5/*
    66 * Authorship
    77 * ----------
     
    99 *     Till Straumann <strauman@slac.stanford.edu>, 2005,
    1010 *         Stanford Linear Accelerator Center, Stanford University.
    11  * 
     11 *
    1212 * Acknowledgement of sponsorship
    1313 * ------------------------------
     
    1515 *     the Stanford Linear Accelerator Center, Stanford University,
    1616 *         under Contract DE-AC03-76SFO0515 with the Department of Energy.
    17  * 
     17 *
    1818 * Government disclaimer of liability
    1919 * ----------------------------------
     
    2424 * disclosed, or represents that its use would not infringe privately owned
    2525 * rights.
    26  * 
     26 *
    2727 * Stanford disclaimer of liability
    2828 * --------------------------------
    2929 * Stanford University makes no representations or warranties, express or
    3030 * implied, nor assumes any liability for the use of this software.
    31  * 
     31 *
    3232 * Stanford disclaimer of copyright
    3333 * --------------------------------
    3434 * Stanford University, owner of the copyright, hereby disclaims its
    3535 * copyright and all other rights in this software.  Hence, anyone may
    36  * freely use it for any purpose without restriction. 
    37  * 
     36 * freely use it for any purpose without restriction.
     37 *
    3838 * Maintenance of notices
    3939 * ----------------------
     
    4444 * software made or distributed by the recipient that contains a copy or
    4545 * derivative of this software.
    46  * 
     46 *
    4747 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
    48  */ 
     48 */
    4949/*
    50  * adaptations to also handle SPI devices 
     50 * adaptations to also handle SPI devices
    5151 * by Thomas Doerfler, embedded brains GmbH, Puchheim, Germany
    5252 */
     
    358358    return 0;
    359359  }
    360  
     360
    361361  /* rtems_io_register_driver does NOT currently check nor report back
    362362   * the return code of the 'init' operation, so we cannot
     
    535535
    536536int
    537 rtems_libi2c_read_bytes (rtems_device_minor_number minor, 
    538                          unsigned char *bytes, 
     537rtems_libi2c_read_bytes (rtems_device_minor_number minor,
     538                         unsigned char *bytes,
    539539                         int nbytes)
    540540{
     
    552552
    553553int
    554 rtems_libi2c_write_bytes (rtems_device_minor_number minor, 
    555                           const unsigned char *bytes, 
     554rtems_libi2c_write_bytes (rtems_device_minor_number minor,
     555                          const unsigned char *bytes,
    556556                          int nbytes)
    557557{
     
    569569
    570570int
    571 rtems_libi2c_ioctl (rtems_device_minor_number minor, 
     571rtems_libi2c_ioctl (rtems_device_minor_number minor,
    572572                    int cmd,
    573573                    ...)
     
    578578  bool is_started = false;
    579579  DECL_CHECKED_BH (busno, bush, minor, -)
    580    
     580
    581581  va_start(ap, cmd);
    582582  args = va_arg(ap, void *);
     
    584584  switch(cmd) {
    585585    /*
    586      * add ioctls defined for this level here:   
    587      */
    588    
     586     * add ioctls defined for this level here:
     587     */
     588
    589589  case RTEMS_LIBI2C_IOCTL_GET_DRV_T:
    590590    /*
     
    612612     */
    613613    if (sc == 0) {
    614       sc = bush->ops->ioctl 
    615         (bush, 
    616          RTEMS_LIBI2C_IOCTL_SET_TFRMODE, 
     614      sc = bush->ops->ioctl
     615        (bush,
     616         RTEMS_LIBI2C_IOCTL_SET_TFRMODE,
    617617         &((rtems_libi2c_tfm_read_write_t *)args)->tfr_mode);
    618618    }
     
    621621     */
    622622    if (sc == 0) {
    623       sc = bush->ops->ioctl 
    624         (bush, 
    625          RTEMS_LIBI2C_IOCTL_READ_WRITE, 
     623      sc = bush->ops->ioctl
     624        (bush,
     625         RTEMS_LIBI2C_IOCTL_READ_WRITE,
    626626         &((rtems_libi2c_tfm_read_write_t *)args)->rd_wr);
    627627    }
     
    638638
    639639static int
    640 do_s_rw (rtems_device_minor_number minor, 
    641          unsigned char *bytes, 
    642          int nbytes, 
     640do_s_rw (rtems_device_minor_number minor,
     641         unsigned char *bytes,
     642         int nbytes,
    643643         int rw)
    644644{
     
    670670
    671671int
    672 rtems_libi2c_start_read_bytes (rtems_device_minor_number minor, 
     672rtems_libi2c_start_read_bytes (rtems_device_minor_number minor,
    673673                               unsigned char *bytes,
    674674                               int nbytes)
     
    678678
    679679int
    680 rtems_libi2c_start_write_bytes (rtems_device_minor_number minor, 
     680rtems_libi2c_start_write_bytes (rtems_device_minor_number minor,
    681681                                const unsigned char *bytes,
    682682                                int nbytes)
  • cpukit/libi2c/libi2c.h

    r33c3b54d r0893220  
    1111/*$Id$*/
    1212
    13 /* 
     13/*
    1414 * Authorship
    1515 * ----------
     
    1717 *     Till Straumann <strauman@slac.stanford.edu>, 2005,
    1818 *         Stanford Linear Accelerator Center, Stanford University.
    19  * 
     19 *
    2020 * Acknowledgement of sponsorship
    2121 * ------------------------------
     
    2323 *     the Stanford Linear Accelerator Center, Stanford University,
    2424 *         under Contract DE-AC03-76SFO0515 with the Department of Energy.
    25  * 
     25 *
    2626 * Government disclaimer of liability
    2727 * ----------------------------------
     
    3232 * disclosed, or represents that its use would not infringe privately owned
    3333 * rights.
    34  * 
     34 *
    3535 * Stanford disclaimer of liability
    3636 * --------------------------------
    3737 * Stanford University makes no representations or warranties, express or
    3838 * implied, nor assumes any liability for the use of this software.
    39  * 
     39 *
    4040 * Stanford disclaimer of copyright
    4141 * --------------------------------
    4242 * Stanford University, owner of the copyright, hereby disclaims its
    4343 * copyright and all other rights in this software.  Hence, anyone may
    44  * freely use it for any purpose without restriction. 
    45  * 
     44 * freely use it for any purpose without restriction.
     45 *
    4646 * Maintenance of notices
    4747 * ----------------------
     
    5252 * software made or distributed by the recipient that contains a copy or
    5353 * derivative of this software.
    54  * 
     54 *
    5555 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
    56  */ 
     56 */
    5757
    5858#include <rtems.h>
     
    119119extern const rtems_driver_address_table rtems_libi2c_io_ops;
    120120
    121 /* Unfortunately, if you want to add this driver to 
     121/* Unfortunately, if you want to add this driver to
    122122 * a RTEMS configuration table then you need all the
    123123 * members explicitly :-( (Device_driver_table should
     
    132132 * Currently the preferred way is having the BSP
    133133 * call 'rtems_libi2c_initialize' followed by
    134  * 'rtems_libi2c_register_bus' and 
     134 * 'rtems_libi2c_register_bus' and
    135135 * 'rtems_libi2c_register_drv' and/or
    136136 * 'mknod' (for 'raw' device nodes)
     
    166166
    167167/* Access functions a low level driver must provide;
    168  * 
     168 *
    169169 * All of these, except read_bytes and write_bytes
    170170 * return RTEMS_SUCCESSFUL on success and an error status
     
    190190                      int nbytes);
    191191  /* ioctl misc functions */
    192   int (*ioctl) (rtems_libi2c_bus_t * bushdl, 
     192  int (*ioctl) (rtems_libi2c_bus_t * bushdl,
    193193                int   cmd,
    194194                void *buffer
     
    206206 *
    207207 * The name will be registered in the filesystem (parent
    208  * directories must exist, also IMFS filesystem must exist see 
     208 * directories must exist, also IMFS filesystem must exist see
    209209 * CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM). It may be NULL in which case
    210210 * the library will pick a default.
     
    265265 * and following byte written to the device as data, i.e., the
    266266 * contents could easily be changed!).
    267  * The correct 'read-pointer offset' programming could be 
     267 * The correct 'read-pointer offset' programming could be
    268268 * implemented in 'open' and 'ioctl' of a high-level driver and
    269269 * the user would then only have to perform harmless read
    270  * operations, e.g., 
     270 * operations, e.g.,
    271271 *
    272272 *    fd = open("/dev/i2c.eeprom",O_RDONLY) / * opens and sets EEPROM read pointer * /
     
    279279/* struct provided at driver registration. The driver may store
    280280 * private data behind the mandatory first fields but the size
    281  * must be set to the size of the entire struct, e.g., 
     281 * must be set to the size of the entire struct, e.g.,
    282282 *
    283283 * struct driver_pvt {
     
    286286 * } my_driver = {
    287287 *              {  ops: my_ops,
    288  *                size: sizeof(my_driver) 
     288 *                size: sizeof(my_driver)
    289289 *              },
    290290 *              { ...};
     
    306306 * The registration procedure also creates a filesystem node,
    307307 * i.e., the returned minor number is not really needed.
    308  * 
     308 *
    309309 * If the 'name' argument is NULL, no filesystem node is
    310310 * created (but this can be done 'manually' using rtems_libi2c_major
     
    358358/* Send start, send address and read bytes */
    359359extern int
    360 rtems_libi2c_start_read_bytes (rtems_device_minor_number minor, 
     360rtems_libi2c_start_read_bytes (rtems_device_minor_number minor,
    361361                               unsigned char *bytes,
    362362                               int nbytes);
     
    364364/* Send start, send address and write bytes */
    365365extern int
    366 rtems_libi2c_start_write_bytes (rtems_device_minor_number minor, 
     366rtems_libi2c_start_write_bytes (rtems_device_minor_number minor,
    367367                                const unsigned char *bytes,
    368368                                int nbytes);
     
    386386 *                             RTEMS_LIBI2C_IOCTL_READ_WRITE,
    387387 *                              rtems_libi2c_read_write_t *arg);
    388  * 
    389  * This call performs a simultanous read/write transfer, 
     388 *
     389 * This call performs a simultanous read/write transfer,
    390390 * which is possible (and sometimes needed) for SPI devices
    391  * 
     391 *
    392392 *   arg is a pointer to a rd_wr info data structure
    393  * 
     393 *
    394394 * This call is only needed for SPI devices
    395395 */
     
    402402 *                             int byte_cnt,
    403403 *                             const rtems_libi2c_tfr_mode_t *tfr_mode_ptr);
    404  * 
     404 *
    405405 * This call addresses a slave and then:
    406406 * - sets the proper transfer mode,
    407  *  - performs a simultanous  read/write transfer, 
     407 *  - performs a simultanous  read/write transfer,
    408408 *    (which is possible and sometimes needed for SPI devices)
    409409 *    NOTE: - if rd_buffer is NULL, receive data will be dropped
    410410 *          - if wr_buffer is NULL, bytes with content 0 will transmitted
    411  * 
    412  *   rd_buffer is a pointer to a receive buffer (or NULL) 
     411 *
     412 *   rd_buffer is a pointer to a receive buffer (or NULL)
    413413 *   wr_buffer is a pointer to the data to be sent (or NULL)
    414  * 
     414 *
    415415 * This call is only needed for SPI devices
    416416 */
     
    421421 *                             RTEMS_LIBI2C_IOCTL_SET_TFRMODE,
    422422 *                             const rtems_libi2c_tfr_mode_t *tfr_mode_ptr);
    423  * 
     423 *
    424424 * This call sets an SPI device to the transfer mode needed (baudrate etc.)
    425  * 
     425 *
    426426 *   tfr_mode is a pointer to a structure defining the SPI transfer mode needed
    427  *   (see below). 
    428  * 
     427 *   (see below).
     428 *
    429429 * This call is only needed for SPI devices
    430430 */
     
    436436 *                             RTEMS_LIBI2C_IOCTL_GET_DRV_T,
    437437 *                             const rtems_libi2c_drv_t *drv_t_ptr);
    438  * 
     438 *
    439439 * This call allows the a high-level driver to query its driver table entry,
    440440 * including its private data appended to it during creation of the entry
    441  * 
     441 *
    442442 */
    443443
  • cpukit/libmisc/bspcmdline/bspcmdline_getparam.c

    r33c3b54d r0893220  
    4343{
    4444  const char *p;
    45  
     45
    4646  if ( !name )
    4747    return NULL;
    48  
     48
    4949  if ( !value )
    5050    return NULL;
    51  
     51
    5252  if ( !length )
    5353    return NULL;
    54  
     54
    5555  value[0] = '\0';
    5656
  • cpukit/libmisc/bspcmdline/bspcmdline_getparamraw.c

    r33c3b54d r0893220  
    2424  if ( !name )
    2525    return NULL;
    26    
     26
    2727  if ( !bsp_boot_cmdline )
    2828    return NULL;
  • cpukit/libmisc/bspcmdline/bspcmdline_getparamrhs.c

    r33c3b54d r0893220  
    3838    d--;
    3939  *d = '\0';
    40    
     40
    4141  return value;
    4242}
  • cpukit/libmisc/capture/capture-cli.c

    r33c3b54d r0893220  
    312312  rtems_task_priority floor = rtems_capture_watch_get_floor ();
    313313  int                 last_count = 0;
    314  
     314
    315315  for (;;)
    316316  {
     
    432432    if (count < RTEMS_CAPTURE_CLI_MAX_LOAD_TASKS)
    433433    {
    434       j = RTEMS_CAPTURE_CLI_MAX_LOAD_TASKS - count;   
     434      j = RTEMS_CAPTURE_CLI_MAX_LOAD_TASKS - count;
    435435      while (j > 0)
    436436      {
     
    439439      }
    440440    }
    441    
     441
    442442    last_count = count;
    443443
     
    478478
    479479  name = rtems_build_name('C', 'P', 'l', 't');
    480  
     480
    481481  sc = rtems_task_create (name, priority, 4 * 1024,
    482482                          RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
    483483                          RTEMS_PREEMPT | RTEMS_TIMESLICE | RTEMS_NO_ASR,
    484484                          &id);
    485  
    486   if (sc != RTEMS_SUCCESSFUL) 
     485
     486  if (sc != RTEMS_SUCCESSFUL)
    487487  {
    488488    fprintf (stdout, "error: cannot create helper thread: %s\n",
     
    661661     */
    662662    rtems_name   rname;
    663    
     663
    664664    rname = rtems_build_name(arg[0], arg[1], arg[2], arg[3]);
    665665    *name = rname;
     
    11191119        bool found = false;
    11201120        int  t;
    1121        
     1121
    11221122        for (t = 0; t < RTEMS_CAPTURE_CLI_TRIGGERS_NUM; t++)
    11231123          if (strcmp (argv[arg], rtems_capture_cli_triggers[t].name) == 0)
     
    11421142        if (is_from)
    11431143          fprintf (stdout, "warning: extra 'from' ignored\n");
    1144        
     1144
    11451145        is_from = 1;
    11461146        continue;
     
    11711171          fprintf (stdout, "warning: extra arguments ignored\n");
    11721172      }
    1173          
     1173
    11741174      if (valid_id)
    11751175      {
     
    12011201    return;
    12021202  }
    1203  
     1203
    12041204  if (!to_valid_name && !to_valid_id && !from_valid_name && !from_valid_id)
    12051205  {
     
    13521352     * the reader lock.
    13531353     */
    1354    
     1354
    13551355    if (read == 0)
    13561356    {
     
    13601360
    13611361    count = total < read ? total : read;
    1362    
     1362
    13631363    while (count--)
    13641364    {
     
    14041404
    14051405    count = total < read ? total : read;
    1406    
     1406
    14071407    if (count < total)
    14081408      total -= count;
  • cpukit/libmisc/capture/capture.c

    r33c3b54d r0893220  
    4141 *
    4242 * This feature has been disabled as it becomes confusing when
    43  * setting up filters and some event leak. 
     43 * setting up filters and some event leak.
    4444 */
    4545#if defined (RTEMS_CAPTURE_ENGINE_ALLOW_RELATED_EVENTS)
     
    221221  uint32_t valid_remainder = 0xffffffff;
    222222  int      i;
    223  
     223
    224224  for (i = 0; i < RTEMS_CAPTURE_TRIGGER_TASKS; i++)
    225225  {
     
    246246        return 1;
    247247    }
    248    
     248
    249249    valid_mask >>= 1;
    250250    valid_remainder >>= 1;
    251251  }
    252  
     252
    253253  return 0;
    254254}
     
    401401  rtems_capture_control_t* control;
    402402  rtems_name               name;
    403  
     403
    404404  task = _Workspace_Allocate (sizeof (rtems_capture_task_t));
    405405
     
    415415
    416416  rtems_object_get_classic_name( new_task->Object.id, &name );
    417  
     417
    418418  rtems_capture_dup_name (&task->name, name);
    419  
     419
    420420  task->id               = new_task->Object.id;
    421421  task->flags            = 0;
     
    591591    uint32_t                 to_events = 0;
    592592    uint32_t                 from_to_events = 0;
    593  
     593
    594594    if (ft)
    595595    {
     
    598598        from_events = fc->from_triggers & events;
    599599    }
    600    
     600
    601601    if (tt)
    602602    {
     
    637637    return 0;
    638638  }
    639  
     639
    640640  return 1;
    641641}
     
    712712  if (st == NULL)
    713713    st = rtems_capture_create_capture_task (started_task);
    714  
     714
    715715  if (rtems_capture_trigger (ct, st, RTEMS_CAPTURE_START))
    716716  {
     
    803803    rtems_capture_record (dt, RTEMS_CAPTURE_DELETED_EVENT);
    804804  }
    805  
     805
    806806  rtems_capture_task_stack_usage (dt);
    807807
     
    12241224  capture_in    = capture_records;
    12251225  capture_out   = 0;
    1226  
     1226
    12271227  rtems_interrupt_enable (level);
    12281228
     
    15411541   * task. TO ANY means FROM this task.
    15421542   */
    1543  
     1543
    15441544  if (mode == rtems_capture_to_any)
    15451545  {
     
    15601560      bool done = false;
    15611561      int  i;
    1562      
     1562
    15631563      control->by_triggers |= flags;
    1564      
     1564
    15651565      for (i = 0; i < RTEMS_CAPTURE_TRIGGER_TASKS; i++)
    15661566      {
     
    16171617
    16181618  flags = rtems_capture_map_trigger (trigger);
    1619  
     1619
    16201620  if (mode == rtems_capture_to_any)
    16211621  {
     
    16441644      bool done = false;
    16451645      int  i;
    1646      
     1646
    16471647      control->by_triggers &= ~flags;
    1648      
     1648
    16491649      for (i = 0; i < RTEMS_CAPTURE_TRIGGER_TASKS; i++)
    16501650      {
     
    18091809  rtems_capture_record_t* rec;
    18101810  uint32_t                counted;
    1811  
     1811
    18121812  rtems_interrupt_level level;
    18131813
     
    18201820
    18211821  counted = count;
    1822  
     1822
    18231823  rec = &capture_records[capture_out];
    18241824
     
    18291829    rec++;
    18301830  }
    1831  
     1831
    18321832  rtems_interrupt_disable (level);
    18331833
  • cpukit/libmisc/cpuuse/cpuusagereport.c

    r33c3b54d r0893220  
    8686    }
    8787  #endif
    88  
     88
    8989  (*print)(
    9090     context,
     
    114114
    115115        rtems_object_get_name( the_thread->Object.id, sizeof(name), name );
    116  
     116
    117117        (*print)(
    118118          context,
  • cpukit/libmisc/monitor/mon-editor.c

    r33c3b54d r0893220  
    243243    extended_key = rtems_monitor_getchar ();
    244244    c = extended_key & KEYS_NORMAL_MASK;
    245    
     245
    246246    /*
    247247     * Make the extended_key usable as a boolean.
  • cpukit/libmisc/monitor/mon-itask.c

    r33c3b54d r0893220  
    102102
    103103    length += rtems_monitor_pad(25, length);
    104     length += fprintf(stdout,"%" PRId32 " [0x%" PRIx32 "]", 
     104    length += fprintf(stdout,"%" PRId32 " [0x%" PRIx32 "]",
    105105      monitor_itask->argument, monitor_itask->argument);
    106106
  • cpukit/libmisc/monitor/mon-network.c

    r33c3b54d r0893220  
    5151    memset(&netmask, 0, sizeof(netmask));
    5252    memset(&broadcast, 0, sizeof(broadcast));
    53    
     53
    5454    ipaddr.sin_len = sizeof(ipaddr);
    5555    ipaddr.sin_family = AF_INET;
    56    
     56
    5757    dstaddr.sin_len = sizeof(dstaddr);
    5858    dstaddr.sin_family = AF_INET;
    59    
     59
    6060    netmask.sin_len = sizeof(netmask);
    6161    netmask.sin_family = AF_INET;
    62    
     62
    6363    broadcast.sin_len = sizeof(broadcast);
    6464    broadcast.sin_family = AF_INET;
    65    
     65
    6666    cur_idx = 0;
    6767    if (argc <= 1) {
     
    8282        }
    8383    }
    84    
     84
    8585    if ((f_down !=0) && (f_ip != 0)) {
    8686        f_up = 1;
    8787    }
    88    
     88
    8989    while(argc > cur_idx) {
    9090        if (strcmp(argv[cur_idx], "up") == 0) {
     
    102102                printf("No netmask address\n");
    103103                return;
    104             } 
     104            }
    105105            if (inet_pton(AF_INET, argv[cur_idx+1], &netmask.sin_addr) < 0) {
    106106                printf("bad netmask: %s\n", argv[cur_idx]);
     
    113113                printf("No broadcast address\n");
    114114                return;
    115             } 
     115            }
    116116            if (inet_pton(AF_INET, argv[cur_idx+1], &broadcast.sin_addr) < 0) {
    117117                printf("bad broadcast: %s\n", argv[cur_idx]);
     
    124124                printf("No pointopoint address\n");
    125125                return;
    126             } 
     126            }
    127127            if (inet_pton(AF_INET, argv[cur_idx+1], &dstaddr.sin_addr) < 0) {
    128128                printf("bad pointopoint: %s\n", argv[cur_idx]);
    129129                return;
    130130            }
    131            
     131
    132132            f_ptp = 1;
    133133            cur_idx += 1;
     
    136136            return;
    137137        }
    138        
     138
    139139        cur_idx += 1;
    140140    }
    141    
     141
    142142    printf("ifconfig ");
    143143    if (iface != NULL) {
     
    148148            printf("%s ", str);
    149149        }
    150        
     150
    151151        if (f_netmask != 0) {
    152152            char str[256];
     
    154154            printf("netmask %s ", str);
    155155        }
    156        
     156
    157157        if (f_bcast != 0) {
    158158            char str[256];
     
    160160            printf("broadcast %s ", str);
    161161        }
    162        
     162
    163163        if (f_ptp != 0) {
    164164            char str[256];
     
    166166            printf("pointopoint %s ", str);
    167167        }
    168        
     168
    169169        if (f_up != 0) {
    170170            printf("up\n");
     
    175175        }
    176176    }
    177    
     177
    178178    if ((iface == NULL) || ((f_ip == 0) && (f_down == 0) && (f_up == 0))) {
    179179        rtems_bsdnet_show_if_stats();
    180180        return;
    181181    }
    182    
     182
    183183    flags = 0;
    184184    if (f_netmask) {
     
    189189        }
    190190    }
    191    
     191
    192192    if (f_bcast) {
    193193        rc = rtems_bsdnet_ifconfig(iface, SIOCSIFBRDADDR, &broadcast);
     
    197197        }
    198198    }
    199    
     199
    200200    if (f_ptp) {
    201201        rc = rtems_bsdnet_ifconfig(iface, SIOCSIFDSTADDR, &dstaddr);
     
    206206        flags |= IFF_POINTOPOINT;
    207207    }
    208    
    209     /* This must come _after_ setting the netmask, broadcast addresses */   
     208
     209    /* This must come _after_ setting the netmask, broadcast addresses */
    210210    if (f_ip) {
    211211        rc = rtems_bsdnet_ifconfig(iface, SIOCSIFADDR, &ipaddr);
     
    215215        }
    216216    }
    217    
     217
    218218    if (f_up != 0) {
    219219        flags |= IFF_UP;
    220220    }
    221    
     221
    222222    if (f_down != 0) {
    223223        printf("Warning: taking interfaces down is not supported\n");
    224224    }
    225    
     225
    226226    rc = rtems_bsdnet_ifconfig(iface, SIOCSIFFLAGS, &flags);
    227227    if (rc < 0) {
     
    246246    int                flags;
    247247    int                rc;
    248    
     248
    249249    memset(&dst, 0, sizeof(dst));
    250250    memset(&gw, 0, sizeof(gw));
    251251    memset(&netmask, 0, sizeof(netmask));
    252    
     252
    253253    dst.sin_len = sizeof(dst);
    254254    dst.sin_family = AF_INET;
    255     dst.sin_addr.s_addr = inet_addr("0.0.0.0"); 
    256    
     255    dst.sin_addr.s_addr = inet_addr("0.0.0.0");
     256
    257257    gw.sin_len = sizeof(gw);
    258258    gw.sin_family = AF_INET;
    259     gw.sin_addr.s_addr = inet_addr("0.0.0.0"); 
    260    
     259    gw.sin_addr.s_addr = inet_addr("0.0.0.0");
     260
    261261    netmask.sin_len = sizeof(netmask);
    262262    netmask.sin_family = AF_INET;
    263     netmask.sin_addr.s_addr = inet_addr("255.255.255.0"); 
    264    
     263    netmask.sin_addr.s_addr = inet_addr("255.255.255.0");
     264
    265265    if (argc < 2) {
    266266        rtems_bsdnet_show_inet_routes();
    267267        return;
    268     } 
    269    
     268    }
     269
    270270    if (strcmp(argv[1], "add") == 0) {
    271271        cmd = RTM_ADD;
     
    277277        return;
    278278    }
    279    
     279
    280280    if (argc < 3) {
    281281        printf("not enough arguments\n");
    282282        return;
    283283    }
    284    
     284
    285285    if (strcmp(argv[2], "-host") == 0) {
    286286        f_host = 1;
     
    292292        return;
    293293    }
    294    
     294
    295295    if (argc < 4) {
    296296        printf("not enough arguments\n");
    297297        return;
    298298    }
    299    
     299
    300300    inet_pton(AF_INET, argv[3], &dst.sin_addr);
    301    
     301
    302302    cur_idx = 4;
    303303    while(cur_idx < argc) {
     
    324324        cur_idx += 1;
    325325    }
    326    
     326
    327327    flags = RTF_STATIC;
    328328    if (f_gw != 0) {
  • cpukit/libmisc/monitor/mon-part.c

    r33c3b54d r0893220  
    4040/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234
    4141          1         2         3         4         5         6         7    */
    42            
     42
    4343    rtems_monitor_separator();
    4444}
  • cpukit/libmisc/monitor/mon-prmisc.c

    r33c3b54d r0893220  
    9898    char name_buffer[18];
    9999
    100     rtems_object_get_name( id, sizeof(name_buffer), name_buffer ); 
     100    rtems_object_get_name( id, sizeof(name_buffer), name_buffer );
    101101
    102102    return fprintf( stdout, name_buffer );
  • cpukit/libmisc/monitor/mon-region.c

    r33c3b54d r0893220  
    4141/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234
    4242          1         2         3         4         5         6         7    */
    43            
     43
    4444    rtems_monitor_separator();
    4545}
  • cpukit/libmisc/monitor/mon-sema.c

    r33c3b54d r0893220  
    2424
    2525    canonical_sema->attribute = rtems_sema->attribute_set;
    26     canonical_sema->priority_ceiling = 
     26    canonical_sema->priority_ceiling =
    2727      rtems_sema->Core_control.mutex.Attributes.priority_ceiling;
    2828
    29     canonical_sema->holder_id        = 
     29    canonical_sema->holder_id        =
    3030      rtems_sema->Core_control.mutex.holder_id;
    3131
    3232    if (_Attributes_Is_counting_semaphore(canonical_sema->attribute)) {
    3333      /* we have a counting semaphore */
    34       canonical_sema->cur_count  = 
     34      canonical_sema->cur_count  =
    3535        rtems_sema->Core_control.semaphore.count;
    3636
    37       canonical_sema->max_count  = 
     37      canonical_sema->max_count  =
    3838        rtems_sema->Core_control.semaphore.Attributes.maximum_count;
    3939    }
     
    5555/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234
    5656          1         2         3         4         5         6         7    */
    57            
     57
    5858    rtems_monitor_separator();
    5959}
  • cpukit/libmisc/monitor/mon-task.c

    r33c3b54d r0893220  
    3434    canonical_task->wait_id = rtems_thread->Wait.id;
    3535    canonical_task->events = api->pending_events;
    36     /* 
     36    /*
    3737     * FIXME: make this optionally cpu_time_executed
    3838     */
  • cpukit/libmisc/shell/cmds.c

    r33c3b54d r0893220  
    5454    rtems_shell_cmd_t *shell_cmd =
    5555      (rtems_shell_cmd_t *) malloc(sizeof(rtems_shell_cmd_t));
    56    
     56
    5757    if (shell_cmd != NULL) {
    5858      shell_cmd->name    = e->command;
     
    6262      shell_cmd->alias   = NULL;
    6363      shell_cmd->next    = NULL;
    64    
     64
    6565      if (rtems_shell_add_cmd_struct(shell_cmd) == NULL) {
    6666        free(shell_cmd);
  • cpukit/libmisc/shell/dd-args.c

    r33c3b54d r0893220  
    105105
    106106  oper = NULL;
    107  
     107
    108108        in.dbsz = out.dbsz = 512;
    109109
     
    373373        if (errno != 0)                         /* Overflow or underflow. */
    374374                err(exit_jump, 1, "%s", oper);
    375        
     375
    376376        if (expr == val)                        /* No valid digits. */
    377377                errx(exit_jump, 1, "%s: illegal numeric value", oper);
     
    447447        if (errno != 0)                         /* Overflow or underflow. */
    448448                err(exit_jump, 1, "%s", oper);
    449        
     449
    450450        if (expr == val)                        /* No valid digits. */
    451451                errx(exit_jump, 1, "%s: illegal numeric value", oper);
  • cpukit/libmisc/shell/dd-position.c

    r33c3b54d r0893220  
    130130        ssize_t n;
    131131#endif
    132  
     132
    133133        /*
    134134         * If not a tape, try seeking on the file.  Seeking on a pipe is
  • cpukit/libmisc/shell/fts.c

    r33c3b54d r0893220  
    367367                        p->fts_info = FTS_DP;
    368368                        return (p);
    369                 } 
     369                }
    370370
    371371                /* Rebuild if only read the names and now traversing. */
     
    572572                SET(FTS_NAMEONLY);
    573573                instr = BNAMES;
    574         } else 
     574        } else
    575575                instr = BCHILD;
    576576
     
    778778                } else if (nlinks == 0
    779779#ifdef DT_DIR
    780                     || (nostat && 
     780                    || (nostat &&
    781781                    dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
    782782#endif
     
    900900                                errno = 0;
    901901                                return (FTS_SLNONE);
    902                         } 
     902                        }
    903903                        p->fts_errno = saved_errno;
    904904                        goto err;
     
    975975        for (ap = sp->fts_array, p = head; p; p = p->fts_link)
    976976                *ap++ = p;
    977         qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), 
     977        qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *),
    978978                (int (*) __P((const void *, const void *)))sp->fts_compar);
    979979        for (head = *(ap = sp->fts_array); --nitems; ++ap)
     
    10821082 * Most systems will allow creation of paths much longer than MAXPATHLEN, even
    10831083 * though the kernel won't resolve them.  Round up the new size to a power of 2,
    1084  * so we don't realloc the path 2 bytes at a time. 
     1084 * so we don't realloc the path 2 bytes at a time.
    10851085 */
    10861086static int
  • cpukit/libmisc/shell/hexdump-conv.c

    r33c3b54d r0893220  
    133133                        *pr->cchar = 'c';
    134134                        (void)printf(pr->fmt, (int)wc);
    135                 } else {       
     135                } else {
    136136                        *pr->cchar = 'C';
    137137                        assert(strcmp(pr->fmt, "%3C") == 0);
  • cpukit/libmisc/shell/hexdump-display.c

    r33c3b54d r0893220  
    277277                         * of multibyte characters.
    278278                         */
    279                         if (vflag != ALL && 
    280                             valid_save && 
     279                        if (vflag != ALL &&
     280                            valid_save &&
    281281                            bcmp(curp, savp, nread) == 0) {
    282282                                if (vflag != DUP)
  • cpukit/libmisc/shell/hexdump-odsyntax.c

    r33c3b54d r0893220  
    7777
    7878  struct getopt_data getopt_reent;
    79   memset(&getopt_reent, 0, sizeof(getopt_data)); 
     79  memset(&getopt_reent, 0, sizeof(getopt_data));
    8080
    8181        /* Add initial (default) address format. -A may change it later. */
  • cpukit/libmisc/shell/hexsyntax.c

    r33c3b54d r0893220  
    6464
    6565  struct getopt_data getopt_reent;
    66   memset(&getopt_reent, 0, sizeof(getopt_data)); 
     66  memset(&getopt_reent, 0, sizeof(getopt_data));
    6767
    6868        argv = *argvp;
  • cpukit/libmisc/shell/login_prompt.c

    r33c3b54d r0893220  
    1111 *     Till Straumann <strauman@slac.stanford.edu>, 2003-2007
    1212 *         Stanford Linear Accelerator Center, Stanford University.
    13  *                                                                 
    14  * Acknowledgement of sponsorship                                 
    15  * ------------------------------                                 
    16  * Parts of this software was produced by                                   
     13 *
     14 * Acknowledgement of sponsorship
     15 * ------------------------------
     16 * Parts of this software was produced by
    1717 *     the Stanford Linear Accelerator Center, Stanford University,
    1818 *         under Contract DE-AC03-76SFO0515 with the Department of Energy.
    19  *                                                                       
    20  * Government disclaimer of liability                                     
    21  * ----------------------------------                                     
    22  * Neither the United States nor the United States Department of Energy, 
    23  * nor any of their employees, makes any warranty, express or implied, or 
    24  * assumes any legal liability or responsibility for the accuracy,       
     19 *
     20 * Government disclaimer of liability
     21 * ----------------------------------
     22 * Neither the United States nor the United States Department of Energy,
     23 * nor any of their employees, makes any warranty, express or implied, or
     24 * assumes any legal liability or responsibility for the accuracy,
    2525 * completeness, or usefulness of any data, apparatus, product, or process
    2626 * disclosed, or represents that its use would not infringe privately owned
    27  * rights.                                                                 
    28  *                                                                         
    29  * Stanford disclaimer of liability                                       
    30  * --------------------------------                                       
    31  * Stanford University makes no representations or warranties, express or 
    32  * implied, nor assumes any liability for the use of this software.       
    33  *                                                                         
    34  * Stanford disclaimer of copyright                                       
    35  * --------------------------------                                       
    36  * Stanford University, owner of the copyright, hereby disclaims its       
    37  * copyright and all other rights in this software.  Hence, anyone may     
    38  * freely use it for any purpose without restriction.                     
    39  *                                                                         
    40  * Maintenance of notices                                                 
    41  * ----------------------                                                 
    42  * In the interest of clarity regarding the origin and status of this     
    43  * SLAC software, this and all the preceding Stanford University notices   
    44  * are to remain affixed to any copy or derivative of this software made   
    45  * or distributed by the recipient and are to be affixed to any copy of   
    46  * software made or distributed by the recipient that contains a copy or   
    47  * derivative of this software.                                           
    48  *                                                                         
     27 * rights.
     28 *
     29 * Stanford disclaimer of liability
     30 * --------------------------------
     31 * Stanford University makes no representations or warranties, express or
     32 * implied, nor assumes any liability for the use of this software.
     33 *
     34 * Stanford disclaimer of copyright
     35 * --------------------------------
     36 * Stanford University, owner of the copyright, hereby disclaims its
     37 * copyright and all other rights in this software.  Hence, anyone may
     38 * freely use it for any purpose without restriction.
     39 *
     40 * Maintenance of notices
     41 * ----------------------
     42 * In the interest of clarity regarding the origin and status of this
     43 * SLAC software, this and all the preceding Stanford University notices
     44 * are to remain affixed to any copy or derivative of this software made
     45 * or distributed by the recipient and are to be affixed to any copy of
     46 * software made or distributed by the recipient that contains a copy or
     47 * derivative of this software.
     48 *
    4949 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
    5050 *
  • cpukit/libmisc/shell/main_blksync.c

    r33c3b54d r0893220  
    3737  int         arg;
    3838  int         fd;
    39  
     39
    4040  for (arg = 1; arg < argc; arg++) {
    4141    if (argv[arg][0] == '-') {
     
    5252    }
    5353  }
    54  
     54
    5555  fd = open (driver, O_WRONLY, 0);
    5656  if (fd < 0) {
     
    5858    return 1;
    5959  }
    60  
     60
    6161  if (ioctl (fd, RTEMS_BLKIO_SYNCDEV) < 0) {
    6262    fprintf( stderr, "%s: driver sync failed: %s\n", argv[0], strerror (errno));
    6363    return 1;
    6464  }
    65  
     65
    6666  close (fd);
    6767  return 0;
  • cpukit/libmisc/shell/main_cp.c

    r33c3b54d r0893220  
    5454/*
    5555 * Cp copies source files to target files.
    56  * 
     56 *
    5757 * The global PATH_T structure "to" always contains the path to the
    5858 * current target file.  Since fts(3) does not change directories,
    5959 * this path can be either absolute or dot-relative.
    60  * 
     60 *
    6161 * The basic algorithm is to initialize "to" and use fts(3) to traverse
    6262 * the file hierarchy rooted in the argument list.  A trivial case is the
     
    130130
    131131        Hflag = Lflag = Pflag = 0;
    132   memset(&getopt_reent, 0, sizeof(getopt_data)); 
     132  memset(&getopt_reent, 0, sizeof(getopt_data));
    133133
    134134        while ((ch = getopt_r(argc, argv, "HLPRafilnprv", &getopt_reent)) != -1)
     
    209209        (void)signal(SIGINFO, siginfo);
    210210#endif
    211  
     211
    212212        /* Save the target base in "to". */
    213213        target = argv[--argc];
     
    447447                                if (copy_file(cp_globals, curr, dne))
    448448                                        badcp = rval = 1;
    449                         } else {       
     449                        } else {
    450450                                if (copy_link(cp_globals, curr, !dne))
    451451                                        badcp = rval = 1;
     
    553553  NULL                                                 /* next */
    554554};
    555  
     555
  • cpukit/libmisc/shell/main_date.c

    r33c3b54d r0893220  
    5555    sprintf( buf, "%s %s", argv[1], argv[2] );
    5656    result = strptime(
    57       buf, 
     57      buf,
    5858      "%Y-%m-%d %T",
    5959      &TOD
  • cpukit/libmisc/shell/main_dd.c

    r33c3b54d r0893220  
    159159        int i;
    160160
    161         i = c ^ (c >> 1) ^ (c >> 2) ^ (c >> 3) ^ 
     161        i = c ^ (c >> 1) ^ (c >> 2) ^ (c >> 3) ^
    162162            (c >> 4) ^ (c >> 5) ^ (c >> 6) ^ (c >> 7);
    163163        return (i & 1);
     
    286286
    287287        (void)gettimeofday(&tv, (struct timezone *)NULL);
    288         st.start = tv.tv_sec + tv.tv_usec * 1e-6; 
     288        st.start = tv.tv_sec + tv.tv_usec * 1e-6;
    289289}
    290290
     
    302302                io->flags |= ISTRUNC;
    303303#if RTEMS_REMOVED
    304         if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { 
     304        if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) {
    305305                if (ioctl(io->fd, FIODTYPE, &type) == -1) {
    306306                        err(exit_jump, 1, "%s", io->name);
  • cpukit/libmisc/shell/main_getenv.c

    r33c3b54d r0893220  
    3636
    3737  printf ("%s\n", string);
    38  
     38
    3939  return 0;
    4040}
  • cpukit/libmisc/shell/main_hexdump.c

    r33c3b54d r0893220  
    128128        (void)setlocale(LC_ALL, "");
    129129#endif
    130  
     130
    131131        if (!(p = rindex(argv[0], 'o')) || strcmp(p, "od"))
    132132                newsyntax(globals, argc, &argv);
     
    159159  NULL                                                      /* next */
    160160};
    161  
     161
  • cpukit/libmisc/shell/main_ifconfig.c

    r33c3b54d r0893220  
    5454  memset(&netmask, 0, sizeof(netmask));
    5555  memset(&broadcast, 0, sizeof(broadcast));
    56    
     56
    5757  ipaddr.sin_len = sizeof(ipaddr);
    5858  ipaddr.sin_family = AF_INET;
    59  
     59
    6060  dstaddr.sin_len = sizeof(dstaddr);
    6161  dstaddr.sin_family = AF_INET;
    62  
     62
    6363  netmask.sin_len = sizeof(netmask);
    6464  netmask.sin_family = AF_INET;
    65  
     65
    6666  broadcast.sin_len = sizeof(broadcast);
    6767  broadcast.sin_family = AF_INET;
    68  
     68
    6969  cur_idx = 0;
    7070  if (argc <= 1) {
     
    8585    }
    8686  }
    87  
     87
    8888  if ((f_down !=0) && (f_ip != 0)) {
    8989    f_up = 1;
    9090  }
    91  
     91
    9292  while(argc > cur_idx) {
    9393    if (strcmp(argv[cur_idx], "up") == 0) {
     
    105105        printf("No netmask address\n");
    106106        return -1;
    107       } 
     107      }
    108108      if (inet_pton(AF_INET, argv[cur_idx+1], &netmask.sin_addr) < 0) {
    109109        printf("bad netmask: %s\n", argv[cur_idx]);
     
    116116        printf("No broadcast address\n");
    117117        return -1;
    118       } 
     118      }
    119119      if (inet_pton(AF_INET, argv[cur_idx+1], &broadcast.sin_addr) < 0) {
    120120        printf("bad broadcast: %s\n", argv[cur_idx]);
     
    127127        printf("No pointopoint address\n");
    128128        return -1;
    129       } 
     129      }
    130130      if (inet_pton(AF_INET, argv[cur_idx+1], &dstaddr.sin_addr) < 0) {
    131131        printf("bad pointopoint: %s\n", argv[cur_idx]);
     
    140140    cur_idx += 1;
    141141  }
    142  
     142
    143143  printf("ifconfig ");
    144144  if (iface != NULL) {
     
    149149      printf("%s ", str);
    150150    }
    151      
     151
    152152    if (f_netmask != 0) {
    153153      char str[256];
     
    155155      printf("netmask %s ", str);
    156156    }
    157      
     157
    158158    if (f_bcast != 0) {
    159159      char str[256];
     
    161161      printf("broadcast %s ", str);
    162162    }
    163      
     163
    164164    if (f_ptp != 0) {
    165165      char str[256];
     
    167167      printf("pointopoint %s ", str);
    168168    }
    169      
     169
    170170    if (f_up != 0) {
    171171      printf("up\n");
     
    176176    }
    177177  }
    178  
     178
    179179  if ((iface == NULL) || ((f_ip == 0) && (f_down == 0) && (f_up == 0))) {
    180180    rtems_bsdnet_show_if_stats();
    181181    return 0;
    182182  }
    183  
     183
    184184  flags = 0;
    185185  if (f_netmask) {
     
    190190    }
    191191  }
    192  
     192
    193193  if (f_bcast) {
    194194    rc = rtems_bsdnet_ifconfig(iface, SIOCSIFBRDADDR, &broadcast);
     
    198198    }
    199199  }
    200  
     200
    201201  if (f_ptp) {
    202202    rc = rtems_bsdnet_ifconfig(iface, SIOCSIFDSTADDR, &dstaddr);
     
    207207    flags |= IFF_POINTOPOINT;
    208208  }
    209  
    210   /* This must come _after_ setting the netmask, broadcast addresses */   
     209
     210  /* This must come _after_ setting the netmask, broadcast addresses */
    211211  if (f_ip) {
    212212    rc = rtems_bsdnet_ifconfig(iface, SIOCSIFADDR, &ipaddr);
     
    216216    }
    217217  }
    218  
     218
    219219  if (f_up != 0) {
    220220    flags |= IFF_UP;
    221221  }
    222  
     222
    223223  if (f_down != 0) {
    224224    printf("Warning: taking interfaces down is not supported\n");
    225225  }
    226  
     226
    227227  rc = rtems_bsdnet_ifconfig(iface, SIOCSIFFLAGS, &flags);
    228228  if (rc < 0) {
  • cpukit/libmisc/shell/main_ln.c

    r33c3b54d r0893220  
    142142        (void)setlocale(LC_ALL, "");
    143143#endif
    144  
     144
    145145        while ((ch = getopt_r(argc, argv, "fhinsv", &getopt_reent)) != -1)
    146146                switch (ch) {
     
    160160                        sflag = 1;
    161161                        break;
    162                 case 'v':               
     162                case 'v':
    163163                        vflag = 1;
    164164                        break;
  • cpukit/libmisc/shell/main_ls.c

    r33c3b54d r0893220  
    159159    struct getopt_data getopt_reent;
    160160    memset(&getopt_reent, 0, sizeof(getopt_data));
    161    
     161
    162162#if RTEMS_REMOVED
    163163        setprogname(argv[0]);
     
    453453                return;
    454454    }
    455    
     455
    456456        /*
    457457         * If not recursing down this tree and don't need stat info, just get
     
    702702        int a_info, b_info;
    703703    int l_f_listdir = 0;
    704    
     704
    705705        a_info = (*a)->fts_info;
    706706        if (a_info == FTS_ERR)
  • cpukit/libmisc/shell/main_mdump.c

    r33c3b54d r0893220  
    5353    }
    5454    if (max <= 0) {
    55       max = 1;      /* print 1 item if 0 or neg. */ 
     55      max = 1;      /* print 1 item if 0 or neg. */
    5656      res = 0;
    5757    } else {
  • cpukit/libmisc/shell/main_mount.c

    r33c3b54d r0893220  
    6363   * Mount the disk.
    6464   */
    65  
     65
    6666  if (mount (&mt_entry, fs->fs_ops, options, (char*) driver, (char*) path) < 0)
    6767  {
     
    6969    return 1;
    7070  }
    71  
     71
    7272  return 0;
    7373}
     
    8787
    8888  rtems_shell_mount_fsys_init();
    89  
     89
    9090  for (arg = 1; arg < argc; arg++) {
    9191    if (argv[arg][0] == '-') {
     
    160160    return 1;
    161161  }
    162  
     162
    163163  if (fs->driver_needed && !driver) {
    164164    fprintf (stderr, "mount: no driver\n");
    165165    return 1;
    166166  }
    167  
     167
    168168  if (!mount_point) {
    169169    fprintf (stderr, "mount: no mount point\n");
    170170    return 1;
    171171  }
    172  
     172
    173173  /*
    174174   * Mount the disk.
    175175   */
    176  
     176
    177177  if (fs->mounter (driver, mount_point, fs, options))
    178178    return 1;
    179179
    180180  printf ("mounted %s -> %s\n", driver, mount_point);
    181  
     181
    182182  return 0;
    183183}
  • cpukit/libmisc/shell/main_mount_nfs.c

    r33c3b54d r0893220  
    5050
    5151  nfsInit (0, 0);
    52  
     52
    5353  uidhost = strdup (device);
    5454  path = strchr (uidhost, ':');
    5555  *path = '\0';
    5656  path++;
    57  
     57
    5858  ret = nfsMount(uidhost, path, (char*) mntpoint);
    5959
  • cpukit/libmisc/shell/main_msdosfmt.c

    r33c3b54d r0893220  
    4141    info_level:          0
    4242  };
    43  
     43
    4444  unsigned long tmp;
    4545  const char*   driver = NULL;
    4646  int           arg;
    47  
     47
    4848  for (arg = 1; arg < argc; arg++) {
    4949    if (argv[arg][0] == '-') {
     
    7575          rqdata.sectors_per_cluster = (uint32_t) tmp;
    7676          break;
    77          
     77
    7878        case 'r':
    7979          arg++;
     
    9393          rqdata.files_per_root_dir = (uint32_t) tmp;
    9494          break;
    95          
     95
    9696        case 't':
    9797          arg++;
     
    118118          rqdata.info_level++;
    119119          break;
    120          
     120
    121121        default:
    122122          fprintf (stderr, "error: invalid option: %s\n", argv[arg]);
    123123          return 1;
    124          
     124
    125125      }
    126126    } else {
     
    138138    return 1;
    139139  }
    140  
     140
    141141  printf ("msdos format: %s\n", driver);
    142142
     
    153153    printf (" %-20s: %lu\n", "cluster align", rqdata.cluster_align);
    154154  }
    155  
     155
    156156  if (msdos_format (driver, &rqdata) < 0) {
    157157    fprintf (stderr, "error: format failed: %s\n", strerror (errno));
  • cpukit/libmisc/shell/main_mv.c

    r33c3b54d r0893220  
    129129
    130130#define do_move(a1, a2)      do_move_mv(globals, a1, a2)
    131 #define fastcopy(a1, a2, a3) fastcopy_mv(globals, a1, a2, a3) 
    132 #define copy(a1, a2)         copy_mv(globals, a1, a2) 
     131#define fastcopy(a1, a2, a3) fastcopy_mv(globals, a1, a2, a3)
     132#define copy(a1, a2)         copy_mv(globals, a1, a2)
    133133#define usage()              usage_mv(globals)
    134134
     
    152152  struct getopt_data getopt_reent;
    153153  memset(&getopt_reent, 0, sizeof(getopt_data));
    154  
     154
    155155/*      setprogname(argv[0]); */
    156  
     156
    157157        (void)setlocale(LC_ALL, "");
    158158
     
    332332
    333333  blen = 0;
    334  
     334
    335335        if ((from_fd = open(from, O_RDONLY, 0)) < 0) {
    336336                warn("%s", from);
     
    364364                return (1);
    365365        }
    366  
     366
    367367  (void)free(bp);
    368368        (void)close(from_fd);
  • cpukit/libmisc/shell/main_mwdump.c

    r33c3b54d r0893220  
    5353
    5454    if (max <= 0) {
    55       max = 1;      /* print 1 item if 0 or neg. */ 
     55      max = 1;      /* print 1 item if 0 or neg. */
    5656      res = 0;
    5757    } else {
  • cpukit/libmisc/shell/main_netstats.c

    r33c3b54d r0893220  
    5757  struct getopt_data getopt_reent;
    5858
    59   memset(&getopt_reent, 0, sizeof(getopt_data)); 
     59  memset(&getopt_reent, 0, sizeof(getopt_data));
    6060  while ( (option = getopt_r( argc, argv, "Aimfpcutv", &getopt_reent)) != -1 ) {
    6161
     
    7676    }
    7777  }
    78  
     78
    7979  if ( verbose ) {
    8080    printf(
  • cpukit/libmisc/shell/main_rm.c

    r33c3b54d r0893220  
    146146        int ch;
    147147        char *p;
    148  
     148
    149149  struct getopt_data getopt_reent;
    150150  memset(&getopt_reent, 0, sizeof(getopt_data));
    151  
     151
    152152        /*
    153153         * Test for the special case where the utility is called as
  • cpukit/libmisc/shell/main_route.c

    r33c3b54d r0893220  
    4242  int                flags;
    4343  int                rc;
    44  
     44
    4545  memset(&dst, 0, sizeof(dst));
    4646  memset(&gw, 0, sizeof(gw));
    4747  memset(&netmask, 0, sizeof(netmask));
    48  
     48
    4949  dst.sin_len = sizeof(dst);
    5050  dst.sin_family = AF_INET;
    51   dst.sin_addr.s_addr = inet_addr("0.0.0.0"); 
    52  
     51  dst.sin_addr.s_addr = inet_addr("0.0.0.0");
     52
    5353  gw.sin_len = sizeof(gw);
    5454  gw.sin_family = AF_INET;
    55   gw.sin_addr.s_addr = inet_addr("0.0.0.0"); 
    56  
     55  gw.sin_addr.s_addr = inet_addr("0.0.0.0");
     56
    5757  netmask.sin_len = sizeof(netmask);
    5858  netmask.sin_family = AF_INET;
    59   netmask.sin_addr.s_addr = inet_addr("255.255.255.0"); 
    60  
     59  netmask.sin_addr.s_addr = inet_addr("255.255.255.0");
     60
    6161  if (argc < 2) {
    6262    rtems_bsdnet_show_inet_routes();
    6363    return 0;
    64   } 
    65  
     64  }
     65
    6666  if (strcmp(argv[1], "add") == 0) {
    6767    cmd = RTM_ADD;
     
    7373    return -1;
    7474  }
    75  
     75
    7676  if (argc < 3) {
    7777    printf("not enough arguments\n");
    7878    return -1;
    7979  }
    80  
     80
    8181  if (strcmp(argv[2], "-host") == 0) {
    8282    f_host = 1;
     
    8888    return -1;
    8989  }
    90  
     90
    9191  if (argc < 4) {
    9292    printf("not enough arguments\n");
    9393    return -1;
    9494  }
    95  
     95
    9696  inet_pton(AF_INET, argv[3], &dst.sin_addr);
    97  
     97
    9898  cur_idx = 4;
    9999  while(cur_idx < argc) {
     
    120120    cur_idx += 1;
    121121  }
    122  
     122
    123123  flags = RTF_STATIC;
    124124  if (f_gw != 0) {
  • cpukit/libmisc/shell/main_setenv.c

    r33c3b54d r0893220  
    3232
    3333  env = argv[1];
    34  
     34
    3535  for (arg = 2; arg < argc; arg++)
    3636    len += strlen (argv[arg]);
     
    3939
    4040  string = malloc (len + 1);
    41  
     41
    4242  if (!string)
    4343  {
     
    4545    return 1;
    4646  }
    47  
     47
    4848  for (arg = 2, p = string; arg < argc; arg++)
    4949  {
     
    5656    }
    5757  }
    58  
     58
    5959  if (setenv (env, string, 1) < 0)
    6060  {
  • cpukit/libmisc/shell/main_time.c

    r33c3b54d r0893220  
    4343  if (sc != RTEMS_SUCCESSFUL)
    4444    printf("error: cannot read time\n");
    45  
     45
    4646  if (argc) {
    4747    shell_cmd = rtems_shell_lookup_cmd(argv[1]);
     
    6666    period.tv_nsec += 1000000000UL;
    6767  }
    68  
     68
    6969  printf("time: %li:%02li:%02li.%03li\n",
    7070         period.tv_sec / 3600,
    7171         period.tv_sec / 60, period.tv_sec % 60,
    7272         period.tv_nsec / 1000000);
    73  
     73
    7474  return errorlevel;
    7575}
  • cpukit/libmisc/shell/main_unmount.c

    r33c3b54d r0893220  
    3535  char* mount_point = NULL;
    3636  int   arg;
    37  
     37
    3838  for (arg = 1; arg < argc; arg++) {
    3939    if (!mount_point)
     
    4949    return 1;
    5050  }
    51  
     51
    5252  /*
    5353   * Unmount the disk.
    5454   */
    55  
     55
    5656  if (unmount (mount_point) < 0) {
    5757    fprintf (stderr, "error: unmount failed: %s: %s\n",
     
    5959    return 1;
    6060  }
    61  
     61
    6262  printf ("unmounted %s\n", mount_point);
    63  
     63
    6464  return 0;
    6565}
  • cpukit/libmisc/shell/main_unsetenv.c

    r33c3b54d r0893220  
    3030    return 1;
    3131  }
    32  
     32
    3333  return 0;
    3434}
  • cpukit/libmisc/shell/print-ls.c

    r33c3b54d r0893220  
    344344                if (f_humanize)
    345345                        extwidth += dp->s_size + 1;
    346                 else 
     346                else
    347347                        extwidth += dp->s_block + 1;
    348348        }
  • cpukit/libmisc/shell/shell_cmdset.c

    r33c3b54d r0893220  
    4242 *   help [topic] list the commands for the topic
    4343 *   help [command] help for the command
    44  * 
     44 *
    4545 */
    4646
     
    112112{
    113113  rtems_shell_cmd_t *shell_pvt;
    114  
     114
    115115  shell_pvt = rtems_shell_first_cmd;
    116116  while (shell_pvt) {
     
    127127      shell_pvt = shell_pvt->next;
    128128    shell_pvt->next = shell_cmd;
    129   } 
     129  }
    130130  rtems_shell_add_topic( shell_cmd->topic );
    131131  return shell_cmd;
     
    133133
    134134/*
    135  *  Add a command as a set of arguments to the set and 
     135 *  Add a command as a set of arguments to the set and
    136136 *  allocate the command structure on the fly.
    137137 */
  • cpukit/libmisc/shell/shell_getprompt.c

    r33c3b54d r0893220  
    11/*
    2  *  Dynamically build the shell prompt 
     2 *  Dynamically build the shell prompt
    33 *
    44 *  The license and distribution terms for this file may be
     
    3939{
    4040  char curdir[256];
    41  
     41
    4242  /* XXX: show_prompt user adjustable */
    4343  getcwd(curdir,sizeof(curdir));
  • cpukit/libmisc/shell/shell_makeargs.c

    r33c3b54d r0893220  
    2020int rtems_shell_make_args(
    2121  char  *commandLine,
    22   int   *argc_p, 
    23   char **argv_p, 
     22  int   *argc_p,
     23  char **argv_p,
    2424  int    max_args
    2525)
     
    2828  char *command;
    2929  int   status = 0;
    30  
     30
    3131  argc = 0;
    3232  command = commandLine;
  • cpukit/libmisc/shell/shell_script.c

    r33c3b54d r0893220  
    7070    strcat(
    7171      scriptFile,
    72       ( (userScriptName[0] == '.' && userScriptName[1] == '/') ? 
     72      ( (userScriptName[0] == '.' && userScriptName[1] == '/') ?
    7373         &userScriptName[2] : userScriptName)
    7474    );
     
    8383
    8484#if 0
    85    /* 
     85   /*
    8686    * Does the command (argv[0]) contain a path ?, i.e. starts with
    8787    * '.' or contains a '/'?
     
    121121  struct getopt_data   getopt_reent;
    122122
    123   memset(&getopt_reent, 0, sizeof(getopt_data)); 
     123  memset(&getopt_reent, 0, sizeof(getopt_data));
    124124  while ( (option = getopt_r( argc, argv, "o:p:s:t:v", &getopt_reent)) != -1 ) {
    125125    switch ((char)option) {
     
    150150        taskName = getopt_reent.optarg;
    151151        break;
    152       case 'v': 
     152      case 'v':
    153153        verbose = 1;
    154154        break;
    155       case '?': 
     155      case '?':
    156156      default:
    157157        rtems_shell_joel_usage();
     
    161161
    162162  if ( verbose ) {
    163     fprintf( stderr, 
     163    fprintf( stderr,
    164164      "outputFile: %s\n"
    165165      "taskPriority: %" PRId32 "\n"
     
    180180    fprintf( stderr, "Shell: No script to execute\n" );
    181181    return -1;
    182   } 
    183  
    184   /*
    185    *  Find script on the path. 
     182  }
     183
     184  /*
     185   *  Find script on the path.
    186186   *
    187187   *  NOTE: It is terrible that this is done twice but it
     
    218218  return 0;
    219219}
    220      
     220
    221221rtems_shell_cmd_t rtems_shell_JOEL_Command = {
    222222  "joel",                        /* name */
     
    304304
    305305  /* fprintf( stderr, "FIRST LINE: -%s-\n", scriptHead ); */
    306    
     306
    307307  /*
    308308   *  Verify the name of the "shell" is joel.  This means
  • cpukit/libmisc/shell/utils-cp.c

    r33c3b54d r0893220  
    136136                        return (0);
    137137                } else if (iflag) {
    138                         (void)fprintf(stderr, "overwrite %s? %s", 
     138                        (void)fprintf(stderr, "overwrite %s? %s",
    139139                                        to.p_path, YESNO);
    140140                        checkch = ch = getchar();
     
    148148                        }
    149149                }
    150                
     150
    151151                if (fflag) {
    152                     /* remove existing destination file name, 
     152                    /* remove existing destination file name,
    153153                     * create a new file  */
    154154                    (void)unlink(to.p_path);
     
    256256        }
    257257        (void)close(from_fd);
    258        
     258
    259259        /*
    260260         * Don't remove the target even after an error.  The target might
     
    402402                }
    403403#endif
    404  
     404
    405405        return (rval);
    406406}
  • cpukit/libmisc/stackchk/check.c

    r33c3b54d r0893220  
    154154      p[3] = 0x600D0D06;
    155155  }
    156  
     156
    157157  /*
    158158   * If appropriate, setup the interrupt stack for high water testing
     
    442442    (*print_handler)( print_context, "%8" PRId32 "\n", used );
    443443  }
    444    
     444
    445445
    446446}
     
    475475
    476476  (*print)( context, "Stack usage by thread\n");
    477   (*print)( context, 
     477  (*print)( context,
    478478"    ID      NAME    LOW          HIGH     CURRENT     AVAILABLE     USED\n"
    479479  );
  • cpukit/libmisc/uuid/gen_uuid.c

    r33c3b54d r0893220  
    404404        if (state_fd > 0) {
    405405                rewind(state_f);
    406                 len = fprintf(state_f, 
     406                len = fprintf(state_f,
    407407                              "clock: %04x tv: %016lu %08lu adj: %08d\n",
    408408                              clock_seq, last.tv_sec, last.tv_usec, adjustment);
Note: See TracChangeset for help on using the changeset viewer.