Skip to content

Commit

Permalink
Merge pull request #257 from matt335672/remove_unused_vars
Browse files Browse the repository at this point in the history
Remove unused funcs and member variables
  • Loading branch information
matt335672 committed May 29, 2023
2 parents abf9f04 + d30814f commit bf49ee1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 143 deletions.
1 change: 0 additions & 1 deletion module/rdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ struct _rdpRec
int sendUpdateScheduled; /* boolean */
OsTimerPtr sendUpdateTimer;

int do_dirty_os; /* boolean */
int do_dirty_ons; /* boolean */
int disconnect_scheduled; /* boolean */
int do_kill_disconnected; /* boolean */
Expand Down
138 changes: 1 addition & 137 deletions module/rdpClientCon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2346,14 +2346,7 @@ rdpClientConDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg)
{
if (dev->do_dirty_ons)
{
if (clientCon->rectId == clientCon->rectIdAck)
{
rdpClientConCheckDirtyScreen(dev, clientCon);
}
else
{
LLOGLN(0, ("rdpClientConDeferredUpdateCallback: skipping"));
}
rdpClientConCheckDirtyScreen(dev, clientCon);
}
else
{
Expand Down Expand Up @@ -2751,135 +2744,6 @@ rdpClientConGetScreenImageRect(rdpPtr dev, rdpClientCon *clientCon,
id->shmem_lineBytes = clientCon->shmem_lineBytes;
}

/******************************************************************************/
void
rdpClientConGetPixmapImageRect(rdpPtr dev, rdpClientCon *clientCon,
PixmapPtr pPixmap, struct image_data *id)
{
id->width = pPixmap->drawable.width;
id->height = pPixmap->drawable.height;
id->bpp = clientCon->rdp_bpp;
id->Bpp = clientCon->rdp_Bpp;
id->lineBytes = pPixmap->devKind;
id->pixels = (uint8_t *)(pPixmap->devPrivate.ptr);
id->shmem_pixels = 0;
id->shmem_id = 0;
id->shmem_offset = 0;
id->shmem_lineBytes = 0;
}

/******************************************************************************/
void
rdpClientConSendArea(rdpPtr dev, rdpClientCon *clientCon,
struct image_data *id, int x, int y, int w, int h)
{
struct image_data lid;
BoxRec box;
int ly;
int size;
const uint8_t *src;
uint8_t *dst;
struct stream *s;

LLOGLN(10, ("rdpClientConSendArea: id %p x %d y %d w %d h %d", id, x, y, w, h));

if (id == NULL)
{
rdpClientConGetScreenImageRect(dev, clientCon, &lid);
id = &lid;
}

if (x >= id->width)
{
return;
}

if (y >= id->height)
{
return;
}

if (x < 0)
{
w += x;
x = 0;
}

if (y < 0)
{
h += y;
y = 0;
}

if (w <= 0)
{
return;
}

if (h <= 0)
{
return;
}

if (x + w > id->width)
{
w = id->width - x;
}

if (y + h > id->height)
{
h = id->height - y;
}

if (clientCon->connected && clientCon->begin)
{
if (id->shmem_pixels != 0)
{
LLOGLN(10, ("rdpClientConSendArea: using shmem"));
box.x1 = x;
box.y1 = y;
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
src = id->pixels;
src += y * id->lineBytes;
src += x * dev->Bpp;
dst = id->shmem_pixels + id->shmem_offset;
dst += y * id->shmem_lineBytes;
dst += x * clientCon->rdp_Bpp;
ly = y;
while (ly < y + h)
{
rdpClientConConvertPixels(dev, clientCon, src, dst, w);
src += id->lineBytes;
dst += id->shmem_lineBytes;
ly += 1;
}
size = 36;
rdpClientConPreCheck(dev, clientCon, size);
s = clientCon->out_s;
out_uint16_le(s, 60);
out_uint16_le(s, size);
clientCon->count++;
LLOGLN(10, ("rdpClientConSendArea: 2 x %d y %d w %d h %d", x, y, w, h));
out_uint16_le(s, x);
out_uint16_le(s, y);
out_uint16_le(s, w);
out_uint16_le(s, h);
out_uint32_le(s, 0);
clientCon->rect_id++;
out_uint32_le(s, clientCon->rect_id);
out_uint32_le(s, id->shmem_id);
out_uint32_le(s, id->shmem_offset);
out_uint16_le(s, id->width);
out_uint16_le(s, id->height);
out_uint16_le(s, x);
out_uint16_le(s, y);
rdpRegionUnionRect(clientCon->shmRegion, &box);
return;
}
}
}

/******************************************************************************/
int
rdpClientConAddAllReg(rdpPtr dev, RegionPtr reg, DrawablePtr pDrawable)
Expand Down
5 changes: 0 additions & 5 deletions module/rdpClientCon.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ struct _rdpClientCon
struct stream *out_s;
struct stream *in_s;

int rectIdAck;
int rectId;
int connected; /* boolean. Set to False when I/O fails */
int begin; /* boolean */
int count;
Expand Down Expand Up @@ -137,9 +135,6 @@ extern _X_EXPORT int
rdpClientConEndUpdate(rdpPtr dev, rdpClientCon *clientCon);
extern _X_EXPORT int
rdpClientConSetFgcolor(rdpPtr dev, rdpClientCon *clientCon, int fgcolor);
extern _X_EXPORT void
rdpClientConSendArea(rdpPtr dev, rdpClientCon *clientCon,
struct image_data *id, int x, int y, int w, int h);
extern _X_EXPORT int
rdpClientConFillRect(rdpPtr dev, rdpClientCon *clientCon,
short x, short y, int cx, int cy);
Expand Down

0 comments on commit bf49ee1

Please sign in to comment.