Changeset c738d65 in mainline


Ignore:
Timestamp:
2007-01-15T22:11:24Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d7baee6
Parents:
d78d603
Message:

Improve formatting.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/as.c

    rd78d603 rc738d65  
    233233 * @return Address space area on success or NULL on failure.
    234234 */
    235 as_area_t *as_area_create(as_t *as, int flags, size_t size, uintptr_t base, int attrs,
     235as_area_t *
     236as_area_create(as_t *as, int flags, size_t size, uintptr_t base, int attrs,
    236237               mem_backend_t *backend, mem_backend_data_t *backend_data)
    237238{
  • uspace/console/console.c

    rd78d603 rc738d65  
    8787                                                 * with framebufer used for
    8888                                                 * faster virtual console
    89                                                  *switching */
     89                                                 * switching */
    9090
    9191static int kernel_pixmap = -1;  /**< Number of fb pixmap, where kernel
     
    9898static int find_free_connection(void)
    9999{
    100         int i = 0;
    101        
    102         for (i=0; i < CONSOLE_COUNT; i++) {
     100        int i;
     101       
     102        for (i = 0; i < CONSOLE_COUNT; i++) {
    103103                if (!connections[i].used)
    104104                        return i;
     
    149149        switch (key) {
    150150        case '\n':
    151                 scr->position_y += 1;
    152                 scr->position_x =  0;
     151                scr->position_y++;
     152                scr->position_x = 0;
    153153                break;
    154154        case '\r':
     
    179179                scr->position_y = scr->size_y - 1;
    180180                screenbuffer_clear_line(scr, scr->top_line);
    181                 scr->top_line = (scr->top_line+1) % scr->size_y;
     181                scr->top_line = (scr->top_line + 1) % scr->size_y;
    182182                if (console == active_console)
    183183                        async_msg(fb_info.phone, FB_SCROLL, 1);
     
    264264                for (i = 0; i < conn->screenbuffer.size_x; i++)
    265265                        for (j = 0; j < conn->screenbuffer.size_y; j++)
    266                                 interbuffer[i + j * conn->screenbuffer.size_x]
    267                                         = *get_field_at(&(conn->screenbuffer),
     266                                interbuffer[i + j * conn->screenbuffer.size_x] =
     267                                        *get_field_at(&(conn->screenbuffer),
    268268                                        i, j);
    269269                /* This call can preempt, but we are already at the end */
     
    389389       
    390390        /* Accept the connection */
    391         ipc_answer_fast(iid,0,0,0);
     391        ipc_answer_fast(iid, 0, 0, 0);
    392392
    393393        while (1) {
     
    442442                        arg1 = IPC_GET_ARG1(call);
    443443                        arg2 = IPC_GET_ARG2(call);
    444                         screenbuffer_set_style(&conn->screenbuffer,arg1, arg2);
     444                        screenbuffer_set_style(&conn->screenbuffer, arg1, arg2);
    445445                        if (consnum == active_console)
    446446                                set_style_col(arg1, arg2);
     
    485485        /* Connect to keyboard driver */
    486486
    487         while ((kbd_phone = ipc_connect_me_to(PHONE_NS, SERVICE_KEYBOARD, 0))
    488                 < 0) {
     487        kbd_phone = ipc_connect_me_to(PHONE_NS, SERVICE_KEYBOARD, 0);
     488        while (kbd_phone < 0) {
    489489                usleep(10000);
     490                kbd_phone = ipc_connect_me_to(PHONE_NS, SERVICE_KEYBOARD, 0);
    490491        }
    491492       
    492493        if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, &phonehash) != 0)
    493                 {
    494494                return -1;
    495         }
    496495        async_new_connection(phonehash, 0, NULL, keyboard_events);
    497496       
    498497        /* Connect to framebuffer driver */
    499498       
    500         while ((fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0))
    501                 < 0) {
     499        fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0);
     500        while (fb_info.phone < 0) {
    502501                usleep(10000);
     502                fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0);
    503503        }
    504504       
     
    511511        async_req(fb_info.phone, FB_FLUSH, 0, NULL);
    512512        /* Enable double buffering */
    513         async_msg_2(fb_info.phone, FB_VIEWPORT_DB, (sysarg_t)-1, 1);
     513        async_msg_2(fb_info.phone, FB_VIEWPORT_DB, (sysarg_t) -1, 1);
    514514       
    515515        async_req_2(fb_info.phone, FB_GET_CSIZE, 0, 0, &(fb_info.rows),
     
    530530                if (screenbuffer_init(&(connections[i].screenbuffer),
    531531                        fb_info.cols, fb_info.rows) == NULL) {
    532                         /*FIXME: handle error */
     532                        /* FIXME: handle error */
    533533                        return -1;
    534534                }
     
    536536        connections[KERNEL_CONSOLE].used = 1;
    537537       
    538         if ((interbuffer = mmap(NULL, sizeof(keyfield_t) * fb_info.cols *
    539                 fb_info.rows, PROTO_READ | PROTO_WRITE, MAP_ANONYMOUS |
    540                 MAP_PRIVATE, 0, 0)) != NULL) {
     538        interbuffer = mmap(NULL,
     539                sizeof(keyfield_t) * fb_info.cols * fb_info.rows,
     540                PROTO_READ | PROTO_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
     541        if (!interbuffer) {
    541542                if (async_req_3(fb_info.phone, IPC_M_AS_AREA_SEND, (ipcarg_t)
    542543                        interbuffer, 0, AS_AREA_READ, NULL, NULL, NULL) != 0) {
     
    547548        }
    548549
    549         curs_goto(0,0);
     550        curs_goto(0, 0);
    550551        curs_visibility(connections[active_console].screenbuffer.is_cursor_visible);
    551552
  • uspace/console/console.h

    rd78d603 rc738d65  
    5050
    5151#endif
    52 
    5352 
    5453/** @}
    5554 */
    56 
  • uspace/console/gcons.h

    rd78d603 rc738d65  
    4949/** @}
    5050 */
    51 
  • uspace/console/screenbuffer.c

    rd78d603 rc738d65  
    3737#include <unistd.h>
    3838
    39 /** Store one character to screenbuffer. Its position is determined by scr->position_x and scr->position_y.
     39/** Store one character to screenbuffer. Its position is determined by
     40 * scr->position_x and scr->position_y.
     41 *
    4042 * @param scr   screenbuffer
    4143 * @param c     stored character
     
    5961screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, int size_x, int size_y)
    6062{
    61         if ((scr->buffer = (keyfield_t *)malloc(sizeof(keyfield_t) * size_x * size_y)) == NULL) {
     63        scr->buffer = (keyfield_t *) malloc(sizeof(keyfield_t) * size_x * size_y);
     64        if (!scr->buffer) {
    6265                return NULL;
    6366        }
     
    100103       
    101104        for (i = 0; i < scr->size_x; i++) {
    102                 scr->buffer[i + line*scr->size_x].character = ' ';
    103                 scr->buffer[i + line*scr->size_x].style = scr->style;
     105                scr->buffer[i + line * scr->size_x].character = ' ';
     106                scr->buffer[i + line * scr->size_x].style = scr->style;
    104107        }
    105108}
     
    143146/** @}
    144147 */
    145 
Note: See TracChangeset for help on using the changeset viewer.