Subversion Repositories svn1

Rev

Rev 383 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 383 Rev 384
Line 2886... Line 2886...
2886
    ty_s_data  *ptr;
2886
    ty_s_data  *ptr;
2887
    unsigned    i;
2887
    unsigned    i;
2888
    int         bad = 0;
2888
    int         bad = 0;
2889
    int         k;
2889
    int         k;
2890
    int         bad_leg;
2890
    int         bad_leg;
2891
    time_t     *t;                               /* An array of times */
2891
    maraTime_t     *t;                               /* An array of times */
2892
 
2892
 
2893
    ptr = sort_data;
2893
    ptr = sort_data;
2894
    for( i = 1; i <= sort_num; i++, ptr++ )
2894
    for( i = 1; i <= sort_num; i++, ptr++ )
2895
    {
2895
    {
2896
        bad_leg = 0;
2896
        bad_leg = 0;
Line 3525... Line 3525...
3525
    const ty_s_data * a = (ty_s_data *)aa;
3525
    const ty_s_data * a = (ty_s_data *)aa;
3526
    const ty_s_data * b = (ty_s_data *)bb;
3526
    const ty_s_data * b = (ty_s_data *)bb;
3527
 
3527
 
3528
 
3528
 
3529
    int         i;                               /* One of those */
3529
    int         i;                               /* One of those */
3530
    time_t      ta, tb;                          /* Leg times */
3530
    maraTime_t      ta, tb;                          /* Leg times */
3531
    int         na, nb;                          /* Number of valid legs */
3531
    int         na, nb;                          /* Number of valid legs */
3532
    time_t      tta, ttb;                        /* Temp times */
3532
    maraTime_t      tta, ttb;                        /* Temp times */
3533
 
3533
 
3534
    /*
3534
    /*
3535
    **  Sorting on Team Number
3535
    **  Sorting on Team Number
3536
    */
3536
    */
3537
    if( sort_mode == S_TEAM )
3537
    if( sort_mode == S_TEAM )
Line 3680... Line 3680...
3680
            **  Calculate accumulated time up to the desired leg
3680
            **  Calculate accumulated time up to the desired leg
3681
            **  If the two teams have a different number of valid
3681
            **  If the two teams have a different number of valid
3682
            **  leg times then order by the team that has completed
3682
            **  leg times then order by the team that has completed
3683
            **  more legs.
3683
            **  more legs.
3684
            */
3684
            */
3685
            ta = tb = ( time_t ) 0;
3685
            ta = tb = ( maraTime_t ) 0;
3686
            na = nb = 0;
3686
            na = nb = 0;
3687
            for( i = 1; i <= sort_leg; i++ )
3687
            for( i = 1; i <= sort_leg; i++ )
3688
            {
3688
            {
3689
                tta = a->lege[i];
3689
                tta = a->lege[i];
3690
                ttb = b->lege[i];
3690
                ttb = b->lege[i];
Line 4002... Line 4002...
4002
    {
4002
    {
4003
        for( j = 0; j <= MAX_CLASS; j++ )
4003
        for( j = 0; j <= MAX_CLASS; j++ )
4004
        {
4004
        {
4005
            stats.team[i][j] = 0;
4005
            stats.team[i][j] = 0;
4006
            stats.fast.team[i][j] = 0;
4006
            stats.fast.team[i][j] = 0;
4007
            stats.fast.time[i][j] = ( time_t ) - 1;
4007
            stats.fast.time[i][j] = ( maraTime_t ) - 1;
4008
            stats.average[i][j] = 0;
4008
            stats.average[i][j] = 0;
4009
        }
4009
        }
4010
    }
4010
    }
4011
 
4011
 
4012
    for( i = 1, ptr = sort_data; i <= sort_num; i++, ptr++ )
4012
    for( i = 1, ptr = sort_data; i <= sort_num; i++, ptr++ )
Line 4113... Line 4113...
4113
        for( j = 0; j <= config.num_class; j++ )
4113
        for( j = 0; j <= config.num_class; j++ )
4114
        {
4114
        {
4115
            if( stats.team[k][j] )
4115
            if( stats.team[k][j] )
4116
                stats.average[k][j] /= stats.team[k][j];
4116
                stats.average[k][j] /= stats.team[k][j];
4117
            else
4117
            else
4118
                stats.average[k][j] = ( time_t ) - 1;
4118
                stats.average[k][j] = ( maraTime_t ) - 1;
4119
        }
4119
        }
4120
    }
4120
    }
4121
}
4121
}
4122
 
4122
 
4123
/********************************* EOF ***********************************/
4123
/********************************* EOF ***********************************/