Changeset 16424 for trunk/Mars/mcore
- Timestamp:
- 05/29/13 11:59:19 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/fits.h
r16415 r16424 113 113 size_t num; 114 114 size_t size; 115 size_t bytes; // num*size 115 116 char type; 116 117 string unit; … … 346 347 } 347 348 348 const Table::Column col = { bytes, n, size, type, unit, compress};349 const Table::Column col = { bytes, n, size, n*size, type, unit, compress}; 349 350 350 351 cols[id] = col; … … 781 782 782 783 template<size_t N> 783 void revcpy(char *dest, const char *src, intnum)784 void revcpy(char *dest, const char *src, const int &num) 784 785 { 785 786 const char *pend = src + num*N; … … 788 789 } 789 790 790 virtual void MoveColumnDataToUserSpace(char * dest, const char*src, const Table::Column& c)791 virtual void MoveColumnDataToUserSpace(char *dest, const char *src, const Table::Column& c) 791 792 { 792 793 // Let the compiler do some optimization by … … 794 795 switch (c.size) 795 796 { 796 case 1: memcpy (dest, src, c. num*c.size); break;797 case 2: revcpy<2>(dest, src, c.num); 798 case 4: revcpy<4>(dest, src, c.num); 799 case 8: revcpy<8>(dest, src, c.num); 797 case 1: memcpy (dest, src, c.bytes); break; 798 case 2: revcpy<2>(dest, src, c.num); break; 799 case 4: revcpy<4>(dest, src, c.num); break; 800 case 8: revcpy<8>(dest, src, c.num); break; 800 801 } 801 802 } … … 873 874 return it->second; 874 875 875 fGarbage.emplace_back(fTable.cols[name]. size*fTable.cols[name].num);876 fGarbage.emplace_back(fTable.cols[name].bytes); 876 877 877 878 void *ptr = fGarbage.back().data();
Note:
See TracChangeset
for help on using the changeset viewer.