clean up all compile warnings.

test16bit
Steffen Pohle 3 years ago
parent 0e0638ec21
commit 3b44f3ae66

@ -32,6 +32,9 @@ SER::SER() {
FileDesc = NULL; FileDesc = NULL;
Frame = NULL; Frame = NULL;
FramePointer = 0; FramePointer = 0;
FrameSize = 0;
NumberOfPlanes = 0;
BytesPerPixel = 0;
Reading = 1; Reading = 1;
NumberOfTimeStamps = 0; NumberOfTimeStamps = 0;
TimeStamps = NULL; TimeStamps = NULL;
@ -184,7 +187,7 @@ int SER::writeHeader(void) {
} }
/* allocate some memory for the upcoming timestamps */ /* allocate some memory for the upcoming timestamps */
if((TimeStamps = (int64_t *)malloc(sizeof(header.DateTime) * NumberOfTimeStamps)) == NULL) { if((TimeStamps = (int64_t *)malloc(sizeof(header.DateTime) * NumberOfTimeStamps)) == NULL) {
fprintf(stderr, "Error: failed to allocate %d bytes for timestamps\n", fprintf(stderr, "Error: failed to allocate %lu bytes for timestamps\n",
sizeof(header.DateTime) * NumberOfTimeStamps); sizeof(header.DateTime) * NumberOfTimeStamps);
return -1; return -1;
} }
@ -242,7 +245,7 @@ int SER::appendFrame(void *data) {
if(FramePointer >= NumberOfTimeStamps) { if(FramePointer >= NumberOfTimeStamps) {
NumberOfTimeStamps *= 2; NumberOfTimeStamps *= 2;
if((TimeStamps = (int64_t *)realloc(TimeStamps, sizeof(header.DateTime) * NumberOfTimeStamps)) == NULL) { if((TimeStamps = (int64_t *)realloc(TimeStamps, sizeof(header.DateTime) * NumberOfTimeStamps)) == NULL) {
fprintf(stderr, "Error: failed to re-allocate %d bytes for timestamps\n", fprintf(stderr, "Error: failed to re-allocate %lu bytes for timestamps\n",
sizeof(header.DateTime) * NumberOfTimeStamps); sizeof(header.DateTime) * NumberOfTimeStamps);
return -1; return -1;
} }
@ -341,7 +344,7 @@ void * SER::allocFrame(void) {
/* Try allocating new frame data. */ /* Try allocating new frame data. */
if((Frame = malloc(FrameSize)) == NULL) { if((Frame = malloc(FrameSize)) == NULL) {
fprintf(stderr, "Error: failed to allocate %d bytes for frame\n", FrameSize); fprintf(stderr, "Error: failed to allocate %lu bytes for frame\n", FrameSize);
return NULL; return NULL;
} }
return Frame; return Frame;

Loading…
Cancel
Save