static void write_palette(const char *key, QObject *obj, void *opaque)

{

    struct palette_cb_priv *priv = opaque;

    VncState *vs = priv->vs;

    uint32_t bytes = vs->clientds.pf.bytes_per_pixel;

    uint8_t idx = qint_get_int(qobject_to_qint(obj));



    if (bytes == 4) {

        uint32_t color = tight_palette_buf2rgb(32, (uint8_t *)key);



        ((uint32_t*)priv->header)[idx] = color;

    } else {

        uint16_t color = tight_palette_buf2rgb(16, (uint8_t *)key);



        ((uint16_t*)priv->header)[idx] = color;

    }

}

static void write_palette(const char *key, QObject *obj, void *opaque)

{

    struct palette_cb_priv *priv = opaque;

    VncState *vs = priv->vs;

    uint32_t bytes = vs->clientds.pf.bytes_per_pixel;

    uint8_t idx = qint_get_int(qobject_to_qint(obj));



    if (bytes == 4) {

        uint32_t color = tight_palette_buf2rgb(32, (uint8_t *)key);



        ((uint32_t*)priv->header)[idx] = color;

    } else {

        uint16_t color = tight_palette_buf2rgb(16, (uint8_t *)key);



        ((uint16_t*)priv->header)[idx] = color;

    }

}

static void FUNC_0(const char *VAR_0, QObject *VAR_1, void *VAR_2)

{

    struct palette_cb_priv *VAR_3 = VAR_2;

    VncState *vs = VAR_3->vs;

    uint32_t bytes = vs->clientds.pf.bytes_per_pixel;

    uint8_t idx = qint_get_int(qobject_to_qint(VAR_1));



    if (bytes == 4) {

        uint32_t color = tight_palette_buf2rgb(32, (uint8_t *)VAR_0);



        ((uint32_t*)VAR_3->header)[idx] = color;

    } else {

        uint16_t color = tight_palette_buf2rgb(16, (uint8_t *)VAR_0);



        ((uint16_t*)VAR_3->header)[idx] = color;

    }

}

static void FUNC_0(const char *VAR_0, QObject *VAR_1, void *VAR_2)
{ struct palette_cb_priv *VAR_3 = VAR_2; VncState *vs = VAR_3->vs; uint32_t bytes = vs->clientds.pf.bytes_per_pixel; uint8_t idx = qint_get_int(qobject_to_qint(VAR_1)); if (bytes == 4) { uint32_t color = tight_palette_buf2rgb(32, (uint8_t *)VAR_0); ((uint32_t*)VAR_3->header)[idx] = color; } else { uint16_t color = tight_palette_buf2rgb(16, (uint8_t *)VAR_0); ((uint16_t*)VAR_3->header)[idx] = color; } }