Skip to contentSkip to conversation

conga/ricci common/File.cpp common/Variable.cp ...

Cluster-devel [email protected] 1 participant 1 message Mar 14, 2008

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2008-03-14 20:06:39

Modified files:
ricci/common : File.cpp Variable.cpp utils.cpp
ricci/include : shred_allocator.h

Log message:
Fixes for building with gcc 4.3.0

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/File.cpp.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/Variable.cpp.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/utils.cpp.diff?cvsroot=cluster&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/shred_allocator.h.diff?cvsroot=cluster&r1=1.5&r2=1.6

ricci/common/File.cpp +5 -5
@@ -139,17 +139,17 @@
 	MutexLocker l(*_mutex);
 
 	long len = size();
-	const auto_ptr<char> buff(new char[len]);
+	char buff[len];
 	try {
 		((fstream *) _pimpl->fs)->seekg(0, ios::beg);
 		check_failed();
-		((fstream *) _pimpl->fs)->read(buff.get(), len);
+		((fstream *) _pimpl->fs)->read(buff, len);
 		check_failed();
-		String ret(buff.get(), len);
-		::shred(buff.get(), len);
+		String ret(buff, len);
+		::shred(buff, len);
 		return ret;
 	} catch ( ... ) {
-		::shred(buff.get(), len);
+		::shred(buff, len);
 		throw;
 	}
 }
ricci/common/Variable.cpp +2 -0
@@ -26,6 +26,8 @@
 
 #include <stdio.h>
 
+#include <vector>
+#include <algorithm>
 using namespace std;
 
 // ##### class Variable #####
ricci/common/utils.cpp +1 -0
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <math.h>
 #include <errno.h>
+#include <limits.h>
 #include <openssl/md5.h>
 
 //#include <iostream>
ricci/include/shred_allocator.h +6 -0
@@ -33,6 +33,12 @@
 #ifndef __CONGA_SHRED_ALLOCATOR_H
 #define __CONGA_SHRED_ALLOCATOR_H
 
+extern "C" {
+	#include <unistd.h>
+	#include <stdlib.h>
+	#include <string.h>
+}
+
 #include <new>
 
 template<typename _Tp>