pgRouting

Changeset 120

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

Rolled back to the previous tuple scheme

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/extra/tsp/src/tsp.c

    r114 r120  
    434434      char* nulls; 
    435435 
    436       DBG("Before allocation\n"); 
    437  
    438       values = (Datum*)palloc(4*sizeof(Datum)); 
    439       nulls = (char*)palloc(4*sizeof(char)); 
    440  
    441       DBG("After allocation\n"); 
    442  
     436      /* This will work for some compilers. If it crashes with segfault, try to change the following block with this one     
     437 
     438      values = palloc(4 * sizeof(Datum)); 
     439      nulls = palloc(4 * sizeof(char)); 
    443440 
    444441      values[0] = call_cntr; 
     
    450447      values[3] = Float8GetDatum(path[call_cntr].cost); 
    451448      nulls[3] = ' '; 
     449      */ 
     450     
     451      values = palloc(3 * sizeof(Datum)); 
     452      nulls = palloc(3 * sizeof(char)); 
     453 
     454      values[0] = Int32GetDatum(path[call_cntr].vertex_id); 
     455      nulls[0] = ' '; 
     456      values[1] = Int32GetDatum(path[call_cntr].edge_id); 
     457      nulls[1] = ' '; 
     458      values[2] = Float8GetDatum(path[call_cntr].cost); 
     459      nulls[2] = ' '; 
    452460       
    453461      DBG("Heap making\n");