pgRouting

Changeset 112

Show
Ignore:
Timestamp:
03/03/08 16:17:03 (10 months ago)
Author:
anton
Message:

Segfault fixed. See Forum #21 - Topic #118

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/core/src/astar.c

    r105 r112  
    534534      DBG("Before allocation\n"); 
    535535 
    536       values = palloc(3 * sizeof(Datum)); 
    537       nulls = palloc(3 * sizeof(char)); 
     536      values = palloc(4 * sizeof(Datum)); 
     537      nulls = palloc(4 * sizeof(char)); 
    538538       
    539539      DBG("After allocation\n"); 
    540540       
    541       values[0] = Int32GetDatum(path[call_cntr].vertex_id)
     541      values[0] = call_cntr
    542542      nulls[0] = ' '; 
    543       values[1] = Int32GetDatum(path[call_cntr].edge_id); 
     543      values[1] = Int32GetDatum(path[call_cntr].vertex_id); 
    544544      nulls[1] = ' '; 
    545       values[2] = Float8GetDatum(path[call_cntr].cost); 
     545      values[2] = Int32GetDatum(path[call_cntr].edge_id); 
    546546      nulls[2] = ' '; 
    547  
     547      values[3] = Float8GetDatum(path[call_cntr].cost); 
     548      nulls[3] = ' '; 
     549       
    548550      DBG("Heap making\n"); 
    549551       
  • trunk/core/src/dijkstra.c

    r44 r112  
    419419      char* nulls; 
    420420 
    421       values = palloc(3 * sizeof(Datum)); 
    422       nulls = palloc(3 * sizeof(char)); 
    423  
    424  
    425       values[0] = Int32GetDatum(path[call_cntr].vertex_id)
     421      values = palloc(4 * sizeof(Datum)); 
     422      nulls = palloc(4 * sizeof(char)); 
     423 
     424 
     425      values[0] = call_cntr
    426426      nulls[0] = ' '; 
    427       values[1] = Int32GetDatum(path[call_cntr].edge_id); 
     427      values[1] = Int32GetDatum(path[call_cntr].vertex_id); 
    428428      nulls[1] = ' '; 
    429       values[2] = Float8GetDatum(path[call_cntr].cost); 
     429      values[2] = Int32GetDatum(path[call_cntr].edge_id); 
    430430      nulls[2] = ' '; 
    431  
     431      values[3] = Float8GetDatum(path[call_cntr].cost); 
     432      nulls[3] = ' '; 
     433       
    432434      tuple = heap_formtuple(tuple_desc, values, nulls); 
    433435 
  • trunk/core/src/shooting_star.c

    r43 r112  
    518518      char* nulls; 
    519519       
    520       values = palloc(3 * sizeof(Datum)); 
    521       nulls = palloc(3 * sizeof(char)); 
     520      values = palloc(4 * sizeof(Datum)); 
     521      nulls = palloc(4 * sizeof(char)); 
    522522  
    523       values[0] = Int32GetDatum(path[call_cntr].vertex_id); 
     523 
     524      values[0] = call_cntr; 
    524525      nulls[0] = ' '; 
    525       values[1] = Int32GetDatum(path[call_cntr].edge_id); 
     526      values[1] = Int32GetDatum(path[call_cntr].vertex_id); 
    526527      nulls[1] = ' '; 
    527       values[2] = Float8GetDatum(path[call_cntr].cost); 
     528      values[2] = Int32GetDatum(path[call_cntr].edge_id); 
    528529      nulls[2] = ' '; 
    529  
     530      values[3] = Float8GetDatum(path[call_cntr].cost); 
     531      nulls[3] = ' '; 
     532       
    530533      tuple = heap_formtuple(tuple_desc, values, nulls); 
    531534       
  • trunk/core/src/shooting_star_search.hpp

    r106 r112  
    428428    // Queue to store the list of edges to examine. 
    429429    // I really hate this queue for what it does with the memory sometimes. 
     430    // 
     431    //And by the way... 
     432    // 
     433    //This place is for rent :) 
     434    // 
    430435    typedef mutable_queue<Edge, std::vector<Edge>, IndirectCmp, IndexMap> 
    431436      MutableQueue;