From fd623c74c3eaf4b23982e8e3bc4409c88abbdec2 Mon Sep 17 00:00:00 2001 From: Steffen Pohle Date: Wed, 6 Mar 2024 23:26:25 +0100 Subject: [PATCH] solving compiler warnings --- Makefile.rules.windows | 2 +- ser.cc | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile.rules.windows b/Makefile.rules.windows index b68d23e..0a23d76 100644 --- a/Makefile.rules.windows +++ b/Makefile.rules.windows @@ -4,7 +4,7 @@ include Makefile.config USE_VFW = 1 TARGET = $(APP).exe CPP = g++ -CPPFLAGS = -ggdb -Wall -O0 `pkg-config --cflags gtk+-3.0 gmodule-export-2.0` -Wl,--export-dynamic -DBUILD_WINDOWS=1 -Wdeprecated -D_POSIX_C_SOURCE=200112L +CPPFLAGS = -ggdb -Wall -O0 `pkg-config --cflags gtk+-3.0 gmodule-export-2.0` -Wl,--export-dynamic -DBUILD_WINDOWS=1 -Wdeprecated -D_POSIX_C_SOURCE=200112L -lucrtbase INCLUDES = LDFLAGS = -lws2_32 -ljpeg LIBS = `pkg-config --libs gtk+-3.0 gmodule-export-2.0` -L/usr/lib -mwindows diff --git a/ser.cc b/ser.cc index 6c4309e..650c2f6 100644 --- a/ser.cc +++ b/ser.cc @@ -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; }