[2/2] Revert "libavutil: Use an intermediate variable in AV_COPY*U"

Message ID 1470132746-31487-2-git-send-email-martin@martin.st
State Committed
Commit fc94a1acc27ab7296edce3fa81ef36691af5c134
Headers show

Commit Message

Martin Storsjö Aug. 2, 2016, 10:12 a.m.
This reverts commit 014773b66bdff4de24f384066d1a85d2a5bb6774.

Since 230b1c070, the bytewise AV_W*() macros only expand their
argument once, i.e. doing exactly the same change as was done
in the AV_COPY*U macros, so this change is no longer necessary.
---
 libavutil/intreadwrite.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Diego Biurrun Aug. 2, 2016, 10:22 a.m. | #1
On Tue, Aug 02, 2016 at 01:12:26PM +0300, Martin Storsjö wrote:
> This reverts commit 014773b66bdff4de24f384066d1a85d2a5bb6774.
> 
> Since 230b1c070, the bytewise AV_W*() macros only expand their
> argument once, i.e. doing exactly the same change as was done
> in the AV_COPY*U macros, so this change is no longer necessary.
> ---
>  libavutil/intreadwrite.h | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)

OK

Diego

Patch

diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h
index 32747b2..fdb91d6 100644
--- a/libavutil/intreadwrite.h
+++ b/libavutil/intreadwrite.h
@@ -478,11 +478,7 @@  union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
  * memory locations.
  */
 
-#define AV_COPYU(n, d, s)                                       \
-    do {                                                        \
-        uint##n##_t val = AV_RN##n(s);                          \
-        AV_WN##n(d, val);                                       \
-    } while (0)
+#define AV_COPYU(n, d, s) AV_WN##n(d, AV_RN##n(s));
 
 #ifndef AV_COPY16U
 #   define AV_COPY16U(d, s) AV_COPYU(16, d, s)