1. Список говнокодов пользователя MrShoor

    Всего: 2

  2. Си / Говнокод #19138

    −94

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    __attribute__( (noinline,noclone,pure,faNN1_NDA) ) /* DONE */
    int arr_findBits0Next( const Array* this_, int idx_, uint num_ ) {
      uint _idx = (uint) idx_;
      uint _len1 = this_->prolen >> _ARR_PL_L1_RS;
      uint64* _data64 = (uint64*) this_->data + ( _idx >> 6U );
      if ( UNLIKELY( _idx + num_ > _len1 ) ) return -1;
      uint64 _item64 = *_data64++;
      uint64 _n = num_;
      _item64 >>= _idx & 63U;
      L0: _item64 = ~_item64;
      do {
        uint64 _bit = _item64 & 1ULL;
        ++_idx;
        if ( UNLIKELY( ( _n -= _bit ) == 0 ) ) {
          if ( UNLIKELY( _idx > _len1 ) )return -1;
          _idx -= num_;
          return (int) _idx;
        }
        if ( _bit == 0 ) _n = num_;
        _item64 >>= 1;
      } while ( ( _idx & 63U ) );
      if ( UNLIKELY( _idx >= _len1 ) ) return -1;
      while ( true ) {
        if ( LIKELY( ( _item64 = *_data64++ ) != CNST_UINT64_MAX ) ) goto L0;
        _n = num_;
        if ( UNLIKELY( ( _idx += 64U ) >= _len1 ) ) return -1;
      }
    }

    Кусочек из аллокатора памяти, от "мастера оптимизаций".
    p.s. Автор решительно это считает образцовым кодом.
    источник http://www.gamedev.ru/code/forum/?id=208332&page=7#m93

    MrShoor, 04 Декабря 2015

    Комментарии (121)
  3. Pascal / Говнокод #2831

    +100.2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    V := +2*C.C[SFX+S1]/DT-2*C.C[SFX+S4]/DT+1*C.C[SFXY+S1]/(DT*DU)+1*C.C[SFXY+S4]/(DT*DU);
            F := F+V*T1*U3;
            FX := FX+1*V*T0*U3*DT;
            FY := FY+3*V*T1*U2*DU;
            FXY := FXY+3*V*T0*U2*DT*DU;
            V := -3*C.C[SF+S1]+3*C.C[SF+S2]-2*C.C[SFX+S1]/DT-1*C.C[SFX+S2]/DT;
            F := F+V*T2*U0;
            FX := FX+2*V*T1*U0*DT;
            V := -3*C.C[SFY+S1]/DU+3*C.C[SFY+S2]/DU-2*C.C[SFXY+S1]/(DT*DU)-1*C.C[SFXY+S2]/(DT*DU);
            F := F+V*T2*U1;
            FX := FX+2*V*T1*U1*DT;
            FY := FY+1*V*T2*U0*DU;
            FXY := FXY+2*V*T1*U0*DT*DU;
            V := +9*C.C[SF+S1]-9*C.C[SF+S2]+9*C.C[SF+S3]-9*C.C[SF+S4]+6*C.C[SFX+S1]/DT+3*C.C[SFX+S2]/DT-3*C.C[SFX+S3]/DT-6*C.C[SFX+S4]/DT+6*C.C[SFY+S1]/DU-6*C.C[SFY+S2]/DU-3*C.C[SFY+S3]/DU+3*C.C[SFY+S4]/DU+4*C.C[SFXY+S1]/(DT*DU)+2*C.C[SFXY+S2]/(DT*DU)+1*C.C[SFXY+S3]/(DT*DU)+2*C.C[SFXY+S4]/(DT*DU);
            F := F+V*T2*U2;
            FX := FX+2*V*T1*U2*DT;
            FY := FY+2*V*T2*U1*DU;
            FXY := FXY+4*V*T1*U1*DT*DU;
            V := -6*C.C[SF+S1]+6*C.C[SF+S2]-6*C.C[SF+S3]+6*C.C[SF+S4]-4*C.C[SFX+S1]/DT-2*C.C[SFX+S2]/DT+2*C.C[SFX+S3]/DT+4*C.C[SFX+S4]/DT-3*C.C[SFY+S1]/DU+3*C.C[SFY+S2]/DU+3*C.C[SFY+S3]/DU-3*C.C[SFY+S4]/DU-2*C.C[SFXY+S1]/(DT*DU)-1*C.C[SFXY+S2]/(DT*DU)-1*C.C[SFXY+S3]/(DT*DU)-2*C.C[SFXY+S4]/(DT*DU);
            F := F+V*T2*U3;
            FX := FX+2*V*T1*U3*DT;
            FY := FY+3*V*T2*U2*DU;
            FXY := FXY+6*V*T1*U2*DT*DU;
            V := +2*C.C[SF+S1]-2*C.C[SF+S2]+1*C.C[SFX+S1]/DT+1*C.C[SFX+S2]/DT;
            F := F+V*T3*U0;
            FX := FX+3*V*T2*U0*DT;
            V := +2*C.C[SFY+S1]/DU-2*C.C[SFY+S2]/DU+1*C.C[SFXY+S1]/(DT*DU)+1*C.C[SFXY+S2]/(DT*DU);
            F := F+V*T3*U1;
            FX := FX+3*V*T2*U1*DT;
            FY := FY+1*V*T3*U0*DU;
            FXY := FXY+3*V*T2*U0*DT*DU;
            V := -6*C.C[SF+S1]+6*C.C[SF+S2]-6*C.C[SF+S3]+6*C.C[SF+S4]-3*C.C[SFX+S1]/DT-3*C.C[SFX+S2]/DT+3*C.C[SFX+S3]/DT+3*C.C[SFX+S4]/DT-4*C.C[SFY+S1]/DU+4*C.C[SFY+S2]/DU+2*C.C[SFY+S3]/DU-2*C.C[SFY+S4]/DU-2*C.C[SFXY+S1]/(DT*DU)-2*C.C[SFXY+S2]/(DT*DU)-1*C.C[SFXY+S3]/(DT*DU)-1*C.C[SFXY+S4]/(DT*DU);
            F := F+V*T3*U2;
            FX := FX+3*V*T2*U2*DT;
            FY := FY+2*V*T3*U1*DU;
            FXY := FXY+6*V*T2*U1*DT*DU;
            V := +4*C.C[SF+S1]-4*C.C[SF+S2]+4*C.C[SF+S3]-4*C.C[SF+S4]+2*C.C[SFX+S1]/DT+2*C.C[SFX+S2]/DT-2*C.C[SFX+S3]/DT-2*C.C[SFX+S4]/DT+2*C.C[SFY+S1]/DU-2*C.C[SFY+S2]/DU-2*C.C[SFY+S3]/DU+2*C.C[SFY+S4]/DU+1*C.C[SFXY+S1]/(DT*DU)+1*C.C[SFXY+S2]/(DT*DU)+1*C.C[SFXY+S3]/(DT*DU)+1*C.C[SFXY+S4]/(DT*DU);

    библиотека http://alglib.sources.ru/
    модуль spline2d.pas
    произвольный кусочек кода

    MrShoor, 20 Марта 2010

    Комментарии (20)