[ardour-dev] AMD64 type error? Patch

John Rigg ardev at sound-man.co.uk
Mon Jun 5 02:36:03 PDT 2006


On Mon, Jun 05, 2006 at 09:25:20AM +0100, John Rigg wrote:
> These are caused by comparisons of the following type:
> 
> 	uint32_t n = 1;
> 
> 	while (n < ULONG_MAX) {
> 
> On AMD64 ulong is 64 bits, not 32 as on x86. Changing it to UINT_MAX
> would work on both platforms.

Apologies if anyone gets this twice. None of the replies I've been
sending to the list have got through. Here's the patch again (for 0.99.3):

diff -uprN ardour-0.99.3.orig/libs/ardour/audio_track.cc ardour-0.99.3/libs/ardour/audio_track.cc
--- ardour-0.99.3.orig/libs/ardour/audio_track.cc	2006-01-03 02:10:46.000000000 +0000
+++ ardour-0.99.3/libs/ardour/audio_track.cc	2006-06-05 09:46:54.000000000 +0100
@@ -865,7 +865,7 @@ AudioTrack::freeze (InterThreadInfo& itt
 
 	uint32_t n = 1;
 
-	while (n < ULONG_MAX) {
+	while (n < UINT_MAX) {
 
 		string candidate;
 		
@@ -880,7 +880,7 @@ AudioTrack::freeze (InterThreadInfo& itt
 
 	} 
 
-	if (n == ULONG_MAX) {
+	if (n == UINT_MAX) {
 		error << compose (_("There are too many frozen versions of playlist \"%1\""
 				    " to create another one"), _freeze_record.playlist->name())
 		      << endmsg;
diff -uprN ardour-0.99.3.orig/libs/ardour/session.cc ardour-0.99.3/libs/ardour/session.cc
--- ardour-0.99.3.orig/libs/ardour/session.cc	2006-04-26 16:44:34.000000000 +0100
+++ ardour-0.99.3/libs/ardour/session.cc	2006-06-05 09:52:23.000000000 +0100
@@ -1677,7 +1677,7 @@ Session::new_audio_track (int input_chan
 		}
 		n++;
 
-	} while (n < ULONG_MAX);
+	} while (n < UINT_MAX);
 
 	if (input_auto_connect & AutoConnectPhysical) {
 		nphysical_in = n_physical_inputs;
@@ -1784,7 +1784,7 @@ Session::new_audio_route (int input_chan
 		}
 		n++;
 
-	} while (n < ULONG_MAX);
+	} while (n < UINT_MAX);
 
 	try {
 		bus = new Route (*this, bus_name, -1, -1, -1, -1);
@@ -2267,7 +2267,7 @@ Session::new_region_name (string old)
 
 	}
 
-	while (number < ULONG_MAX) {
+	while (number < UINT_MAX) {
 
 		AudioRegionList::const_iterator i;
 		string sbuf;
@@ -2288,7 +2288,7 @@ Session::new_region_name (string old)
 		}
 	}
 
-	if (number != ULONG_MAX) {
+	if (number != UINT_MAX) {
 		return buf;
 	} 
 



More information about the Ardour-Dev mailing list