Changeset 1433ecda in mainline for uspace/dist


Ignore:
Timestamp:
2018-04-04T15:42:37Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2c4e1cc
Parents:
47b2d7e3
Message:

Fix cstyle: make ccheck-fix and commit only files where all the changes are good.

Location:
uspace/dist/src/c/demos
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/dist/src/c/demos/edit/search.c

    r47b2d7e3 r1433ecda  
    9191                        search->back_table[table_idx] = pattern_idx;
    9292                        table_idx++;
    93                 }
    94                 else if (pattern_idx > 0) {
     93                } else if (pattern_idx > 0) {
    9594                        pattern_idx = search->back_table[pattern_idx];
    96                 }
    97                 else {
     95                } else {
    9896                        pattern_idx = 0;
    9997                        table_idx++;
  • uspace/dist/src/c/demos/hello/hello.c

    r47b2d7e3 r1433ecda  
    33#define TERMINATOR '!'
    44
    5 int main(void) {
     5int main(void)
     6{
    67        /* Prints "hello" to the standard output. */
    78        putchar('h');
  • uspace/dist/src/c/demos/tetris/scores.c

    r47b2d7e3 r1433ecda  
    135135        off = 6;
    136136
    137         moveto(10 , 28);
    138         printf("%s%.*s", scores[NUMSPOTS - 1].hs_name, MAXLOGNAME-i,
     137        moveto(10, 28);
     138        printf("%s%.*s", scores[NUMSPOTS - 1].hs_name, MAXLOGNAME - i,
    139139            "........................................");
    140140
     
    191191
    192192        for (j = NUMSPOTS - 2; j > i; j--)
    193                 copyhiscore(j, j-1);
     193                copyhiscore(j, j - 1);
    194194
    195195        copyhiscore(i, NUMSPOTS - 1);
  • uspace/dist/src/c/demos/tetris/screen.c

    r47b2d7e3 r1433ecda  
    256256                        tc = t % B_COLS;
    257257
    258                         moveto(tr, 2*tc);
     258                        moveto(tr, 2 * tc);
    259259                        putstr("  ");
    260260                }
  • uspace/dist/src/c/demos/tetris/shapes.c

    r47b2d7e3 r1433ecda  
    6868
    6969const struct shape shapes[] = {
    70         /*  0 */  {  7,  7, { TL, TC, MR }, 0x00aaaa},
    71         /*  1 */  {  8,  8, { TC, TR, ML }, 0x00aa00},
    72         /*  2 */  {  9, 11, { ML, MR, BC }, 0xaa5500},
    73         /*  3 */  {  3,  3, { TL, TC, ML }, 0x0000aa},
    74         /*  4 */  { 12, 14, { ML, BL, MR }, 0xaa00aa},
    75         /*  5 */  { 15, 17, { ML, BR, MR }, 0xffa500},
    76         /*  6 */  { 18, 18, { ML, MR, 2  }, 0xaa0000},  /* sticks out */
    77         /*  7 */  {  0,  0, { TC, ML, BL }, 0x00aaaa},
    78         /*  8 */  {  1,  1, { TC, MR, BR }, 0x00aa00},
    79         /*  9 */  { 10,  2, { TC, MR, BC }, 0xaa5500},
    80         /* 10 */  { 11,  9, { TC, ML, MR }, 0xaa5500},
    81         /* 11 */  {  2, 10, { TC, ML, BC }, 0xaa5500},
    82         /* 12 */  { 13,  4, { TC, BC, BR }, 0xaa00aa},
    83         /* 13 */  { 14, 12, { TR, ML, MR }, 0xaa00aa},
    84         /* 14 */  {  4, 13, { TL, TC, BC }, 0xaa00aa},
    85         /* 15 */  { 16,  5, { TR, TC, BC }, 0xffa500},
    86         /* 16 */  { 17, 15, { TL, MR, ML }, 0xffa500},
    87         /* 17 */  {  5, 16, { TC, BC, BL }, 0xffa500},
    88         /* 18 */  {  6,  6, { TC, BC, 2 * B_COLS }, 0xaa0000}  /* sticks out */
     70        /*  0 */  {  7,  7, { TL, TC, MR }, 0x00aaaa },
     71        /*  1 */  {  8,  8, { TC, TR, ML }, 0x00aa00 },
     72        /*  2 */  {  9, 11, { ML, MR, BC }, 0xaa5500 },
     73        /*  3 */  {  3,  3, { TL, TC, ML }, 0x0000aa },
     74        /*  4 */  { 12, 14, { ML, BL, MR }, 0xaa00aa },
     75        /*  5 */  { 15, 17, { ML, BR, MR }, 0xffa500 },
     76        /*  6 */  { 18, 18, { ML, MR, 2  }, 0xaa0000 },  /* sticks out */
     77        /*  7 */  {  0,  0, { TC, ML, BL }, 0x00aaaa },
     78        /*  8 */  {  1,  1, { TC, MR, BR }, 0x00aa00 },
     79        /*  9 */  { 10,  2, { TC, MR, BC }, 0xaa5500 },
     80        /* 10 */  { 11,  9, { TC, ML, MR }, 0xaa5500 },
     81        /* 11 */  {  2, 10, { TC, ML, BC }, 0xaa5500 },
     82        /* 12 */  { 13,  4, { TC, BC, BR }, 0xaa00aa },
     83        /* 13 */  { 14, 12, { TR, ML, MR }, 0xaa00aa },
     84        /* 14 */  {  4, 13, { TL, TC, BC }, 0xaa00aa },
     85        /* 15 */  { 16,  5, { TR, TC, BC }, 0xffa500 },
     86        /* 16 */  { 17, 15, { TL, MR, ML }, 0xffa500 },
     87        /* 17 */  {  5, 16, { TC, BC, BL }, 0xffa500 },
     88        /* 18 */  {  6,  6, { TC, BC, 2 * B_COLS }, 0xaa0000 }  /* sticks out */
    8989};
    9090
  • uspace/dist/src/c/demos/tetris/tetris.c

    r47b2d7e3 r1433ecda  
    5252
    5353static volatile const char copyright[] =
    54         "@(#) Copyright (c) 1992, 1993\n"
    55         "\tThe Regents of the University of California.  All rights reserved.\n";
     54    "@(#) Copyright (c) 1992, 1993\n"
     55    "\tThe Regents of the University of California.  All rights reserved.\n";
    5656
    5757#include <sys/time.h>
     
    122122                                /* This row is to be elided */
    123123                                rows++;
    124                                 memset(&board[base], 0, sizeof(cell) * (B_COLS - 2));
     124                                memset(&board[base], 0, sizeof(cell) *(B_COLS - 2));
    125125
    126126                                scr_update();
     
    185185        printf("Level = %d (press keys 1 - 9 to change)", level);
    186186        moveto(9, 10);
    187         printf("Preview is %s (press 'p' to change)", (showpreview ? "on ": "off"));
     187        printf("Preview is %s (press 'p' to change)", (showpreview ? "on " : "off"));
    188188        moveto(12, 10);
    189189        printf("Press 'h' to show hiscore table.");
     
    204204                int i = getchar();
    205205
    206                 switch(i) {
    207                         case 'p':
    208                                 showpreview = !showpreview;
    209                                 moveto(9, 21);
    210                                 if (showpreview)
    211                                         printf("on ");
    212                                 else
    213                                         printf("off");
    214                                 break;
    215                         case 'h':
    216                                 loadscores();
    217                                 showscores(firstgame);
    218                                 tetris_menu_draw(*level);
    219                                 break;
    220                         case 's':
    221                                 firstgame = 0;
    222                                 return 1;
    223                         case 'q':
    224                                 return 0;
    225                         case '1':
    226                         case '2':
    227                         case '3':
    228                         case '4':
    229                         case '5':
    230                         case '6':
    231                         case '7':
    232                         case '8':
    233                         case '9':
    234                                 *level = i - '0';
    235                                 moveto(8, 18);
    236                                 printf("%d", *level);
    237                                 break;
     206                switch (i) {
     207                case 'p':
     208                        showpreview = !showpreview;
     209                        moveto(9, 21);
     210                        if (showpreview)
     211                                printf("on ");
     212                        else
     213                                printf("off");
     214                        break;
     215                case 'h':
     216                        loadscores();
     217                        showscores(firstgame);
     218                        tetris_menu_draw(*level);
     219                        break;
     220                case 's':
     221                        firstgame = 0;
     222                        return 1;
     223                case 'q':
     224                        return 0;
     225                case '1':
     226                case '2':
     227                case '3':
     228                case '4':
     229                case '5':
     230                case '6':
     231                case '7':
     232                case '8':
     233                case '9':
     234                        *level = i - '0';
     235                        moveto(8, 18);
     236                        printf("%d", *level);
     237                        break;
    238238                }
    239239        }
     
    259259
    260260        while ((ch = getopt(argc, argv, "ck:ps")) != -1)
    261                 switch(ch) {
     261                switch (ch) {
    262262                case 'c':
    263263                        /*
  • uspace/dist/src/c/demos/top/top.h

    r47b2d7e3 r1433ecda  
    8181
    8282typedef enum {
    83         FIELD_EMPTY, FIELD_UINT, FIELD_UINT_SUFFIX_BIN, FIELD_UINT_SUFFIX_DEC,
    84         FIELD_PERCENT, FIELD_STRING
     83        FIELD_EMPTY,
     84        FIELD_UINT,
     85        FIELD_UINT_SUFFIX_BIN,
     86        FIELD_UINT_SUFFIX_DEC,
     87        FIELD_PERCENT,
     88        FIELD_STRING
    8589} field_type_t;
    8690
Note: See TracChangeset for help on using the changeset viewer.