Changeset 76d0981d in mainline


Ignore:
Timestamp:
2018-04-12T12:57:20Z (6 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.

Files:
31 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/userspace.c

    r9c514be r76d0981d  
    3636#include <arch/cpu.h>
    3737#include <arch/pm.h>
     38#include <stdbool.h>
    3839#include <stdint.h>
    3940#include <arch.h>
     
    7576
    7677        /* Unreachable */
    77         while (1);
     78        while (true);
    7879}
    7980
  • kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c

    r9c514be r76d0981d  
    4444#include <mm/km.h>
    4545#include <ddi/ddi.h>
     46#include <stdbool.h>
    4647
    4748static void bbxm_init(void);
     
    130131static void bbxm_cpu_halt(void)
    131132{
    132         while (1)
     133        while (true)
    133134                ;
    134135}
  • kernel/arch/arm32/src/mach/beaglebone/beaglebone.c

    r9c514be r76d0981d  
    4747#include <ddi/ddi.h>
    4848#include <mm/km.h>
     49#include <stdbool.h>
    4950
    5051#define BBONE_MEMORY_START       0x80000000      /* physical */
     
    159160static void bbone_cpu_halt(void)
    160161{
    161         while (1)
     162        while (true)
    162163                ;
    163164}
  • kernel/arch/arm32/src/mach/integratorcp/integratorcp.c

    r9c514be r76d0981d  
    4242#include <genarch/srln/srln.h>
    4343#include <console/console.h>
     44#include <stdbool.h>
    4445#include <sysinfo/sysinfo.h>
    4546#include <mm/page.h>
     
    244245void icp_cpu_halt(void)
    245246{
    246         while (1);
     247        while (true);
    247248}
    248249
  • kernel/arch/arm32/src/mach/raspberrypi/raspberrypi.c

    r9c514be r76d0981d  
    4747#include <abi/fb/visuals.h>
    4848#include <genarch/srln/srln.h>
     49#include <stdbool.h>
    4950#include <sysinfo/sysinfo.h>
    5051#include <interrupt.h>
     
    128129static void raspberrypi_cpu_halt(void)
    129130{
    130         while (1) ;
     131        while (true) ;
    131132}
    132133
  • kernel/arch/arm32/src/userspace.c

    r9c514be r76d0981d  
    3434 */
    3535
     36#include <stdbool.h>
    3637#include <userspace.h>
    3738#include <arch/ras.h>
     
    114115
    115116        /* unreachable */
    116         while (1)
     117        while (true)
    117118                ;
    118119}
  • kernel/arch/ia32/src/userspace.c

    r9c514be r76d0981d  
    3535#include <userspace.h>
    3636#include <arch/pm.h>
     37#include <stdbool.h>
    3738#include <stdint.h>
    3839#include <arch.h>
     
    7980
    8081        /* Unreachable */
    81         while (1);
     82        while (true);
    8283}
    8384
  • kernel/arch/ia64/src/ia64.c

    r9c514be r76d0981d  
    4040#include <arch/interrupt.h>
    4141#include <macros.h>
     42#include <stdbool.h>
    4243#include <str.h>
    4344#include <userspace.h>
     
    252253            (uintptr_t) kernel_uarg->uspace_uarg, psr.value, rsc.value);
    253254
    254         while (1);
     255        while (true);
    255256}
    256257
     
    258259{
    259260        pio_write_8((ioport8_t *)0x64, 0xfe);
    260         while (1);
     261        while (true);
    261262}
    262263
  • kernel/arch/mips32/src/mips32.c

    r9c514be r76d0981d  
    4242#include <mem.h>
    4343#include <userspace.h>
     44#include <stdbool.h>
    4445#include <syscall/syscall.h>
    4546#include <sysinfo/sysinfo.h>
     
    172173            (uintptr_t) kernel_uarg->uspace_entry);
    173174
    174         while (1)
     175        while (true)
    175176                ;
    176177}
     
    195196{
    196197        ___halt();
    197         while (1)
     198        while (true)
    198199                ;
    199200}
  • kernel/arch/sparc64/src/sun4u/sparc64.c

    r9c514be r76d0981d  
    5050#include <userspace.h>
    5151#include <ddi/irq.h>
     52#include <stdbool.h>
    5253#include <str.h>
    5354#include <sysinfo/sysinfo.h>
     
    169170
    170171        /* Not reached */
    171         while (1)
     172        while (true)
    172173                ;
    173174}
     
    176177{
    177178        // TODO
    178         while (1)
     179        while (true)
    179180                ;
    180181}
  • kernel/arch/sparc64/src/sun4v/sparc64.c

    r9c514be r76d0981d  
    5151#include <userspace.h>
    5252#include <ddi/irq.h>
     53#include <stdbool.h>
    5354#include <str.h>
    5455#include <arch/drivers/niagara.h>
     
    167168
    168169        /* Not reached */
    169         while (1)
     170        while (true)
    170171                ;
    171172}
     
    174175{
    175176        // TODO
    176         while (1)
     177        while (true)
    177178                ;
    178179}
  • 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.