Changeset 76d0981d in mainline for uspace


Ignore:
Timestamp:
2018-04-12T12:57:20Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3bacee1
Parents:
9c514be
git-author:
Jiri Svoboda <jiri@…> (2018-04-11 18:18:43)
git-committer:
Jiri Svoboda <jiri@…> (2018-04-12 12:57:20)
Message:

Use proper boolean constant in while loops.

Location:
uspace
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/mkdir/mkdir.c

    r9c514be r76d0981d  
    2727 */
    2828
     29#include <stdbool.h>
    2930#include <stdio.h>
    3031#include <stdlib.h>
     
    106107                /* Create the parent directories as well. */
    107108                size_t off = 0;
    108                 while (1) {
     109                while (true) {
    109110                        size_t prev_off = off;
    110111                        wchar_t cur_char = str_decode(path, &off, STR_NO_LIMIT);
  • uspace/app/mkbd/main.c

    r9c514be r76d0981d  
    171171        printf("Press <ESC> to quit the application.\n");
    172172
    173         while (1) {
     173        while (true) {
    174174                cons_event_t ev;
    175175                bool ok = console_get_event(con, &ev);
  • uspace/app/tetris/scores.c

    r9c514be r76d0981d  
    5959
    6060#include <errno.h>
     61#include <stdbool.h>
    6162#include <stdio.h>
    6263#include <str.h>
     
    138139            "........................................");
    139140
    140         while (1) {
     141        while (true) {
    141142                console_flush(console);
    142143                if (!console_get_event(console, &ev))
  • uspace/app/tetris/tetris.c

    r9c514be r76d0981d  
    5757#include <sys/time.h>
    5858#include <errno.h>
     59#include <stdbool.h>
    5960#include <stdio.h>
    6061#include <stdlib.h>
     
    200201{
    201202        tetris_menu_draw(*level);
    202         while (1) {
     203        while (true) {
    203204                int i = getchar();
    204205
     
    327328                scr_msg(key_msg, 1);
    328329
    329                 while (1) {
     330                while (true) {
    330331                        place(curshape, pos, 1);
    331332                        scr_update();
  • uspace/app/wavplay/dplay.c

    r9c514be r76d0981d  
    4444#include <sys/time.h>
    4545#include <inttypes.h>
    46 
     46#include <stdbool.h>
    4747#include <stdio.h>
    4848#include <macros.h>
     
    101101        playback_t *pb = arg;
    102102        const size_t fragment_size = pb->buffer.size / DEFAULT_FRAGMENTS;
    103         while (1) {
     103        while (true) {
    104104                ipc_call_t call;
    105105                cap_call_handle_t chandle = async_get_call(&call);
     
    260260        struct timeval time = { 0 };
    261261        getuptime(&time);
    262         do {
     262        while (true) {
    263263                size_t available = buffer_avail(pb, pos);
    264264                /* Writing might need wrap around the end,
     
    324324                        break;
    325325
    326         } while (1);
     326        }
    327327        audio_pcm_stop_playback_immediate(pb->device);
    328328}
  • uspace/dist/src/c/demos/tetris/scores.c

    r9c514be r76d0981d  
    6464#include <io/keycode.h>
    6565#include <vfs/vfs.h>
     66#include <stdbool.h>
    6667#include <stdlib.h>
    6768#include <err.h>
     
    139140            "........................................");
    140141
    141         while (1) {
     142        while (true) {
    142143                console_flush(console);
    143144                if (!console_get_event(console, &ev))
  • uspace/dist/src/c/demos/tetris/tetris.c

    r9c514be r76d0981d  
    5858#include <err.h>
    5959#include <errno.h>
     60#include <stdbool.h>
    6061#include <stdio.h>
    6162#include <stdlib.h>
     
    201202{
    202203        tetris_menu_draw(*level);
    203         while (1) {
     204        while (true) {
    204205                int i = getchar();
    205206
     
    326327                scr_msg(key_msg, 1);
    327328
    328                 while (1) {
     329                while (true) {
    329330                        place(curshape, pos, 1);
    330331                        scr_update();
  • uspace/drv/bus/usb/uhci/hc.c

    r9c514be r76d0981d  
    4444#include <macros.h>
    4545#include <mem.h>
     46#include <stdbool.h>
    4647#include <stdlib.h>
    4748#include <stdint.h>
     
    607608        instance->transfers_##queue.queue_head
    608609
    609         while (1) {
     610        while (true) {
    610611                const uint16_t cmd = pio_read_16(&instance->registers->usbcmd);
    611612                const uint16_t sts = pio_read_16(&instance->registers->usbsts);
  • uspace/drv/char/ski-con/ski-con.c

    r9c514be r76d0981d  
    134134        errno_t rc;
    135135
    136         while (1) {
    137                 while (1) {
     136        while (true) {
     137                while (true) {
    138138                        c = ski_con_getchar();
    139139                        if (c == 0)
  • uspace/drv/hid/ps2mouse/ps2mouse.c

    r9c514be r76d0981d  
    254254
    255255        bool buttons[PS2_BUTTON_COUNT] = {};
    256         while (1) {
     256        while (true) {
    257257                uint8_t packet[PS2_BUFSIZE] = {};
    258258                rc = ps2_mouse_read_packet(mouse, packet, PS2_BUFSIZE);
     
    306306
    307307        bool buttons[INTELLIMOUSE_BUTTON_COUNT] = {};
    308         while (1) {
     308        while (true) {
    309309                uint8_t packet[INTELLIMOUSE_BUFSIZE] = {};
    310310                rc = ps2_mouse_read_packet(mouse, packet, INTELLIMOUSE_BUFSIZE);
  • uspace/drv/hid/usbhid/mouse/mousedev.c

    r9c514be r76d0981d  
    4343#include <errno.h>
    4444#include <async.h>
     45#include <stdbool.h>
    4546#include <str_error.h>
    4647#include <ipc/mouseev.h>
     
    299300
    300301        /* Break from within. */
    301         while (1) {
     302        while (true) {
    302303                field = usb_hid_report_get_sibling(
    303304                    report, field, path,
  • uspace/drv/intctl/obio/obio.c

    r9c514be r76d0981d  
    8686        obio = (obio_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg));
    8787
    88         while (1) {
     88        while (true) {
    8989                int inr;
    9090
  • uspace/lib/c/generic/libc.c

    r9c514be r76d0981d  
    4343#include <errno.h>
    4444#include <libc.h>
     45#include <stdbool.h>
    4546#include <stdlib.h>
    4647#include <tls.h>
     
    138139
    139140        /* Unreachable */
    140         while (1)
     141        while (true)
    141142                ;
    142143}
     
    147148
    148149        /* Unreachable */
    149         while (1)
     150        while (true)
    150151                ;
    151152}
  • uspace/lib/c/generic/thread.c

    r9c514be r76d0981d  
    3535#include <thread.h>
    3636#include <libc.h>
     37#include <stdbool.h>
    3738#include <stdlib.h>
    3839#include <libarch/faddr.h>
     
    157158
    158159        /* Unreachable */
    159         while (1)
     160        while (true)
    160161                ;
    161162}
  • uspace/lib/ext4/src/balloc.c

    r9c514be r76d0981d  
    3636
    3737#include <errno.h>
     38#include <stdbool.h>
    3839#include <stdint.h>
    3940#include "ext4/balloc.h"
     
    274275                ibmap = -1;
    275276
    276         while (1) {
     277        while (true) {
    277278                if (r == bbmap || r == ibmap)
    278279                        r++;
  • uspace/lib/hound/src/protocol.c

    r9c514be r76d0981d  
    3939#include <macros.h>
    4040#include <str.h>
     41#include <stdbool.h>
    4142#include <stdlib.h>
    4243#include <stdio.h>
     
    401402        }
    402403
    403         while (1) {
     404        while (true) {
    404405                ipc_call_t call;
    405406                cap_call_handle_t chandle = async_get_call(&call);
  • uspace/lib/pcut/src/preproc.c

    r9c514be r76d0981d  
    2727 */
    2828
     29#include <stdbool.h>
    2930#include <stdio.h>
    3031#include <stdlib.h>
     
    109110        (void) argv;
    110111
    111         while (1) {
     112        while (true) {
    112113                int current_char_denotes_identifier;
    113114
  • uspace/lib/pcut/src/report/report.c

    r9c514be r76d0981d  
    3838#include <string.h>
    3939#endif
     40#include <stdbool.h>
    4041#include <stdio.h>
    4142
     
    110111        }
    111112
    112         while (1) {
     113        while (true) {
    113114                size_t message_length;
    114115
  • uspace/srv/audio/hound/audio_device.c

    r9c514be r76d0981d  
    4040#include <inttypes.h>
    4141#include <loc.h>
     42#include <stdbool.h>
    4243#include <str.h>
    4344#include <str_error.h>
     
    271272        audio_device_t *dev = arg;
    272273        assert(dev);
    273         while (1) {
     274        while (true) {
    274275                ipc_call_t call;
    275276                cap_call_handle_t chandle = async_get_call(&call);
  • uspace/srv/hid/input/gsp.c

    r9c514be r76d0981d  
    5151#include <adt/hash_table.h>
    5252#include <adt/hash.h>
     53#include <stdbool.h>
    5354#include <stdlib.h>
    5455#include <stdio.h>
     
    119120        dp = defs;
    120121
    121         while (1) {
     122        while (true) {
    122123                /* Read the output values. */
    123124                mods = *dp++;
Note: See TracChangeset for help on using the changeset viewer.