[cstream] Remove double variable assignment

Hans Ulrich Niedermann ndim at fedoraproject.org
Fri Sep 10 15:16:32 UTC 2010


commit 98f95b86b0c609d969c6f4c5c37377dfb497eed3
Author: Hans Ulrich Niedermann <hun at n-dimensional.de>
Date:   Fri Sep 10 17:01:03 2010 +0200

    Remove double variable assignment
    
    An assignment of the form "a = a = 23;" causes a compiler
    warning in F14 and rawhide. As there should be no
    difference between assigning the value once or twice,
    we now just do "a = 23;" instead.

 cstream-2.7.6-double-assignment.patch |   12 ++++++++++++
 cstream.spec                          |    2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/cstream-2.7.6-double-assignment.patch b/cstream-2.7.6-double-assignment.patch
new file mode 100644
index 0000000..79e735a
--- /dev/null
+++ b/cstream-2.7.6-double-assignment.patch
@@ -0,0 +1,12 @@
+diff -ru cstream-2.7.6/cstream.c cstream-2.7.6-ndim/cstream.c
+--- cstream-2.7.6/cstream.c	2010-09-09 22:28:20.748308391 +0200
++++ cstream-2.7.6-ndim/cstream.c	2010-09-09 22:30:15.809288769 +0200
+@@ -1195,7 +1195,7 @@
+ 	  exit(1);
+ 	}
+ 
+-	state->b = state->b = frames * 2 * 2; /* 16 bit Stereo */
++	state->b = frames * 2 * 2; /* 16 bit Stereo */
+ 	for (i = 0; i < frames; i++) {
+ 	  val = sin((double)i * 2.0 * pi / (double)frames) * 32767.0;
+ 	  buf[i * 4] = buf[i * 4 + 2] = val % 256;
diff --git a/cstream.spec b/cstream.spec
index c8a684b..be942a4 100644
--- a/cstream.spec
+++ b/cstream.spec
@@ -8,6 +8,7 @@ License:   MIT
 URL:       http://www.cons.org/cracauer/cstream.html
 Source:    http://www.cons.org/cracauer/download/%{name}-%{version}.tar.gz
 Patch2:    %{name}-%{version}-Wextra.patch
+Patch3:    %{name}-%{version}-double-assignment.patch
 
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
@@ -24,6 +25,7 @@ Data limits and throughput rate calculation will work for files > 4 GB.
 %prep
 %setup -q
 %patch2 -p1 -b .Wextra
+%patch3 -p1 -b .double-assignment
 
 
 %build


More information about the scm-commits mailing list