rpms/igraph/F-8 igraph-cstdlib.patch,NONE,1.1
Neal Becker (nbecker)
fedora-extras-commits at redhat.com
Sat Feb 16 00:20:58 UTC 2008
Author: nbecker
Update of /cvs/pkgs/rpms/igraph/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv857
Added Files:
igraph-cstdlib.patch
Log Message:
patch for gcc-4.3
igraph-cstdlib.patch:
--- NEW FILE igraph-cstdlib.patch ---
diff --git a/src/walktrap_graph.cpp b/src/walktrap_graph.cpp
--- a/src/walktrap_graph.cpp
+++ b/src/walktrap_graph.cpp
@@ -28,6 +28,9 @@
#include <iostream>
#include <fstream>
#include <sstream>
+#include <cstdlib> // exit
+#include <cstring> // strlen
+#include <algorithm> // sort
#include "walktrap_graph.h"
using namespace std;
@@ -144,7 +147,7 @@
for(int i = 0; i < G.nb_vertices; i++) {
if(G.vertices[i].degree == 0) {
cerr << "error : degree of vertex " << i << " is 0" << endl;
- exit(0);
+ std::exit(0);
}
G.vertices[i].edges = new Edge[G.vertices[i].degree + 1];
G.vertices[i].edges[0].neighbor = i;
@@ -163,7 +166,7 @@
}
for(int i = 0; i < G.nb_vertices; i++)
- sort(G.vertices[i].edges, G.vertices[i].edges+G.vertices[i].degree);
+ std::sort(G.vertices[i].edges, G.vertices[i].edges+G.vertices[i].degree);
for(int i = 0; i < G.nb_vertices; i++) { // merge multi edges
int a = 0;
@@ -186,7 +189,7 @@
if(index != 0) {
m += long(nb_vertices)*sizeof(char*);
for(int i = 0; i < nb_vertices; i++)
- m += strlen(index[i]) + 1;
+ m += std::strlen(index[i]) + 1;
}
return m;
}
More information about the fedora-extras-commits
mailing list