View Issue Details

IDProjectCategoryView StatusLast Update
0002305ardourotherpublic2011-08-16 11:16
Reportercolinf Assigned Topaul  
PrioritynormalSeveritytrivialReproducibilityN/A
Status closedResolutionfixed 
Product VersionSVN/2.0-ongoing 
Summary0002305: Use sizeof(Sample) consistently
DescriptionA couple of places in libs/ardour/session.cc use 4 rather than explicitly using sizeof(Sample). Here's a trivial patch to make these consistent with the rest of the file.
TagsNo tags attached.

Activities

2008-06-18 15:44

 

sizeof-sample.patch (1,143 bytes)   
Index: libs/ardour/session.cc
===================================================================
--- libs/ardour/session.cc	(revision 3470)
+++ libs/ardour/session.cc	(working copy)
@@ -3731,7 +3731,7 @@
 #ifdef NO_POSIX_MEMALIGN
 		p =  (Sample *) malloc(current_block_size * sizeof(Sample));
 #else
-		if (posix_memalign((void **)&p,CPU_CACHE_ALIGN,current_block_size * 4) != 0) {
+		if (posix_memalign((void **)&p,CPU_CACHE_ALIGN,current_block_size * sizeof(Sample)) != 0) {
 			fatal << string_compose (_("Memory allocation error: posix_memalign (%1 * %2) failed (%3)"),
 						 current_block_size, sizeof (Sample), strerror (errno))
 			      << endmsg;
@@ -4131,7 +4131,7 @@
 #ifdef NO_POSIX_MEMALIGN
 			p =  (Sample *) malloc(current_block_size * sizeof(Sample));
 #else
-			if (posix_memalign((void **)&p,CPU_CACHE_ALIGN,current_block_size * 4) != 0) {
+			if (posix_memalign((void **)&p,CPU_CACHE_ALIGN,current_block_size * sizeof(Sample)) != 0) {
 				fatal << string_compose (_("Memory allocation error: posix_memalign (%1 * %2) failed (%3)"),
 							 current_block_size, sizeof (Sample), strerror (errno))
 				      << endmsg;
sizeof-sample.patch (1,143 bytes)   

paul

2008-06-18 16:16

administrator   ~0005044

applied and committed, thanks.

Issue History

Date Modified Username Field Change
2008-06-18 15:44 colinf New Issue
2008-06-18 15:44 colinf File Added: sizeof-sample.patch
2008-06-18 16:16 paul cost => 0.00
2008-06-18 16:16 paul Status new => resolved
2008-06-18 16:16 paul Resolution open => fixed
2008-06-18 16:16 paul Assigned To => paul
2008-06-18 16:16 paul Note Added: 0005044
2011-08-16 11:16 colinf Status resolved => closed