From c444ccbe6eeeb0386dfad76a90299f86437e75db Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 10 Jan 2017 10:23:49 +0100 Subject: [PATCH] Removed duplicated format variable. --- include/freerdp/codec/nsc.h | 1 - libfreerdp/codec/clear.c | 3 ++- libfreerdp/codec/nsc.c | 4 +++- libfreerdp/codec/nsc_encode.c | 2 +- libfreerdp/codec/nsc_sse2.c | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/freerdp/codec/nsc.h b/include/freerdp/codec/nsc.h index cab0e0a2e..21e575ad2 100644 --- a/include/freerdp/codec/nsc.h +++ b/include/freerdp/codec/nsc.h @@ -67,7 +67,6 @@ struct _NSC_CONTEXT UINT16 height; BYTE* BitmapData; UINT32 BitmapDataLength; - UINT32 pixel_format; BYTE* Planes; UINT32 PlaneByteCount[4]; diff --git a/libfreerdp/codec/clear.c b/libfreerdp/codec/clear.c index 14656a222..ea0b4b43f 100644 --- a/libfreerdp/codec/clear.c +++ b/libfreerdp/codec/clear.c @@ -932,7 +932,8 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if ((nWidth * nHeight) > glyphEntry->count) { - WLog_ERR(TAG, "(nWidth %"PRIu32" * nHeight %"PRIu32") > glyphEntry->count %"PRIu32"", nWidth, nHeight, + WLog_ERR(TAG, "(nWidth %"PRIu32" * nHeight %"PRIu32") > glyphEntry->count %"PRIu32"", nWidth, + nHeight, glyphEntry->count); return FALSE; } diff --git a/libfreerdp/codec/nsc.c b/libfreerdp/codec/nsc.c index fb13a1511..d0ec4209b 100644 --- a/libfreerdp/codec/nsc.c +++ b/libfreerdp/codec/nsc.c @@ -337,7 +337,9 @@ void nsc_context_free(NSC_CONTEXT* context) BOOL nsc_context_set_pixel_format(NSC_CONTEXT* context, UINT32 pixel_format) { - context->pixel_format = pixel_format; + if (!context) + return FALSE; + context->format = pixel_format; return TRUE; } diff --git a/libfreerdp/codec/nsc_encode.c b/libfreerdp/codec/nsc_encode.c index 28b02efda..d3e54a665 100644 --- a/libfreerdp/codec/nsc_encode.c +++ b/libfreerdp/codec/nsc_encode.c @@ -124,7 +124,7 @@ static void nsc_encode_argb_to_aycocg(NSC_CONTEXT* context, const BYTE* data, for (x = 0; x < context->width; x++) { - switch (context->pixel_format) + switch (context->format) { case PIXEL_FORMAT_BGRX32: b_val = *src++; diff --git a/libfreerdp/codec/nsc_sse2.c b/libfreerdp/codec/nsc_sse2.c index c0e0879a3..007c7f19f 100644 --- a/libfreerdp/codec/nsc_sse2.c +++ b/libfreerdp/codec/nsc_sse2.c @@ -74,7 +74,7 @@ static void nsc_encode_argb_to_aycocg_sse2(NSC_CONTEXT* context, for (x = 0; x < context->width; x += 8) { - switch (context->pixel_format) + switch (context->format) { case PIXEL_FORMAT_BGRX32: b_val = _mm_set_epi16(*(src + 28), *(src + 24), *(src + 20), *(src + 16),