From dd0217f372650e0d04c1e6b5a8f74e975fb30ef7 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 4 Apr 2019 15:45:52 +0200 Subject: [PATCH] Remove in_skip() in favour of in_uint8s() It was barely used and it was confusing having two macros doing the same thing. Standardise on the more common variant. --- rdpedisp.c | 2 +- stream.h | 1 - tests/resize_test.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/rdpedisp.c b/rdpedisp.c index fa5c7a2..746034b 100644 --- a/rdpedisp.c +++ b/rdpedisp.c @@ -64,7 +64,7 @@ rdpedisp_process_pdu(STREAM s) /* Read DISPLAYCONTROL_HEADER */ in_uint32_le(s, type); /* type */ - in_skip(s, 4); /* length */ + in_uint8s(s, 4); /* length */ logger(Protocol, Debug, "rdpedisp_process_pdu(), Got PDU type %d", type); diff --git a/stream.h b/stream.h index c0cd6ee..228b648 100644 --- a/stream.h +++ b/stream.h @@ -123,7 +123,6 @@ size_t in_ansi_string(STREAM s, char *string, size_t len); #define in_uint8p(s,v,n) { s_assert_r(s, n); v = (s)->p; (s)->p += n; } #define in_uint8a(s,v,n) { s_assert_r(s, n); memcpy(v,(s)->p,n); (s)->p += n; } #define in_uint8s(s,n) { s_assert_r(s, n); (s)->p += n; } -#define in_skip(s,n) in_uint8s(s,n) #define out_uint8(s,v) { s_assert_w(s, 1); *((s)->p++) = v; } #define out_uint8p(s,v,n) { s_assert_w(s, n); memcpy((s)->p,v,n); (s)->p += n; } #define out_uint8a(s,v,n) out_uint8p(s,v,n); diff --git a/tests/resize_test.c b/tests/resize_test.c index 80da9b8..973d1fc 100644 --- a/tests/resize_test.c +++ b/tests/resize_test.c @@ -433,7 +433,7 @@ void get_width_and_height_from_mcs_connect_initial(int *width, int *height) /* Rewind and extract the requested session size */ s_reset(s); - in_skip(s, 31); + in_uint8s(s, 31); in_uint16_le(s, *width); /* desktopWidth */ in_uint16_le(s, *height); /* desktopHeight */