static void framebuffer_update_request(VncState *vs, int incremental,

				       int x_position, int y_position,

				       int w, int h)

{

    if (x_position > ds_get_width(vs->ds))

        x_position = ds_get_width(vs->ds);

    if (y_position > ds_get_height(vs->ds))

        y_position = ds_get_height(vs->ds);

    if (x_position + w >= ds_get_width(vs->ds))

        w = ds_get_width(vs->ds)  - x_position;

    if (y_position + h >= ds_get_height(vs->ds))

        h = ds_get_height(vs->ds) - y_position;



    int i;

    vs->need_update = 1;

    if (!incremental) {

	char *old_row = vs->old_data + y_position * ds_get_linesize(vs->ds);



	for (i = 0; i < h; i++) {

            vnc_set_bits(vs->dirty_row[y_position + i],

                         (ds_get_width(vs->ds) / 16), VNC_DIRTY_WORDS);

	    memset(old_row, 42, ds_get_width(vs->ds) * vs->depth);

	    old_row += ds_get_linesize(vs->ds);

	}

    }

}

static void framebuffer_update_request(VncState *vs, int incremental,

				       int x_position, int y_position,

				       int w, int h)

{

    if (x_position > ds_get_width(vs->ds))

        x_position = ds_get_width(vs->ds);

    if (y_position > ds_get_height(vs->ds))

        y_position = ds_get_height(vs->ds);

    if (x_position + w >= ds_get_width(vs->ds))

        w = ds_get_width(vs->ds)  - x_position;

    if (y_position + h >= ds_get_height(vs->ds))

        h = ds_get_height(vs->ds) - y_position;



    int i;

    vs->need_update = 1;

    if (!incremental) {

	char *old_row = vs->old_data + y_position * ds_get_linesize(vs->ds);



	for (i = 0; i < h; i++) {

            vnc_set_bits(vs->dirty_row[y_position + i],

                         (ds_get_width(vs->ds) / 16), VNC_DIRTY_WORDS);

	    memset(old_row, 42, ds_get_width(vs->ds) * vs->depth);

	    old_row += ds_get_linesize(vs->ds);

	}

    }

}

	    memset(old_row, 42, ds_get_width(vs->ds) * vs->depth);
static void FUNC_0(VncState *VAR_0, int VAR_1,

				       int VAR_2, int VAR_3,

				       int VAR_4, int VAR_5)

{

    if (VAR_2 > ds_get_width(VAR_0->ds))

        VAR_2 = ds_get_width(VAR_0->ds);

    if (VAR_3 > ds_get_height(VAR_0->ds))

        VAR_3 = ds_get_height(VAR_0->ds);

    if (VAR_2 + VAR_4 >= ds_get_width(VAR_0->ds))

        VAR_4 = ds_get_width(VAR_0->ds)  - VAR_2;

    if (VAR_3 + VAR_5 >= ds_get_height(VAR_0->ds))

        VAR_5 = ds_get_height(VAR_0->ds) - VAR_3;



    int VAR_6;

    VAR_0->need_update = 1;

    if (!VAR_1) {

	char *VAR_7 = VAR_0->old_data + VAR_3 * ds_get_linesize(VAR_0->ds);



	for (VAR_6 = 0; VAR_6 < VAR_5; VAR_6++) {

            vnc_set_bits(VAR_0->dirty_row[VAR_3 + VAR_6],

                         (ds_get_width(VAR_0->ds) / 16), VNC_DIRTY_WORDS);

	    memset(VAR_7, 42, ds_get_width(VAR_0->ds) * VAR_0->depth);

	    VAR_7 += ds_get_linesize(VAR_0->ds);

	}

    }

}

static void FUNC_0(VncState *VAR_0, int VAR_1,
int VAR_2, int VAR_3,
int VAR_4, int VAR_5)
{ if (VAR_2 > ds_get_width(VAR_0->ds))
VAR_2 = ds_get_width(VAR_0->ds); if (VAR_3 > ds_get_height(VAR_0->ds))
VAR_3 = ds_get_height(VAR_0->ds); if (VAR_2 + VAR_4 >= ds_get_width(VAR_0->ds))
VAR_4 = ds_get_width(VAR_0->ds)  - VAR_2; if (VAR_3 + VAR_5 >= ds_get_height(VAR_0->ds))
VAR_5 = ds_get_height(VAR_0->ds) - VAR_3; int VAR_6; VAR_0->need_update = 1; if (!VAR_1) { char *VAR_7 = VAR_0->old_data + VAR_3 * ds_get_linesize(VAR_0->ds); for (VAR_6 = 0; VAR_6 < VAR_5; VAR_6++) { vnc_set_bits(VAR_0->dirty_row[VAR_3 + VAR_6],
(ds_get_width(VAR_0->ds) / 16), VNC_DIRTY_WORDS); memset(VAR_7, 42, ds_get_width(VAR_0->ds) * VAR_0->depth); VAR_7 += ds_get_linesize(VAR_0->ds); } } }