Changeset 2047


Ignore:
Timestamp:
Apr 23, 2012, 3:50:38 PM (7 years ago)
Author:
ksherdy
Message:

Revered TYPE and LGTH template parameters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtest/byte_compare_generator.cpp

    r1920 r2047  
    7777
    7878
    79 string gen_overlap_compare_call(string type, int lgth, string x_param, string y_param) {
     79string gen_overlap_compare_call(int lgth, string type, string x_param, string y_param) {
    8080
    8181    ostringstream ostr;
     
    8585                 << y_param << "[" << lgth << "]"
    8686                 << "<< \" is \" << "
    87                  << "overlap_compare<" << type << "," << lgth << ">("
     87                 << "overlap_compare<" << lgth << "," << type  << ">("
    8888                 << "(uint8_t *)&" << x_param << "[" << lgth << "]"<< ", "
    8989                 << "(uint8_t *)&" << y_param << "[" << lgth << "]"<< ")"
     
    9292}
    9393
    94 string gen_overlap_compare_call(string type, int lgth, string x_param, string y_param, int lgth_param) {
     94string gen_overlap_compare_call(int lgth, string type, string x_param, string y_param, int lgth_param) {
    9595
    9696    ostringstream ostr;
     
    121121    buffer << "cout << endl << \"overlap_compare<uint8_t,i>(x,y)\" << endl;" << endl;
    122122    for(int i=sizeof(uint8_t);i<=size;i++) {
    123         buffer << gen_overlap_compare_call("uint8_t", i, x, x);
     123        buffer << gen_overlap_compare_call(i, "uint8_t", x, x);
    124124    }
    125125
    126126    for(int i=sizeof(uint8_t);i<=size;i++) {
    127         buffer << gen_overlap_compare_call("uint8_t", i, x, y);
     127        buffer << gen_overlap_compare_call(i, "uint8_t", x, y);
    128128    }
    129129
    130130    buffer << "cout << endl << \"overlap_compare<uint16_t,i>(x,y)\" << endl;" << endl;
    131131    for(int i=sizeof(uint16_t);i<=size;i++) {
    132         buffer << gen_overlap_compare_call("uint16_t", i, x, x);
     132        buffer << gen_overlap_compare_call(i, "uint16_t", x, x);
    133133    }
    134134
    135135    for(int i=sizeof(uint16_t);i<=size;i++) {
    136         buffer << gen_overlap_compare_call("uint16_t", i, x, y);
     136        buffer << gen_overlap_compare_call(i, "uint16_t", x, y);
    137137    }
    138138
    139139    buffer << "cout << endl << \"overlap_compare<uint32_t,i>(x,y)\" << endl;" << endl;
    140140    for(int i=sizeof(uint32_t);i<=size;i++) {
    141         buffer << gen_overlap_compare_call("uint32_t", i, x, x);
     141        buffer << gen_overlap_compare_call(i, "uint32_t", x, x);
    142142    }
    143143
    144144    for(int i=sizeof(uint32_t);i<=size;i++) {
    145         buffer << gen_overlap_compare_call("uint32_t", i, x, y);
     145        buffer << gen_overlap_compare_call(i, "uint32_t", x, y);
    146146    }
    147147
    148148    buffer << "cout << endl << \"overlap_compare<uint64_t,i>(x,y)\" << endl;" << endl;
    149149    for(int i=sizeof(uint64_t);i<=size;i++) {
    150         buffer << gen_overlap_compare_call("uint64_t", i, x, x);
     150        buffer << gen_overlap_compare_call(i, "uint64_t", x, x);
    151151    }
    152152
    153153    for(int i=sizeof(uint64_t);i<=size;i++) {
    154         buffer << gen_overlap_compare_call("uint64_t", i, x, y);
     154        buffer << gen_overlap_compare_call(i, "uint64_t", x, y);
    155155    }
    156156
    157157    buffer << "cout << endl << \"overlap_compare<BitBlock,i>(x,y)\" << endl;" << endl;
    158158    for(int i=sizeof(BitBlock);i<=size;i++) {
    159         buffer << gen_overlap_compare_call("BitBlock", i, x, x);
     159        buffer << gen_overlap_compare_call(i, "BitBlock", x, x);
    160160    }
    161161
    162162    for(int i=sizeof(BitBlock);i<=size;i++) {
    163         buffer << gen_overlap_compare_call("BitBlock", i, x, y);
     163        buffer << gen_overlap_compare_call(i, "BitBlock", x, y);
    164164    }
    165165
    166166    buffer << "cout << endl << \"overlap_compare<BitBlock>(x,y,lgth)\" << endl;" << endl;
    167167    for(int i=sizeof(BitBlock);i<=size;i++) {
    168         buffer << gen_overlap_compare_call("BitBlock", i, x, x, i);
     168        buffer << gen_overlap_compare_call(i, "BitBlock", x, x, i);
    169169    }
    170170
    171171    for(int i=sizeof(BitBlock);i<=size;i++) {
    172         buffer << gen_overlap_compare_call("BitBlock", i, x, y, i);
     172        buffer << gen_overlap_compare_call(i, "BitBlock", x, y, i);
    173173    }
    174174
Note: See TracChangeset for help on using the changeset viewer.