Strucked



  • So last week I stumbled upon this:

    (Anonymized even tho the actual names are still largely abbreviations...)

    typedef struct 
    {
      int         nr_p_m;
      some_struct_type *P;
      int         nr_s_m;
      some_struct_type *S;
      int         nr_t_m;
      some_struct_type *T;
      int         nr_x_m;
      some_struct_type *X;
      int         nr_x_s_m;
      some_struct_type *X_S;
      int         nr_x_x_m;
      some_struct_type *X_X;
      int         nr_x_y_m;
      some_struct_type *X_Y;
      int         nr_x_xs_m;
      some_struct_type *X_XS;
      int         nr_x_ys_m;
      some_struct_type *X_YS;
      int         nr_s_x_m;
      some_struct_type *S_X;
      int         nr_s_y_m;
      some_struct_type *S_Y;
      int         nr_s_xs_m;
      some_struct_type *S_XS;
      int         nr_s_ys_m;
      some_struct_type *S_YS;
      int         nr_v_x_m;
      some_struct_type *V_X;
      int         nr_v_y_m;
      some_struct_type *V_Y;    
      int         nr_o_m;
      some_struct_type *O;
      int         nr_o_s_m;
      some_struct_type *O_S;
      int 	      nr_t_t_m;
      some_struct_type *TT;
      int 	      nr_tc_t_m;
      some_struct_type *TC;
      int 	      nr_th_t_m;
      some_struct_type *TH;
      int 	      nr_a_t_m;
      some_other_struct_type *A;
      int 	      nr_a_a_t_m;
      some_other_struct_type *A_A_T;
      int 	      nr_i_u_m;
      some_struct_type *I_U;
      int 	      nr_i_v_m;
      some_struct_type *I_V;
      int 	      nr_i_cb_m;
      some_struct_type *I_CB;
      int 	      nr_p_m;
      some_struct_type *PM;
      int 	      nr_i_u_d_m;
      some_struct_type *I_U_D;
      int 	      nr_i_v_d_m;
      some_struct_type *I_V_D;
      int 	      nr_i_x_d_m;
      some_struct_type *I_X_D;
      int 	      nr_i_y_d_m;
      some_struct_type *I_Y_D;
    } R_R_L;
    

    At any time, at most two of the pointers (arrays) are not null (filled). Am lucky that they didn't write if else if else .... but simply if if if if .... doh



  • A better title would have been "dumb struct" ;)



  •  ...



  • int 	      nr_i_cb_m;

    What? You're building intercontinental ballistic missiles, and you write code like this? Armageddon is at hand! The Mayas were right!!



  • @TGV said:

    int 	      nr_i_cb_m;

    What? You're building intercontinental ballistic missiles, and you write code like this? Armageddon is at hand! The Mayas were right!!

    "It works!"



  • @TGV said:

    int 	      nr_i_cb_m;

    What? You're building intercontinental ballistic missiles, and you write code like this? Armageddon is at hand! The Mayas were right!!

    The Mayans had nukes? Sheeet.



  • Damn it all, what do I do to get my eyes to stop bleeding!



  • @blakeyrat said:

    Sheeet.
     

    Shiiiiiiiiiit



  • @dhromed said:

    @blakeyrat said:

    Sheeet.
     

    Shiiiiiiiiiit

    Twitter is leaking!



  • @blakeyrat said:

    @dhromed said:

    @blakeyrat said:

    Sheeet.
     

    Shiiiiiiiiiit

    Twitter is leaking!

     

    Green goo everywhere!

    Better work from home!

     


Log in to reply