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

    Всего: 3

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

    −43

    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
    const char *byte2binstr(unsigned char byte) {
    #define AA                                    BB(0), BB(1)
    #define BB(b0)                                CC(b0, 0), CC(b0, 1)
    #define CC(b0, b1)                            DD(b0, b1, 0), DD(b0, b1, 1)
    #define DD(b0, b1, b2)                        EE(b0, b1, b2, 0), EE(b0, b1, b2, 1)
    #define EE(b0, b1, b2, b3)                    FF(b0, b1, b2, b3, 0), FF(b0, b1, b2, b3, 1)
    #define FF(b0, b1, b2, b3, b4)                GG(b0, b1, b2, b3, b4, 0), GG(b0, b1, b2, b3, b4, 1)
    #define GG(b0, b1, b2, b3, b4, b5)            HH(b0, b1, b2, b3, b4, b5, 0), HH(b0, b1, b2, b3, b4, b5, 1)
    #define HH(b0, b1, b2, b3, b4, b5, b6)        II(b0, b1, b2, b3, b4, b5, b6, 0), II(b0, b1, b2, b3, b4, b5, b6, 1)
    #define II(b0, b1, b2, b3, b4, b5, b6, b7)    STR(b0 ## b1 ## b2 ## b3 ## b4 ## b5 ## b6 ## b7)
    #define STR(s)                                #s
    
        static const char *table[256] = { AA };
        return table[byte];
    
    #undef AA
    #undef BB
    #undef CC
    #undef DD
    #undef EE
    #undef FF
    #undef GG
    #undef HH
    #undef II
    #undef STR
    }

    serg_ik, 14 Января 2016

    Комментарии (5)
  3. Си / Говнокод #13322

    +139

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    #define InlineIsEqualGUID(rguid1, rguid2)  \
            (((unsigned long *) rguid1)[0] == ((unsigned long *) rguid2)[0] &&   \
            ((unsigned long *) rguid1)[1] == ((unsigned long *) rguid2)[1] &&    \
            ((unsigned long *) rguid1)[2] == ((unsigned long *) rguid2)[2] &&    \
            ((unsigned long *) rguid1)[3] == ((unsigned long *) rguid2)[3])

    Windows SDK, guiddef.h

    ret = InlineIsEqualGUID(&g_guid, guid_array + i); /* ??? */

    serg_ik, 07 Июля 2013

    Комментарии (15)
  4. Си / Говнокод #10186

    +125

    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
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    void DrawScene( void )
    {
    	glPushMatrix();
    	glClearColor(0.0F, 0.0F, 0.0F, 1.0F); 
    	glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
    	glEnable( GL_DEPTH_TEST );
    
    	glLoadIdentity();
    	glTranslated( 0.0, 0.0, -2.0 );
    	glMultMatrixd( RotMatrix );
    
    	glColor3f( 0.0, 0.0, 1.0 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( 0.0, 0.5, 0.0 );
    		glVertex3d( 0.0, 0.0, 0.5 );
    	glEnd();
    	glColor3f( 0.0, 1.0, 0.0 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( 0.0, 0.0, -0.5 );
    		glVertex3d( 0.0, -0.5, 0.0 );
    	glEnd();
    	glColor3f( 1.0, 0.0, 0.0 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( 0.0, 0.5, 0.0 );
    		glVertex3d( 0.0, 0.0, -0.5 );
    	glEnd();
    	glColor3f( 0.0, 0.5, 0.5 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( 0.0, 0.0, 0.5 );
    		glVertex3d( 0.0, -0.5, 0.0 );
    	glEnd();
    
    	glColor3f( 0.5, 0.0, 0.5 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( 0.5, 0.0, 0.0 );
    		glVertex3d( 0.0, 0.0, 0.5 );
    	glEnd();
    	glColor3f( 0.5, 0.5, 0.0 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( -0.5, 0.0, 0.0 );
    		glVertex3d( 0.0, 0.0, -0.5 );
    	glEnd();
    	glColor3f( 0.75, 0.25, 0.5 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( -0.5, 0.0, 0.0 );
    		glVertex3d( 0.0, 0.0, 0.5 );
    	glEnd();
    	glColor3f( 0.5, 0.25, 0.75 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( 0.5, 0.0, 0.0 );
    		glVertex3d( 0.0, 0.0, -0.5 );
    	glEnd();
    
    	glColor3f( 0.25, 0.75, 0.5 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( 0.5, 0.0, 0.0 );
    		glVertex3d( 0.0, 0.5, 0.0 );
    	glEnd();
    	glColor3f( 0.5, 0.75, 0.25 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( 0.0, -0.5, 0.0 );
    		glVertex3d( -0.5, 0.0, 0.0 );
    	glEnd();
    	glColor3f( 0.25, 0.5, 0.75 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( -0.5, 0.0, 0.0 );
    		glVertex3d( 0.0, 0.5, 0.0 );
    	glEnd();
    	glColor3f( 0.75, 0.5, 0.25 );
    	glBegin( GL_POLYGON );
    		glVertex3d( 0.0, 0.0, 0.0 );
    		glVertex3d( 0.5, 0.0, 0.0 );
    		glVertex3d( 0.0, -0.5, 0.0 );
    	glEnd();
    	
    	glDisable( GL_DEPTH_TEST );
    
    	glFlush();
    	glPopMatrix();
    }

    serg_ik, 04 Мая 2012

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