|
|
|
@ -187,8 +187,8 @@ int SER::writeHeader(void) {
|
|
|
|
|
}
|
|
|
|
|
/* allocate some memory for the upcoming timestamps */
|
|
|
|
|
if((TimeStamps = (int64_t *)malloc(sizeof(header.DateTime) * NumberOfTimeStamps)) == NULL) {
|
|
|
|
|
fprintf(stderr, "Error: failed to allocate %lu bytes for timestamps\n",
|
|
|
|
|
sizeof(header.DateTime) * (long)NumberOfTimeStamps);
|
|
|
|
|
fprintf(stderr, "Error: failed to allocate %llu bytes for timestamps\n",
|
|
|
|
|
(long long unsigned int) sizeof(header.DateTime) * (long)NumberOfTimeStamps);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -246,8 +246,8 @@ int SER::appendFrame(void *data) {
|
|
|
|
|
while(FramePointer >= NumberOfTimeStamps)
|
|
|
|
|
NumberOfTimeStamps *= 2;
|
|
|
|
|
if((TimeStamps = (int64_t *)realloc(TimeStamps, sizeof(header.DateTime) * NumberOfTimeStamps)) == NULL) {
|
|
|
|
|
fprintf(stderr, "Error: failed to re-allocate %lu bytes for timestamps\n",
|
|
|
|
|
sizeof(header.DateTime) * (long)NumberOfTimeStamps);
|
|
|
|
|
fprintf(stderr, "Error: failed to re-allocate %llu bytes for timestamps\n",
|
|
|
|
|
(long long unsigned int) sizeof(header.DateTime) * (long)NumberOfTimeStamps);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -484,7 +484,7 @@ int64_t SER::differenceLocalUTC(void) {
|
|
|
|
|
/* Unfortunately, GMT still has summer time. Get rid of it:*/
|
|
|
|
|
if (gmt_time_info.tm_isdst == 1) gmt_ts -= 3600;
|
|
|
|
|
|
|
|
|
|
fprintf(stdout, "Debug: difference between local time and UTC is %ld hours\n",
|
|
|
|
|
(loc_ts - gmt_ts) / 3600);
|
|
|
|
|
fprintf(stdout, "Debug: difference between local time and UTC is %lld hours\n",
|
|
|
|
|
(long long int)(loc_ts - gmt_ts) / 3600);
|
|
|
|
|
return ((int64_t)loc_ts - (int64_t)gmt_ts) * 10000000L;
|
|
|
|
|
}
|
|
|
|
|