Changeset 904b1bc in mainline for uspace/app


Ignore:
Timestamp:
2018-05-22T10:36:58Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a4eb3ba2
Parents:
4f8772d4
git-author:
Jiri Svoboda <jiri@…> (2018-05-21 17:36:30)
git-committer:
Jiri Svoboda <jiri@…> (2018-05-22 10:36:58)
Message:

Fix remaining ccheck issues.

Location:
uspace/app
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkfat/fat.h

    r4f8772d4 r904b1bc  
    5151
    5252typedef struct fat_bs {
    53         uint8_t         ji[3];          /**< Jump instruction. */
     53        /** Jump instruction */
     54        uint8_t         ji[3];
    5455        uint8_t         oem_name[8];
     56
    5557        /* BIOS Parameter Block */
    56         uint16_t        bps;            /**< Bytes per sector. */
    57         uint8_t         spc;            /**< Sectors per cluster. */
    58         uint16_t        rscnt;          /**< Reserved sector count. */
    59         uint8_t         fatcnt;         /**< Number of FATs. */
    60         uint16_t        root_ent_max;   /**< Maximum number of root directory
    61                                              entries. */
    62         uint16_t        totsec16;       /**< Total sectors. 16-bit version. */
    63         uint8_t         mdesc;          /**< Media descriptor. */
    64         uint16_t        sec_per_fat;    /**< Sectors per FAT12/FAT16. */
    65         uint16_t        sec_per_track;  /**< Sectors per track. */
    66         uint16_t        headcnt;        /**< Number of heads. */
    67         uint32_t        hidden_sec;     /**< Hidden sectors. */
    68         uint32_t        totsec32;       /**< Total sectors. 32-bit version. */
     58
     59        /** Bytes per sector */
     60        uint16_t        bps;
     61        /** Sectors per cluster */
     62        uint8_t         spc;
     63        /** Reserved sector count */
     64        uint16_t        rscnt;
     65        /** Number of FATs */
     66        uint8_t         fatcnt;
     67        /** Maximum number of root directory entries */
     68        uint16_t        root_ent_max;
     69        /** Total sectors. 16-bit version */
     70        uint16_t        totsec16;
     71        /** Media descriptor */
     72        uint8_t         mdesc;
     73        /** Sectors per FAT12/FAT16 */
     74        uint16_t        sec_per_fat;
     75        /** Sectors per track */
     76        uint16_t        sec_per_track;
     77        /** Number of heads */
     78        uint16_t        headcnt;
     79        /** Hidden sectors */
     80        uint32_t        hidden_sec;
     81        /** Total sectors. 32-bit version */
     82        uint32_t        totsec32;
    6983
    7084        union {
  • uspace/app/mkmfs/mkmfs.c

    r4f8772d4 r904b1bc  
    9898
    9999static struct option const long_options[] = {
    100                 { "help", no_argument, 0, 'h' },
    101                 { "long-names", no_argument, 0, 'l' },
    102                 { "block-size", required_argument, 0, 'b' },
    103                 { "inodes", required_argument, 0, 'i' },
    104                 { NULL, no_argument, 0, '1' },
    105                 { NULL, no_argument, 0, '2' },
    106                 { 0, 0, 0, 0 }
     100        { "help", no_argument, 0, 'h' },
     101        { "long-names", no_argument, 0, 'l' },
     102        { "block-size", required_argument, 0, 'b' },
     103        { "inodes", required_argument, 0, 'i' },
     104        { NULL, no_argument, 0, '1' },
     105        { NULL, no_argument, 0, '2' },
     106        { 0, 0, 0, 0 }
    107107};
    108108
     
    495495
    496496                if (sb->fs_version == 3) {
    497                         if(INT32_MAX / sb->block_size < zones)
     497                        if (INT32_MAX / sb->block_size < zones)
    498498                                sb->max_file_size = INT32_MAX;
    499499                        sb->ino_per_block = V3_INODES_PER_BLOCK(sb->block_size);
     
    730730{
    731731        if (level == HELP_SHORT) {
    732                 printf(NAME": tool to create new Minix file systems\n");
     732                printf(NAME ": tool to create new Minix file systems\n");
    733733        } else {
    734734                printf("Usage: [options] device\n"
     
    737737                    "-b ##      Specify the block size in bytes (V3 only),\n"
    738738                    "           valid block size values are 1024, 2048 and"
    739                                 " 4096 bytes per block\n"
     739                    /* ...   */ " 4096 bytes per block\n"
    740740                    "-i ##      Specify the number of inodes"
    741                                 " for the filesystem\n"
     741                    /* ...   */ " for the filesystem\n"
    742742                    "-l         Use 30-char long filenames (V1/V2 only)\n");
    743743        }
  • uspace/app/sbi/src/builtin/bi_error.c

    r4f8772d4 r904b1bc  
    4848
    4949        builtin_code_snippet(bi,
    50                 "class Error is\n"
    51                         /* Common ancestor of all error classes */
    52                         "class Base is\n"
    53                         "end\n"
    54                         /* Accessing nil reference */
    55                         "class NilReference : Base is\n"
    56                         "end\n"
    57                         /* Array index out of bounds */
    58                         "class OutOfBounds : Base is\n"
    59                         "end\n"
    60                 "end\n");}
     50            "class Error is\n"
     51            "    -- Common ancestor of all error classes\n"
     52            "    class Base is\n"
     53            "    end\n"
     54            "    -- Accessing nil reference\n"
     55            "    class NilReference : Base is\n"
     56            "    end\n"
     57            "    -- Array index out of bounds\n"
     58            "    class OutOfBounds : Base is\n"
     59            "    end\n"
     60            "end\n");
     61}
    6162
    6263/** Bind error class hierarchy.
  • uspace/app/sbi/src/builtin/bi_textfile.c

    r4f8772d4 r904b1bc  
    6262
    6363        builtin_code_snippet(bi,
    64                 "class TextFile is\n"
    65                         "var f : resource;\n"
    66                         "\n"
    67                         "fun OpenRead(fname : string), builtin;\n"
    68                         "fun OpenWrite(fname : string), builtin;\n"
    69                         "fun Close(), builtin;\n"
    70                         "fun ReadLine() : string, builtin;\n"
    71                         "fun WriteLine(line : string), builtin;\n"
    72                         "\n"
    73                         "prop EOF : bool is\n"
    74                                 "get is\n"
    75                                         "return is_eof();\n"
    76                                 "end\n"
    77                         "end\n"
    78                         "\n"
    79                         "fun is_eof() : bool, builtin;\n"
    80                 "end\n");
     64            "class TextFile is\n"
     65            "    var f : resource;\n"
     66            "\n"
     67            "    fun OpenRead(fname : string), builtin;\n"
     68            "    fun OpenWrite(fname : string), builtin;\n"
     69            "    fun Close(), builtin;\n"
     70            "    fun ReadLine() : string, builtin;\n"
     71            "    fun WriteLine(line : string), builtin;\n"
     72            "\n"
     73            "    prop EOF : bool is\n"
     74            "        get is\n"
     75            "            return is_eof();\n"
     76            "        end\n"
     77            "    end\n"
     78            "\n"
     79            "    fun is_eof() : bool, builtin;\n"
     80            "end\n");
    8181
    8282}
     
    189189{
    190190        FILE *file;
    191         rdata_var_t *self_f_var;
     191        rdata_var_t *self_f_var;
    192192        run_proc_ar_t *proc_ar;
    193193
     
    227227{
    228228        FILE *file;
    229         rdata_var_t *self_f_var;
     229        rdata_var_t *self_f_var;
    230230
    231231        rdata_string_t *str;
     
    297297{
    298298        FILE *file;
    299         rdata_var_t *self_f_var;
     299        rdata_var_t *self_f_var;
    300300        rdata_var_t *line_var;
    301301        const char *line;
     
    340340{
    341341        FILE *file;
    342         rdata_var_t *self_f_var;
     342        rdata_var_t *self_f_var;
    343343
    344344        bool_t eof_flag;
  • uspace/app/trace/syscalls.c

    r4f8772d4 r904b1bc  
    3838
    3939const sc_desc_t syscall_desc[] = {
    40     [SYS_KIO] ={ "kio",                                 3,      V_INT_ERRNO },
     40        [SYS_KIO] = { "kio", 3, V_INT_ERRNO },
    4141
    42     [SYS_THREAD_CREATE] = { "thread_create",            3,      V_ERRNO },
    43     [SYS_THREAD_EXIT] = { "thread_exit",                1,      V_ERRNO },
    44     [SYS_THREAD_GET_ID] = { "thread_get_id",            1,      V_ERRNO },
     42        [SYS_THREAD_CREATE] = { "thread_create", 3, V_ERRNO },
     43        [SYS_THREAD_EXIT] = { "thread_exit", 1, V_ERRNO },
     44        [SYS_THREAD_GET_ID] = { "thread_get_id", 1, V_ERRNO },
    4545
    46     [SYS_TASK_GET_ID] = { "task_get_id",                1,      V_ERRNO },
    47     [SYS_TASK_SET_NAME] = { "task_set_name",            2,      V_ERRNO },
    48     [SYS_FUTEX_SLEEP] = { "futex_sleep_timeout",        3,      V_ERRNO },
    49     [SYS_FUTEX_WAKEUP] = { "futex_wakeup",              1,      V_ERRNO },
     46        [SYS_TASK_GET_ID] = { "task_get_id", 1, V_ERRNO },
     47        [SYS_TASK_SET_NAME] = { "task_set_name", 2, V_ERRNO },
     48        [SYS_FUTEX_SLEEP] = { "futex_sleep_timeout", 3, V_ERRNO },
     49        [SYS_FUTEX_WAKEUP] = { "futex_wakeup", 1, V_ERRNO },
    5050
    51     [SYS_AS_AREA_CREATE] = { "as_area_create",          5,      V_ERRNO },
    52     [SYS_AS_AREA_RESIZE] = { "as_area_resize",          3,      V_ERRNO },
    53     [SYS_AS_AREA_DESTROY] = { "as_area_destroy",        1,      V_ERRNO },
     51        [SYS_AS_AREA_CREATE] = { "as_area_create", 5, V_ERRNO },
     52        [SYS_AS_AREA_RESIZE] = { "as_area_resize", 3, V_ERRNO },
     53        [SYS_AS_AREA_DESTROY] = { "as_area_destroy", 1, V_ERRNO },
    5454
    55     [SYS_IPC_CALL_ASYNC_FAST] = { "ipc_call_async_fast", 6,     V_HASH },
    56     [SYS_IPC_CALL_ASYNC_SLOW] = { "ipc_call_async_slow", 3,     V_HASH },
     55        [SYS_IPC_CALL_ASYNC_FAST] = { "ipc_call_async_fast", 6, V_HASH },
     56        [SYS_IPC_CALL_ASYNC_SLOW] = { "ipc_call_async_slow", 3, V_HASH },
    5757
    58     [SYS_IPC_ANSWER_FAST] = { "ipc_answer_fast",        6,      V_ERRNO },
    59     [SYS_IPC_ANSWER_SLOW] = { "ipc_answer_slow",        2,      V_ERRNO },
    60     [SYS_IPC_FORWARD_FAST] = { "ipc_forward_fast",      6,      V_ERRNO },
    61     [SYS_IPC_FORWARD_SLOW] = { "ipc_forward_slow",      3,      V_ERRNO },
    62     [SYS_IPC_WAIT] = { "ipc_wait_for_call",             3,      V_HASH },
    63     [SYS_IPC_POKE] = { "ipc_poke",                      0,      V_ERRNO },
    64     [SYS_IPC_HANGUP] = { "ipc_hangup",                  1,      V_ERRNO },
     58        [SYS_IPC_ANSWER_FAST] = { "ipc_answer_fast", 6, V_ERRNO },
     59        [SYS_IPC_ANSWER_SLOW] = { "ipc_answer_slow", 2, V_ERRNO },
     60        [SYS_IPC_FORWARD_FAST] = { "ipc_forward_fast", 6, V_ERRNO },
     61        [SYS_IPC_FORWARD_SLOW] = { "ipc_forward_slow", 3, V_ERRNO },
     62        [SYS_IPC_WAIT] = { "ipc_wait_for_call", 3, V_HASH },
     63        [SYS_IPC_POKE] = { "ipc_poke", 0, V_ERRNO },
     64        [SYS_IPC_HANGUP] = { "ipc_hangup", 1, V_ERRNO },
    6565
    66     [SYS_IPC_EVENT_SUBSCRIBE] = { "ipc_event_subscribe",        2,      V_ERRNO },
    67     [SYS_IPC_EVENT_UNSUBSCRIBE] = { "ipc_event_unsubscribe",    1,      V_ERRNO },
    68     [SYS_IPC_EVENT_UNMASK] = { "ipc_event_unmask",      1,      V_ERRNO },
     66        [SYS_IPC_EVENT_SUBSCRIBE] = { "ipc_event_subscribe", 2, V_ERRNO },
     67        [SYS_IPC_EVENT_UNSUBSCRIBE] = { "ipc_event_unsubscribe", 1, V_ERRNO },
     68        [SYS_IPC_EVENT_UNMASK] = { "ipc_event_unmask", 1, V_ERRNO },
    6969
    70     [SYS_PERM_GRANT] = { "perm_grant",                  2,      V_ERRNO },
    71     [SYS_PERM_REVOKE] = { "perm_revoke",                2,      V_ERRNO },
    72     [SYS_PHYSMEM_MAP] = { "physmem_map",                4,      V_ERRNO },
    73     [SYS_IOSPACE_ENABLE] = { "iospace_enable",          1,      V_ERRNO },
     70        [SYS_PERM_GRANT] = { "perm_grant", 2, V_ERRNO },
     71        [SYS_PERM_REVOKE] = { "perm_revoke", 2, V_ERRNO },
     72        [SYS_PHYSMEM_MAP] = { "physmem_map", 4, V_ERRNO },
     73        [SYS_IOSPACE_ENABLE] = { "iospace_enable", 1, V_ERRNO },
    7474
    75     [SYS_IPC_IRQ_SUBSCRIBE] = { "ipc_irq_subscribe",    4,      V_ERRNO },
    76     [SYS_IPC_IRQ_UNSUBSCRIBE] = { "ipc_irq_unsubscribe",        2,      V_ERRNO },
     75        [SYS_IPC_IRQ_SUBSCRIBE] = { "ipc_irq_subscribe", 4, V_ERRNO },
     76        [SYS_IPC_IRQ_UNSUBSCRIBE] = { "ipc_irq_unsubscribe", 2, V_ERRNO },
    7777
    78     [SYS_SYSINFO_GET_VAL_TYPE] = { "sysinfo_get_val_type",              2,      V_INTEGER },
    79     [SYS_SYSINFO_GET_VALUE] = { "sysinfo_get_value",            3,      V_ERRNO },
    80     [SYS_SYSINFO_GET_DATA_SIZE] = { "sysinfo_get_data_size",    3,      V_ERRNO },
    81     [SYS_SYSINFO_GET_DATA] = { "sysinfo_get_data",              5,      V_ERRNO },
     78        [SYS_SYSINFO_GET_VAL_TYPE] = { "sysinfo_get_val_type", 2, V_INTEGER },
     79        [SYS_SYSINFO_GET_VALUE] = { "sysinfo_get_value", 3, V_ERRNO },
     80        [SYS_SYSINFO_GET_DATA_SIZE] = { "sysinfo_get_data_size", 3, V_ERRNO },
     81        [SYS_SYSINFO_GET_DATA] = { "sysinfo_get_data", 5, V_ERRNO },
    8282
    83     [SYS_DEBUG_CONSOLE] = { "debug_console", 0, V_ERRNO },
    84     [SYS_IPC_CONNECT_KBOX] = { "ipc_connect_kbox",      1,      V_ERRNO }
     83        [SYS_DEBUG_CONSOLE] = { "debug_console", 0, V_ERRNO },
     84        [SYS_IPC_CONNECT_KBOX] = { "ipc_connect_kbox", 1, V_ERRNO }
    8585};
    8686
  • uspace/app/vuhid/hids/bootkbd.c

    r4f8772d4 r904b1bc  
    4545        USAGE1(USB_HIDUT_USAGE_GENERIC_DESKTOP_KEYBOARD),
    4646        START_COLLECTION(COLLECTION_APPLICATION),
    47                 STD_USAGE_PAGE(USB_HIDUT_PAGE_KEYBOARD),
    48                 USAGE_MINIMUM1(224),
    49                 USAGE_MAXIMUM1(231),
    50                 LOGICAL_MINIMUM1(0),
    51                 LOGICAL_MAXIMUM1(1),
    52                 REPORT_SIZE1(1),
    53                 REPORT_COUNT1(8),
    54                 /* Modifiers */
    55                 INPUT(IOF_DATA | IOF_VARIABLE | IOF_ABSOLUTE),
    56                 REPORT_COUNT1(1),
    57                 REPORT_SIZE1(8),
    58                 /* Reserved */
    59                 INPUT(IOF_CONSTANT),
    60                 REPORT_COUNT1(5),
    61                 REPORT_SIZE1(1),
    62                 STD_USAGE_PAGE(USB_HIDUT_PAGE_LED),
    63                 USAGE_MINIMUM1(1),
    64                 USAGE_MAXIMUM1(5),
    65                 /* LED states */
    66                 OUTPUT(IOF_DATA | IOF_VARIABLE | IOF_ABSOLUTE),
    67                 REPORT_COUNT1(1),
    68                 REPORT_SIZE1(3),
    69                 /* LED states padding */
    70                 OUTPUT(IOF_CONSTANT),
    71                 REPORT_COUNT1(6),
    72                 REPORT_SIZE1(8),
    73                 LOGICAL_MINIMUM1(0),
    74                 LOGICAL_MAXIMUM1(101),
    75                 STD_USAGE_PAGE(USB_HIDUT_PAGE_KEYBOARD),
    76                 USAGE_MINIMUM1(0),
    77                 USAGE_MAXIMUM1(101),
    78                 /* Key array */
    79                 INPUT(IOF_DATA | IOF_ARRAY),
     47
     48        STD_USAGE_PAGE(USB_HIDUT_PAGE_KEYBOARD),
     49        USAGE_MINIMUM1(224),
     50        USAGE_MAXIMUM1(231),
     51        LOGICAL_MINIMUM1(0),
     52        LOGICAL_MAXIMUM1(1),
     53        REPORT_SIZE1(1),
     54        REPORT_COUNT1(8),
     55        /* Modifiers */
     56        INPUT(IOF_DATA | IOF_VARIABLE | IOF_ABSOLUTE),
     57        REPORT_COUNT1(1),
     58        REPORT_SIZE1(8),
     59        /* Reserved */
     60        INPUT(IOF_CONSTANT),
     61        REPORT_COUNT1(5),
     62        REPORT_SIZE1(1),
     63        STD_USAGE_PAGE(USB_HIDUT_PAGE_LED),
     64        USAGE_MINIMUM1(1),
     65        USAGE_MAXIMUM1(5),
     66        /* LED states */
     67        OUTPUT(IOF_DATA | IOF_VARIABLE | IOF_ABSOLUTE),
     68        REPORT_COUNT1(1),
     69        REPORT_SIZE1(3),
     70        /* LED states padding */
     71        OUTPUT(IOF_CONSTANT),
     72        REPORT_COUNT1(6),
     73        REPORT_SIZE1(8),
     74        LOGICAL_MINIMUM1(0),
     75        LOGICAL_MAXIMUM1(101),
     76        STD_USAGE_PAGE(USB_HIDUT_PAGE_KEYBOARD),
     77        USAGE_MINIMUM1(0),
     78        USAGE_MAXIMUM1(101),
     79        /* Key array */
     80        INPUT(IOF_DATA | IOF_ARRAY),
     81
    8082        END_COLLECTION()
    8183};
     
    8486
    8587static uint8_t in_data[] = {
    86              0, 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    87              0, 0, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, // Caps Lock
    88              0, 0, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, // Num Lock
    89              0, 0, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, // Caps Lock
     88        0,      0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     89        0,      0, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, // Caps Lock
     90        0,      0, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, // Num Lock
     91        0,      0, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, // Caps Lock
    9092        1 << 2, 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    9193        1 << 2, 0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00,
    9294        1 << 2, 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    93              0, 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
     95        0,      0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    9496};
    9597static vuhid_interface_life_t boot_life = {
    9698        .data_in = in_data,
    97         .data_in_count = sizeof(in_data)/INPUT_SIZE,
     99        .data_in_count = sizeof(in_data) / INPUT_SIZE,
    98100        .data_in_pos_change_delay = 500,
    99101        .msg_born = "Boot keyboard comes to life...",
Note: See TracChangeset for help on using the changeset viewer.