1. C++ / Говнокод #7041

    +169

    1. 1
    void failware(void){0;return;};

    Говногость, 24 Июня 2011

    Комментарии (14)
  2. C++ / Говнокод #7040

    +173

    1. 1
    throw (i?getMainException():int());

    Говногость, 24 Июня 2011

    Комментарии (29)
  3. C++ / Говнокод #7031

    +155

    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
    #include <a_samp>
    
    new objects[MAX_OBJECTS];
    
    public OnFilterScriptInit()
    {
    	objects[0] = CreateObject(980, -2491.1276855469, -129.08126831055, 27.397054672241, 0, 0, 90.675659179688);
    	objects[1] = CreateObject(980,-2459.8862304688,-152.13926696777,27.652730941772,0,356,0);
        objects[2] = CreateObject(980,-2446.0773925781,-82.466796875,35.984577178955,0,356,0);
    	return 1;
    }
    
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    	if (strcmp("/garage", cmdtext, true, 10) == 0)
    	{
    		MoveObject(objects[0], -2491.1276855469, -129.08126831055, 20, 2);
    		SetTimer("VTimer", 10000, 0);
    		return 1;
    	}
    	return 0;
    }
    
    forward VTimer();
    public VTimer()
    {
    	MoveObject(objects[0], -2491.1276855469, -129.08126831055, 27.397054672241, 2);
    	return 1;
    }

    smith, 23 Июня 2011

    Комментарии (13)
  4. C++ / Говнокод #7029

    +159

    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
    void AClass::registerApplication( int pCaller )
    {
      if ( mRegistry == NULL )
      {
        // we will be the first application in registry
        mRegistry = createRegistryElement( pCaller );
      }
      else
      {
        // there are other applications already registered
        // first create registry entry
        Application *lApplication = NULL;
        lApplication = createRegistryElement( pCaller );
    
        // put entry in front
        lApplication->mNext = mRegistry;
        mRegistry = lApplication;
      }
    }

    добавляем новый элемент в односвязный список. mRegister голова списка. кто не видит говна - идти читать матчасть.

    Dummy00001, 22 Июня 2011

    Комментарии (69)
  5. C++ / Говнокод #7028

    +153

    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
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    try
    			{
    				sw = gcnew StreamWriter(GetIniFileName());
    			}
    			catch(UnauthorizedAccessException^ e)
    			{
    				MessageBox::Show( "Access is denied.", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
    				ShowException(dynamic_cast<System::Exception^>(e));
    				return;
    			}
    			catch(ArgumentNullException^ e)
    			{
    				MessageBox::Show( e->ParamName + ": File path is null.", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
    				ShowException(dynamic_cast<System::Exception^>(e));
    				return;
    			}
    			catch(ArgumentException^ e)
    			{
    				MessageBox::Show( e->ParamName + ": Wrong file path.", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
    				ShowException(dynamic_cast<System::Exception^>(e));
    				return;
    			}
    			catch(DirectoryNotFoundException^ e)
    			{
    				MessageBox::Show( "The specified path is invalid, such as being on an unmapped drive.", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
    				ShowException(dynamic_cast<System::Exception^>(e));
    				return;
    			}
    			catch(PathTooLongException^ e)
    			{
    				MessageBox::Show( "The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. ", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
    				ShowException(dynamic_cast<System::Exception^>(e));
    				return;
    			}
    			catch(IOException^ e)
    			{
    				MessageBox::Show( "File path includes an incorrect or invalid syntax for file name, directory name, or volume label syntax. ", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
    				ShowException(dynamic_cast<System::Exception^>(e));
    				return;
    			}
    			catch(SecurityException^ e)
    			{
    				MessageBox::Show( "The caller does not have the required permission." + e->ToString(), "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
    				ShowException(dynamic_cast<System::Exception^>(e));
    				return;
    			}
    			catch(System::Exception^ e)
    			{
    				ShowException(e);
    				return;
    			}

    Обработка исключений.

    ScumCoder, 22 Июня 2011

    Комментарии (21)
  6. C++ / Говнокод #7027

    +169

    1. 1
    2. 2
    const void* const relay(const TrigClass& Overloading=*((TrigClass*)(NULpoter))){
      if(&Overloading==NULpoter){

    Говногость, 22 Июня 2011

    Комментарии (59)
  7. C++ / Говнокод #7020

    +188

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    typedef enum
      {
        FFALSE = 0,
        TTRUE,
        MMAYBE
      } Truth_t;

    ну почти квантовое программирование.

    ЗЫ да, это из С++ программы.

    Dummy00001, 21 Июня 2011

    Комментарии (42)
  8. C++ / Говнокод #7019

    +175

    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
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    class BalanceValue
    {
      /* ... */
      BalanceValue( int pFamilyGroupId,
                    int ContractId,
                    int pProfileId,
                    int pSncode,
                    long pPurchaseSeqNo,
                    int pBundledProductId,
                    time_t pCreationDate,
                    time_t pNextresetDate,
                    char pState,
                    double pAggregate,
                    double pCredit,
                    double pInitialCredit,
                    double pReservation,
                    char pColor,
                    double pProrateFactor,
                    int pCurrencyId,
                    int pUomId,
                    time_t pSnapshotDate,
                    unsigned long pSequenceNumber,
                    time_t pValidFrom,
                    time_t pValidTo,
                    int pPricingAlternative,
                    int pCocTariffId,
                    time_t pLastresetDate,
                    double pLateCallAggr );
      /* ... */
      void getAllValues( int&            pContractId,
                         int&            pProfileId,
                         int&            pSncode,
                         long&           pPurchaseSeqNo,
                         int&            pBundledProductId,
                         time_t&         pNextResetDate,
                         char&           pState,
                         double&         pAggregate,
                         double&         pCredit,
                         double&         pInitialCredit,
                         double&         pReservation,
                         char&           pColor,
                         double&         pProRateFactor,
                         int&            pCurrencyId,
                         int&            pUomId,
                         time_t&         pSnapShotDate ,
                         unsigned long&  pSequenceNumber,
                         time_t&         pValidFrom,
                         time_t&         pValidTo,
                         int&            pPricingAlternative,
                         int&            pCocTariffId,
                         time_t&         pLastResetDate,
                         double&         pLateCallAggr );
      /* ... */
    };

    чудо интерфейс. 25 параметров у конструктора, 23 параметров (рефернсы!) у геттера. кто больше?

    ЗЫ как оба реализованы можете сами догадатся. и еще несколько других методов в подобном стиле.
    ЗЗЫ да, есть и нормальные геттеры.
    ЗЗЗЫ нет, другого конструктора нету.
    ЗЗЗЗЫ нет, разнести значение по мелким структурам, более приемлимым человеческому мозгу, народ не догадывается. не наш так сказать стиль. (да, есть естественная групировка параметров по источнику откуда они берутся.)

    Dummy00001, 21 Июня 2011

    Комментарии (13)
  9. C++ / Говнокод #7013

    +159

    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
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    #include <math.h>
    #include <iostream>
    using namespace std;
    void main()
    { int month,day;
            cin>>month,day;
            int den=1;
            switch(month)
    {       case 1: cout<<"month: "<<month<<endl<<"day: "<<day+1;
    if(day==31){cout<<"month: "<<month+1<<endl<<den;}
    break;
            case 2: cout<<"month: "<<month<<endl<<"day: "<<day+1;
            if(day==28){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 3:cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 4:cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==30){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 5: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 6: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==30){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 7: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 8: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 9: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==30){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 10: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 11: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==30){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 12: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
                    
                                    
    }       
     
    cin.get();
            cin.get();
    }

    Juris_Kabanis, 20 Июня 2011

    Комментарии (12)
  10. C++ / Говнокод #7009

    +165

    1. 1
    2. 2
    3. 3
    ASSERT(mStartSamples.size() == mFades.size() == mIsFadeIns.size() == inOutBlock->GetNumChannels());
    
    ASSERT(iGainData.size() == mSizes.size() == inStartSamples.size() != 0);

    Краткость - сестра таланта

    victor_r, 20 Июня 2011

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