Changeset 123

Show
Ignore:
Timestamp:
03/13/10 10:01:03 (2 years ago)
Author:
larsivi
Message:

Workaround for forward reference bug, thanks to elgatito

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dbi/mysql/MysqlStatement.d

    r116 r123  
    2727 
    2828private: 
     29    static struct BindingHelper 
     30    {    
     31        void setLength(size_t l) 
     32        { 
     33            error.length = l; 
     34            is_null.length = l; 
     35            len.length = l; 
     36            time = null; 
     37            buffer = null; 
     38            foreach(ref n; is_null) 
     39            { 
     40                n = false; 
     41            } 
     42             
     43            foreach(ref e; error) 
     44            { 
     45                e = false; 
     46            } 
     47             
     48            foreach(ref i; len) 
     49            { 
     50                i = 0; 
     51            } 
     52        } 
     53        my_bool[] error; 
     54        my_bool[] is_null; 
     55        size_t[] len; 
     56        MYSQL_TIME[uint] time; 
     57        ubyte[][uint] buffer; 
     58        DbiType[] types; 
     59    } 
     60     
    2961    MYSQL * connection; 
    3062    MYSQL_STMT * stmt; 
     
    342374    } 
    343375     
    344     static struct BindingHelper 
    345     {    
    346         void setLength(size_t l) 
    347         { 
    348             error.length = l; 
    349             is_null.length = l; 
    350             len.length = l; 
    351             time = null; 
    352             buffer = null; 
    353             foreach(ref n; is_null) 
    354             { 
    355                 n = false; 
    356             } 
    357              
    358             foreach(ref e; error) 
    359             { 
    360                 e = false; 
    361             } 
    362              
    363             foreach(ref i; len) 
    364             { 
    365                 i = 0; 
    366             } 
    367         } 
    368         my_bool[] error; 
    369         my_bool[] is_null; 
    370         size_t[] len; 
    371         MYSQL_TIME[uint] time; 
    372         ubyte[][uint] buffer; 
    373         DbiType[] types; 
    374     } 
    375  
    376376    static void initBindings(DbiType[] types, inout MYSQL_BIND[] bind,  
    377377                             inout BindingHelper helper)