pgRouting

Changeset 121

Show
Ignore:
Timestamp:
03/05/08 17:18:09 (9 months ago)
Author:
anton
Message:

Rolled back to the previous tuple scheme

Files:

Legend:

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

    r112 r121  
    532532      char* nulls; 
    533533       
    534       DBG("Before allocation\n"); 
    535  
     534      /* This will work for some compilers. If it crashes with segfault, try to change the following block with this one     
     535   
    536536      values = palloc(4 * sizeof(Datum)); 
    537537      nulls = palloc(4 * sizeof(char)); 
    538        
    539       DBG("After allocation\n"); 
    540        
     538   
    541539      values[0] = call_cntr; 
    542540      nulls[0] = ' '; 
    543541      values[1] = Int32GetDatum(path[call_cntr].vertex_id); 
    544542      nulls[1] = ' '; 
    545       values[2] = Int32GetDatum(path[call_cntr].edge_id); 
     543      values[2] = Int32GetDatum(path[call_cntr].edge_id); 
    546544      nulls[2] = ' '; 
    547545      values[3] = Float8GetDatum(path[call_cntr].cost); 
    548546      nulls[3] = ' '; 
    549        
     547      */ 
     548     
     549      values = palloc(3 * sizeof(Datum)); 
     550      nulls = palloc(3 * sizeof(char)); 
     551   
     552      values[0] = Int32GetDatum(path[call_cntr].vertex_id); 
     553      nulls[0] = ' '; 
     554      values[1] = Int32GetDatum(path[call_cntr].edge_id); 
     555      nulls[1] = ' '; 
     556      values[2] = Float8GetDatum(path[call_cntr].cost); 
     557      nulls[2] = ' '; 
     558                   
    550559      DBG("Heap making\n"); 
    551560       
  • trunk/core/src/dijkstra.c

    r112 r121  
    419419      char* nulls; 
    420420 
     421      /* This will work for some compilers. If it crashes with segfault, try to change the following block with this one     
     422  
    421423      values = palloc(4 * sizeof(Datum)); 
    422424      nulls = palloc(4 * sizeof(char)); 
    423  
    424  
     425   
    425426      values[0] = call_cntr; 
    426427      nulls[0] = ' '; 
     
    431432      values[3] = Float8GetDatum(path[call_cntr].cost); 
    432433      nulls[3] = ' '; 
    433        
     434      */ 
     435     
     436      values = palloc(3 * sizeof(Datum)); 
     437      nulls = palloc(3 * sizeof(char)); 
     438 
     439      values[0] = Int32GetDatum(path[call_cntr].vertex_id); 
     440      nulls[0] = ' '; 
     441      values[1] = Int32GetDatum(path[call_cntr].edge_id); 
     442      nulls[1] = ' '; 
     443      values[2] = Float8GetDatum(path[call_cntr].cost); 
     444      nulls[2] = ' '; 
     445                       
    434446      tuple = heap_formtuple(tuple_desc, values, nulls); 
    435447 
  • trunk/core/src/shooting_star.c

    r112 r121  
    518518      char* nulls; 
    519519       
     520      /* This will work for some compilers. If it crashes with segfault, try to change the following block with this one     
     521   
    520522      values = palloc(4 * sizeof(Datum)); 
    521523      nulls = palloc(4 * sizeof(char)); 
    522   
    523  
     524   
    524525      values[0] = call_cntr; 
    525526      nulls[0] = ' '; 
     
    530531      values[3] = Float8GetDatum(path[call_cntr].cost); 
    531532      nulls[3] = ' '; 
    532        
     533      */ 
     534                     
     535      values = palloc(3 * sizeof(Datum)); 
     536      nulls = palloc(3 * sizeof(char)); 
     537 
     538      values[0] = Int32GetDatum(path[call_cntr].vertex_id); 
     539      nulls[0] = ' '; 
     540      values[1] = Int32GetDatum(path[call_cntr].edge_id); 
     541      nulls[1] = ' '; 
     542      values[2] = Float8GetDatum(path[call_cntr].cost); 
     543      nulls[2] = ' '; 
     544                                                       
    533545      tuple = heap_formtuple(tuple_desc, values, nulls); 
    534546