VirtualBox

Changeset 38803 in vbox


Ignore:
Timestamp:
Sep 20, 2011 12:07:20 PM (13 years ago)
Author:
vboxsync
Message:

DevVGA.cpp: Fixed warnings on windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r37770 r38803  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4545*******************************************************************************/
    4646
    47 /* WARNING!!! All defines that affetc VGAState should be placed to DevVGA.h !!!
     47/* WARNING!!! All defines that affect VGAState should be placed to DevVGA.h !!!
    4848 *            NEVER place them here as this would lead to VGAState inconsistency
    4949 *            across different .cpp files !!!
     
    109109#include <VBox/vmm/pgm.h>
    110110#ifdef IN_RING3
    111 #include <iprt/alloc.h>
    112 #include <iprt/ctype.h>
     111# include <iprt/alloc.h>
     112# include <iprt/ctype.h>
    113113#endif /* IN_RING3 */
    114114#include <iprt/assert.h>
     
    15051505
    15061506/* return true if the palette was modified */
    1507 static int update_palette16(VGAState *s)
    1508 {
    1509     int full_update, i;
     1507static bool update_palette16(VGAState *s)
     1508{
     1509    bool full_update = false;
     1510    int i;
    15101511    uint32_t v, col, *palette;
    15111512
    1512     full_update = 0;
    15131513    palette = s->last_palette;
    15141514    for(i = 0; i < 16; i++) {
     
    15231523                              c6_to_8(s->palette[v + 2]));
    15241524        if (col != palette[i]) {
    1525             full_update = 1;
     1525            full_update = true;
    15261526            palette[i] = col;
    15271527        }
     
    15311531
    15321532/* return true if the palette was modified */
    1533 static int update_palette256(VGAState *s)
    1534 {
    1535     int full_update, i;
     1533static bool update_palette256(VGAState *s)
     1534{
     1535    bool full_update = false;
     1536    int i;
    15361537    uint32_t v, col, *palette;
    15371538    int wide_dac;
    15381539
    1539     full_update = 0;
    15401540    palette = s->last_palette;
    15411541    v = 0;
     
    15521552                                  c6_to_8(s->palette[v + 2]));
    15531553        if (col != palette[i]) {
    1554             full_update = 1;
     1554            full_update = true;
    15551555            palette[i] = col;
    15561556        }
     
    15971597
    15981598/* update start_addr and line_offset. Return TRUE if modified */
    1599 static int update_basic_params(VGAState *s)
    1600 {
    1601     int full_update;
     1599static bool update_basic_params(VGAState *s)
     1600{
     1601    bool full_update = false;
    16021602    uint32_t start_addr, line_offset, line_compare;
    1603 
    1604     full_update = 0;
    16051603
    16061604    s->get_offsets(s, &line_offset, &start_addr, &line_compare);
     
    16121610        s->start_addr = start_addr;
    16131611        s->line_compare = line_compare;
    1614         full_update = 1;
     1612        full_update = true;
    16151613    }
    16161614    return full_update;
     
    16781676 * - flashing
    16791677 */
    1680 static int vga_draw_text(VGAState *s, int full_update, bool fFailOnResize, bool reset_dirty)
     1678static int vga_draw_text(VGAState *s, bool full_update, bool fFailOnResize, bool reset_dirty)
    16811679{
    16821680    int cx, cy, cheight, cw, ch, cattr, height, width, ch_attr;
     
    17001698    if (offset != s->font_offsets[0]) {
    17011699        s->font_offsets[0] = offset;
    1702         full_update = 1;
     1700        full_update = true;
    17031701    }
    17041702    font_base[0] = s->CTX_SUFF(vram_ptr) + offset;
     
    17081706    if (offset != s->font_offsets[1]) {
    17091707        s->font_offsets[1] = offset;
    1710         full_update = 1;
     1708        full_update = true;
    17111709    }
    17121710    if (s->plane_updated & (1 << 2)) {
     
    17141712           indicates the font may have been modified */
    17151713        s->plane_updated = 0;
    1716         full_update = 1;
     1714        full_update = true;
    17171715    }
    17181716    full_update |= update_basic_params(s);
     
    17621760        s->last_ch = cheight;
    17631761        s->last_cw = cw;
    1764         full_update = 1;
     1762        full_update = true;
    17651763        if (rc == VINF_VGA_RESIZE_IN_PROGRESS)
    17661764            return rc;
     
    20602058 * graphic modes
    20612059 */
    2062 static int vga_draw_graphic(VGAState *s, int full_update, bool fFailOnResize, bool reset_dirty)
    2063 {
    2064     int y1, y2, y, update, page_min, page_max, linesize, y_start, double_scan;
     2060static int vga_draw_graphic(VGAState *s, bool full_update, bool fFailOnResize, bool reset_dirty)
     2061{
     2062    int y1, y2, y, page_min, page_max, linesize, y_start, double_scan;
    20652063    int width, height, shift_control, line_offset, page0, page1, bwidth, bits;
    20662064    int disp_width, multi_run;
     
    20682066    uint32_t v, addr1, addr;
    20692067    vga_draw_line_func *vga_draw_line;
    2070     int offsets_changed;
    2071 
    2072     offsets_changed = update_basic_params(s);
     2068
     2069    bool offsets_changed = update_basic_params(s);
    20732070
    20742071    full_update |= offsets_changed;
     
    20822079    if (shift_control != s->shift_control ||
    20832080        double_scan != s->double_scan) {
    2084         full_update = 1;
     2081        full_update = true;
    20852082        s->shift_control = shift_control;
    20862083        s->double_scan = double_scan;
     
    21492146        if (rc != VINF_SUCCESS)  /* Return any rc, particularly VINF_VGA_RESIZE_IN_PROGRESS, to the caller. */
    21502147            return rc;
    2151         full_update = 1;
     2148        full_update = true;
    21522149    }
    21532150    vga_draw_line = vga_draw_line_table[v * 4 + get_depth_index(s->pDrv->cBits)];
     
    21842181        page0 = addr & TARGET_PAGE_MASK;
    21852182        page1 = (addr + bwidth - 1) & TARGET_PAGE_MASK;
    2186         update = full_update | vga_is_dirty(s, page0) | vga_is_dirty(s, page1);
     2183        bool update = full_update | vga_is_dirty(s, page0) | vga_is_dirty(s, page1);
    21872184        if (page1 - page0 > TARGET_PAGE_SIZE) {
    21882185            /* if wide line, can use another page */
     
    22762273{
    22772274    int rc = VINF_SUCCESS;
    2278     int full_update, graphic_mode;
     2275    int graphic_mode;
    22792276
    22802277    if (s->pDrv->cBits == 0) {
     
    23432340        }
    23442341
    2345         full_update = 0;
    23462342        if (!(s->ar_index & 0x20) || (s->sr[0x01] & 0x20)) {
    23472343            graphic_mode = GMODE_BLANK;
     
    23492345            graphic_mode = s->gr[6] & 1;
    23502346        }
    2351         if (graphic_mode != s->graphic_mode) {
     2347        bool full_update = graphic_mode != s->graphic_mode;
     2348        if (full_update) {
    23522349            s->graphic_mode = graphic_mode;
    2353             full_update = 1;
    23542350        }
    23552351        switch(graphic_mode) {
     
    48974893
    48984894    cbPixelSrc = (s->get_bpp(s) + 7) / 8;
    4899     s->get_offsets (s, &cbLineSrc, &u32OffsetSrc, &u32Dummy);
     4895    s->get_offsets(s, &cbLineSrc, &u32OffsetSrc, &u32Dummy);
    49004896
    49014897    /* Assume that rendering is performed only on visible part of VRAM.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette