Changeset 12889
- Timestamp:
- 02/13/12 11:10:33 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/datalogger.cc
r12827 r12889 2093 2093 const unsigned int n = 8 + 3 + 2*maxCharLength + 1 + 8; //+1 for trailling character 2094 2094 2095 vector<unsigned char> realBuffer; 2096 realBuffer.resize(n); 2097 unsigned char* fitsBuffer = &realBuffer[0]; 2098 memset(fitsBuffer, 0, n); 2099 2100 char* startOfExtension = reinterpret_cast<char*>(fitsBuffer); 2101 char* startOfURI = reinterpret_cast<char*>(&fitsBuffer[8]); 2102 char* startOfLocation = reinterpret_cast<char*>(&fitsBuffer[8 + 3]); 2103 char* startOfName = reinterpret_cast<char*>(&fitsBuffer[8+3+maxCharLength]); 2095 vector<char> realBuffer(n); 2096 2097 char *startOfExtension = realBuffer.data(); 2098 char *startOfURI = realBuffer.data()+8; 2099 char *startOfLocation = realBuffer.data()+8+3; 2100 char *startOfName = realBuffer.data()+8+3+maxCharLength; 2104 2101 // char* startOfMemVer = reinterpret_cast<char*>(&fitsBuffer[8+3+2*maxCharLength]); 2105 2102 // char* startOfMemPos = reinterpret_cast<char*>(&fitsBuffer[8+3+2*maxCharLength+1]); … … 2107 2104 strcpy(startOfExtension, "BINTABLE"); 2108 2105 strcpy(startOfURI, "URL"); 2109 fitsBuffer[8+3+2*maxCharLength+3] = 1; 2110 fitsBuffer[8+3+2*maxCharLength+7] = 1; 2106 2107 realBuffer[8+3+2*maxCharLength+3] = 1; 2108 realBuffer[8+3+2*maxCharLength+7] = 1; 2111 2109 2112 2110 int i=1; … … 2114 2112 for (vector<string>::const_iterator jt=it->second.begin(); jt != it->second.end(); jt++, i++) 2115 2113 { 2114 memset(startOfLocation, 0, 2*maxCharLength+1+8; 2115 2116 2116 strcpy(startOfLocation, it->first.c_str()); 2117 strcpy(startOfName, jt->c_str());2117 strcpy(startOfName, jt->c_str()); 2118 2118 2119 2119 if (fDebugIsOn) … … 2125 2125 2126 2126 int status = 0; 2127 fits_write_tblbytes(groupFile->fitsPointer(), i, 1, 8+3+2*maxCharLength +8, fitsBuffer, &status);2127 fits_write_tblbytes(groupFile->fitsPointer(), i, 1, 8+3+2*maxCharLength +8, realBuffer.data(), &status); 2128 2128 if (status) 2129 2129 {
Note:
See TracChangeset
for help on using the changeset viewer.