Skip to content

Commit c01179d

Browse files
authored
Merge pull request GraphChi#1 from NoelM/fix_warnings
fix some warnings
2 parents 4b3438b + c29e733 commit c01179d

File tree

5 files changed

+21
-30
lines changed

5 files changed

+21
-30
lines changed

src/api/functional/functional_bulksync.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ namespace graphchi {
5757

5858
KERNEL kernel;
5959

60-
VT cumval;
60+
VT cumval = {};
6161

6262
vertex_info vinfo;
63-
graphchi_context * gcontext;
63+
graphchi_context * gcontext = nullptr;
6464

6565
functional_vertex_unweighted_bulksync() : graphchi_vertex<VT, ET> () {}
6666

src/api/functional/functional_defs.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
namespace graphchi {
3535

3636
struct vertex_info {
37-
vid_t vertexid;
38-
int indegree;
39-
int outdegree;
37+
vid_t vertexid = 0;
38+
int indegree = 0;
39+
int outdegree = 0;
4040
};
4141

4242
/* Special sparse locking */

src/api/graph_objects.hpp

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -146,28 +146,28 @@ namespace graphchi {
146146
class internal_graphchi_vertex {
147147

148148
public: // Todo, use friend
149-
volatile int inc;
150-
volatile int outc;
149+
volatile int inc = 0;
150+
volatile int outc = 0;
151151

152-
vid_t vertexid;
152+
vid_t vertexid = 0;
153153

154154
protected:
155-
graphchi_edge<EdgeDataType> * inedges_ptr;
156-
graphchi_edge<EdgeDataType> * outedges_ptr;
155+
graphchi_edge<EdgeDataType> * inedges_ptr = nullptr;
156+
graphchi_edge<EdgeDataType> * outedges_ptr = nullptr;
157157

158158

159159
public:
160-
bool modified;
161-
VertexDataType * dataptr;
160+
bool modified = false;
161+
VertexDataType * dataptr = nullptr;
162162

163163

164164
/* Accessed directly by the engine */
165-
bool scheduled;
166-
bool parallel_safe;
165+
bool scheduled = false;
166+
bool parallel_safe = true;
167167

168168
#ifdef SUPPORT_DELETIONS
169-
int deleted_inc;
170-
int deleted_outc;
169+
int deleted_inc = 0;
170+
int deleted_outc = 0;
171171
#endif
172172

173173

@@ -184,16 +184,6 @@ namespace graphchi {
184184
int indeg,
185185
int outdeg) :
186186
vertexid(_id), inedges_ptr(iptr), outedges_ptr(optr) {
187-
inc = 0;
188-
outc = 0;
189-
scheduled = false;
190-
modified = false;
191-
parallel_safe = true;
192-
dataptr = NULL;
193-
#ifdef SUPPORT_DELETIONS
194-
deleted_inc = 0;
195-
deleted_outc = 0;
196-
#endif
197187
}
198188

199189
virtual ~internal_graphchi_vertex() {}

src/preprocessing/sharder.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ namespace graphchi {
691691

692692
vid_t curvid=0;
693693
#ifdef DYNAMICEDATA
694-
vid_t lastdst = 0xffffffffffffffff; // 64bits
694+
vid_t lastdst = std::numeric_limits<vid_t>::max();
695695
int jumpover = 0;
696696
size_t num_uniq_edges = 0;
697697
size_t last_edge_count = 0;
@@ -1089,7 +1089,7 @@ namespace graphchi {
10891089
std::vector< graphchi_vertex<vid_t, dummy_t> > vertices(nvertices, graphchi_vertex<vid_t, dummy_t>()); // preallocate
10901090

10911091

1092-
for(int i=0; i < nvertices; i++) {
1092+
for(vid_t i=0; i < nvertices; i++) {
10931093
vertices[i] = graphchi_vertex<vid_t, dummy_t>(subinterval_st + i, NULL, NULL, 0, 0);
10941094
vertices[i].scheduled = true;
10951095
}

src/shards/slidingshard.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ namespace graphchi {
278278
assert(closest_vid>=0);
279279
indexentry closest_offset = lowerbd_iter->second;
280280
assert(closest_vid <= v);
281-
if (closest_vid > curvid) { /* Note: this will fail if we have over 2B vertices! */
281+
if (closest_vid > curvid) {
282282
logstream(LOG_DEBUG)
283283
<< "Sliding shard, start: " << range_st << " moved to: " << closest_vid << " " << closest_offset.adjoffset << ", asked for : " << v << " was in: curvid= " << curvid << " " << adjoffset << std::endl;
284284

@@ -406,7 +406,8 @@ namespace graphchi {
406406
vid_t lastrec = start;
407407
window_start_edataoffset = edataoffset;
408408

409-
for(int i=((int)curvid) - ((int)start); i<nvecs; i++) {
409+
assert(curvid >= start);
410+
for(vid_t i=curvid - start; i<nvecs; i++) {
410411
if (adjoffset >= adjfilesize) break;
411412

412413
// TODO: skip unscheduled vertices.

0 commit comments

Comments
 (0)