~manveru/kicad/new-pcb-text-properties-dialog

« back to all changes in this revision

Viewing changes to eeschema/netlist.cpp

  • Committer: Marco Serantoni
  • Date: 2010-11-13 18:56:07 UTC
  • Revision ID: marco.serantoni@gmail.com-20101113185607-w8amwraii5drcluy
MacOSX: PRIO_MAX already defined is Maximum Process Priority in (sys/resource.h)

Show diffs side-by-side

added added

removed removed

Lines of Context:
380
380
 
381
381
    // Define a priority (from low to high) to sort labels:
382
382
    // NET_PINLABEL and NET_GLOBLABEL are global labels
383
 
    // and priority >= PRIO_MAX-1 is for global connections
 
383
    // and priority >= NET_PRIO_MAX-1 is for global connections
384
384
    // ( i.e. for labels that are not prefixed by a sheetpath)
385
 
    #define PRIO_MAX 4
386
 
    int priority_order[PRIO_MAX+1] =
 
385
    #define NET_PRIO_MAX 4
 
386
    int priority_order[NET_PRIO_MAX+1] =
387
387
    { NET_ITEM_UNSPECIFIED, NET_LABEL, NET_HIERLABEL, NET_PINLABEL, NET_GLOBLABEL };
388
388
 
389
389
    NETLIST_OBJECT*item = aLabelItemBuffer[0];
390
390
 
391
391
    // Calculate item priority (initial priority)
392
392
    int item_priority = 0;
393
 
    for( unsigned ii = 0; ii <= PRIO_MAX; ii++ )
 
393
    for( unsigned ii = 0; ii <= NET_PRIO_MAX; ii++ )
394
394
    {
395
395
        if ( item->m_Type == priority_order[ii]  )
396
396
        {
404
404
        NETLIST_OBJECT* candidate = aLabelItemBuffer[ii];
405
405
        // Calculate candidate priority
406
406
        int candidate_priority = 0;
407
 
        for( unsigned ii = 0; ii <= PRIO_MAX; ii++ )
 
407
        for( unsigned ii = 0; ii <= NET_PRIO_MAX; ii++ )
408
408
        {
409
409
            if ( candidate->m_Type == priority_order[ii]  )
410
410
            {
425
425
            // because the actual name is /sheetpath/label
426
426
            // and for a given path length, by alphabetic order
427
427
 
428
 
            if( item_priority >= PRIO_MAX-1 )     // global label or pin label
 
428
            if( item_priority >= NET_PRIO_MAX-1 )     // global label or pin label
429
429
            {   // selection by alphabetic order:
430
430
                if( candidate->m_Label.Cmp( item->m_Label ) < 0 )
431
431
                    item = candidate;