spice: Fix build failures
PATCH 1/1 spice: Fix build failures
From: He Zhe <[email protected]>
Backport 3cb746329ea4846bd9c65e0198e69423379b6f62 "Use PRI macros in printf to keep compatibility between 32/64bit system" from upstream to fix the following errors:
server/jpeg_encoder.c:639:17: error: format '%lu' expects argument of type 'long unsigned int', but argument 12 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=]
server/mjpeg_encoder.c:639:17: error: format '%lu' expects argument of type 'long unsigned int', but argument 13 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=]
server/mjpeg_encoder.c:706:21: error: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=]
server/mjpeg_encoder.c:706:21: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=]
server/mjpeg_encoder.c:936:75: error: integer overflow in expression [-Werror=overflow]
--- ...ros-in-printf-to-keep-compatibility-betwe.patch | 72 ++++++++++++++++++++++ recipes-support/spice/spice_git.bb | 1 + 2 files changed, 73 insertions(+) create mode 100644 recipes-support/spice/files/0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch
recipes-support/spice/files/0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch new file +72 -0
@@ -0,0 +1,72 @@ +From 3cb746329ea4846bd9c65e0198e69423379b6f62 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=EC=86=8C=EB=B3=91=EC=B2=A0?= <[email protected]> +Date: Thu, 24 Apr 2014 12:26:32 +0000 +Subject: [PATCH] Use PRI macros in printf to keep compatibility between + 32/64bit system + +gcc's some integer type definitions are different between 32/64bit system. +This causes platform dependency problem with printf function. However, +we can avoid this problem by using PRI macros that supports platform +independent printf. +--- + server/mjpeg_encoder.c | 7 ++++--- + server/red_worker.c | 4 ++-- + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c +index aea4964..f465d88 100644 +--- a/server/mjpeg_encoder.c ++++ b/server/mjpeg_encoder.c +@@ -23,6 +23,7 @@ + #include "mjpeg_encoder.h" + #include <jerror.h> + #include <jpeglib.h> ++#include <inttypes.h> + + #define MJPEG_MAX_FPS 25 + #define MJPEG_MIN_FPS 1 +@@ -66,7 +67,7 @@ static const int mjpeg_quality_samples[MJPEG_QUALITY_SAMPLE_NUM] = {20, 30, 40, + * are not necessarily related to mis-estimation of the bit rate, and we would + * like to wait till the stream stabilizes. + */ +-#define MJPEG_WARMUP_TIME 3000L // 3 sec ++#define MJPEG_WARMUP_TIME 3000LL // 3 sec + + enum { + MJPEG_QUALITY_EVAL_TYPE_SET, +@@ -638,7 +639,7 @@ static void mjpeg_encoder_adjust_params_to_bit_rate(MJpegEncoder *encoder) + + spice_debug("cur-fps=%u new-fps=%u (new/old=%.2f) |" + "bit-rate=%.2f (Mbps) latency=%u (ms) quality=%d |" +- " new-size-avg %lu , base-size %lu, (new/old=%.2f) ", ++ " new-size-avg %"PRIu64" , base-size %"PRIu64", (new/old=%.2f) ", + rate_control->fps, new_fps, ((double)new_fps)/rate_control->fps, + ((double)rate_control->byte_rate*8)/1024/1024, + latency, +@@ -703,7 +704,7 @@ static void mjpeg_encoder_adjust_fps(MJpegEncoder *encoder, uint64_t now) + + avg_fps = ((double)rate_control->adjusted_fps_num_frames*1000) / + adjusted_fps_time_passed; +- spice_debug("#frames-adjust=%lu #adjust-time=%lu avg-fps=%.2f", ++ spice_debug("#frames-adjust=%"PRIu64" #adjust-time=%"PRIu64" avg-fps=%.2f", + rate_control->adjusted_fps_num_frames, adjusted_fps_time_passed, avg_fps); + spice_debug("defined=%u old-adjusted=%.2f", rate_control->fps, rate_control->adjusted_fps); + fps_ratio = avg_fps / rate_control->fps; +diff --git a/server/red_worker.c b/server/red_worker.c +index 619f7bc..1871e13 100644 +--- a/server/red_worker.c ++++ b/server/red_worker.c +@@ -2594,8 +2594,8 @@ static void red_print_stream_stats(DisplayChannelClient *dcc, StreamAgent *agent + mjpeg_encoder_get_stats(agent->mjpeg_encoder, &encoder_stats); + } + +- spice_debug("stream=%ld dim=(%dx%d) #in-frames=%lu #in-avg-fps=%.2f #out-frames=%lu " +- "out/in=%.2f #drops=%lu (#pipe=%lu #fps=%lu) out-avg-fps=%.2f " ++ spice_debug("stream=%"PRIdPTR" dim=(%dx%d) #in-frames=%"PRIu64" #in-avg-fps=%.2f #out-frames=%"PRIu64" " ++ "out/in=%.2f #drops=%"PRIu64" (#pipe=%"PRIu64" #fps=%"PRIu64") out-avg-fps=%.2f " + "passed-mm-time(sec)=%.2f size-total(MB)=%.2f size-per-sec(Mbps)=%.2f " + "size-per-frame(KBpf)=%.2f avg-quality=%.2f " + "start-bit-rate(Mbps)=%.2f end-bit-rate(Mbps)=%.2f", +-- +2.10.2 +
recipes-support/spice/spice_git.bb +1 -0
@@ -36,6 +36,7 @@ SRC_URI += " \ file://configure.ac-add-subdir-objects-to-AM_INIT_AUTOMAKE.patch \ file://build-allow-separated-src-and-build-dirs.patch \ file://0001-red_parse_qxl-Fix-BITMAP_FMT_IS_RGB-defined-but-not-.patch \ + file://0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch \ " S = "${WORKDIR}/git"
Signature · 1 line
2.8.1
Actually this is for meta-cloud-services.
Quoted 122 lines · On 2017年07月24日 11:27, [email protected] wrote:
From: He Zhe <[email protected]>
Backport
3cb746329ea4846bd9c65e0198e69423379b6f62"Use PRI macros in printf to keep compatibility between 32/64bit system" from upstream to fix the following errors:
server/jpeg_encoder.c:639:17: error: format '%lu' expects argument of type 'long unsigned int', but argument 12 has type 'uint64_t{aka long long unsigned int}' [-Werror=format=]
server/mjpeg_encoder.c:639:17: error: format '%lu' expects argument of type 'long unsigned int', but argument 13 has type 'uint64_t{aka long long unsigned int}' [-Werror=format=]
server/mjpeg_encoder.c:706:21: error: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'uint64_t{aka long long unsigned int}' [-Werror=format=]
server/mjpeg_encoder.c:706:21: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'uint64_t{aka long long unsigned int}' [-Werror=format=]
server/mjpeg_encoder.c:936:75: error: integer overflow in expression [-Werror=overflow]Signed-off-by He Zhe <[email protected]>--- ...ros-in-printf-to-keep-compatibility-betwe.patch | 72 ++++++++++++++++++++++ recipes-support/spice/spice_git.bb | 1 + 2 files changed, 73 insertions(+) create mode 100644 recipes-support/spice/files/0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patchrecipes-support/spice/files/0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch new file +72
-0@@ -0,0 +1,72 @@ +From 3cb746329ea4846bd9c65e0198e69423379b6f62 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=EC=86=8C=EB=B3=91=EC=B2=A0?= <[email protected]> +Date: Thu, 24 Apr 2014 12:26:32 +0000 +Subject: [PATCH] Use PRI macros in printf to keep compatibility between + 32/64bit system + +gcc's some integer type definitions are different between 32/64bit system. +This causes platform dependency problem with printf function. However, +we can avoid this problem by using PRI macros that supports platform +independent printf. +--- + server/mjpeg_encoder.c | 7 ++++--- + server/red_worker.c | 4 ++-- + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c +index aea4964..f465d88 100644 +--- a/server/mjpeg_encoder.c ++++ b/server/mjpeg_encoder.c +@@ -23,6 +23,7 @@ + #include "mjpeg_encoder.h" + #include <jerror.h> + #include <jpeglib.h> ++#include <inttypes.h> + + #define MJPEG_MAX_FPS 25 + #define MJPEG_MIN_FPS 1 +@@ -66,7 +67,7 @@ static const int mjpeg_quality_samples[MJPEG_QUALITY_SAMPLE_NUM] = {20, 30, 40, + * are not necessarily related to mis-estimation of the bit rate, and we would + * like to wait till the stream stabilizes. + */ +-#define MJPEG_WARMUP_TIME 3000L // 3 sec ++#define MJPEG_WARMUP_TIME 3000LL // 3 sec + + enum { + MJPEG_QUALITY_EVAL_TYPE_SET, +@@ -638,7 +639,7 @@ static void mjpeg_encoder_adjust_params_to_bit_rate(MJpegEncoder *encoder) + + spice_debug("cur-fps=%u new-fps=%u (new/old=%.2f) |" + "bit-rate=%.2f (Mbps) latency=%u (ms) quality=%d |" +- " new-size-avg %lu , base-size %lu, (new/old=%.2f) ", ++ " new-size-avg %"PRIu64" , base-size %"PRIu64", (new/old=%.2f) ", + rate_control->fps, new_fps, ((double)new_fps)/rate_control->fps, + ((double)rate_control->byte_rate*8)/1024/1024, + latency, +@@ -703,7 +704,7 @@ static void mjpeg_encoder_adjust_fps(MJpegEncoder *encoder, uint64_t now) + + avg_fps = ((double)rate_control->adjusted_fps_num_frames*1000) / + adjusted_fps_time_passed; +- spice_debug("#frames-adjust=%lu #adjust-time=%lu avg-fps=%.2f", ++ spice_debug("#frames-adjust=%"PRIu64" #adjust-time=%"PRIu64" avg-fps=%.2f", + rate_control->adjusted_fps_num_frames, adjusted_fps_time_passed, avg_fps); + spice_debug("defined=%u old-adjusted=%.2f", rate_control->fps, rate_control->adjusted_fps); + fps_ratio = avg_fps / rate_control->fps; +diff --git a/server/red_worker.c b/server/red_worker.c +index 619f7bc..1871e13 100644 +--- a/server/red_worker.c ++++ b/server/red_worker.c +@@ -2594,8 +2594,8 @@ static void red_print_stream_stats(DisplayChannelClient *dcc, StreamAgent *agent + mjpeg_encoder_get_stats(agent->mjpeg_encoder, &encoder_stats); + } + +- spice_debug("stream=%ld dim=(%dx%d) #in-frames=%lu #in-avg-fps=%.2f #out-frames=%lu " +- "out/in=%.2f #drops=%lu (#pipe=%lu #fps=%lu) out-avg-fps=%.2f " ++ spice_debug("stream=%"PRIdPTR" dim=(%dx%d) #in-frames=%"PRIu64" #in-avg-fps=%.2f #out-frames=%"PRIu64" " ++ "out/in=%.2f #drops=%"PRIu64" (#pipe=%"PRIu64" #fps=%"PRIu64") out-avg-fps=%.2f " + "passed-mm-time(sec)=%.2f size-total(MB)=%.2f size-per-sec(Mbps)=%.2f " + "size-per-frame(KBpf)=%.2f avg-quality=%.2f " + "start-bit-rate(Mbps)=%.2f end-bit-rate(Mbps)=%.2f", +-- +2.10.2 +recipes-support/spice/spice_git.bb +1
-0@@ -36,6 +36,7 @@ SRC_URI += " \ file://configure.ac-add-subdir-objects-to-AM_INIT_AUTOMAKE.patch \ file://build-allow-separated-src-and-build-dirs.patch \ file://0001-red_parse_qxl-Fix-BITMAP_FMT_IS_RGB-defined-but-not-.patch \ + file://0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch \ " S = "${WORKDIR}/git"
merged.
Bruce
Quoted 170 lines · He Zhe
Actually this is for meta-cloud-services.
Quoted 3 lines · On 2017年07月24日 11:27, [email protected] wrote:
From: He Zhe <[email protected]>
Backport
3cb746329ea4846bd9c65e0198e69423379b6f62"Use PRI macros inprintf to
Quoted 1 line
keep compatibility between 32/64bit system" from upstream to fix the
following
Quoted 3 lines
errors:
server/jpeg_encoder.c:639:17: error: format '%lu' expects argument oftype 'long
Quoted 1 line
unsigned int', but argument 12 has type '
uint64_t{aka long longunsigned int}'
Quoted 3 lines
[-Werror=format=]
server/mjpeg_encoder.c:639:17: error: format '%lu' expects argument oftype
Quoted 1 line
'long unsigned int', but argument 13 has type '
uint64_t{aka long longunsigned
Quoted 3 lines
int}' [-Werror=format=]
server/mjpeg_encoder.c:706:21: error: format '%lu' expects argument oftype
Quoted 1 line
'long unsigned int', but argument 6 has type '
uint64_t{aka long longunsigned
Quoted 3 lines
int}' [-Werror=format=]
server/mjpeg_encoder.c:706:21: error: format '%lu' expects argument oftype
Quoted 1 line
'long unsigned int', but argument 7 has type '
uint64_t{aka long longunsigned
Quoted 8 lines
int}' [-Werror=format=]
server/mjpeg_encoder.c:936:75: error: integer overflow in expression [-Werror=overflow]Signed-off-by He Zhe <[email protected]>--- ...ros-in-printf-to-keep-compatibility-betwe.patch | 72++++++++++++++++++++++
Quoted 3 lines
recipes-support/spice/spice_git.bb | 1 + 2 files changed, 73 insertions(+) create mode 100644 recipes-support/spice/files/0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch
Review
Quoted 2 lines
(quoted diff) +0
-0to-keep-compatibility-betwe.patch b/recipes-support/spice/files/ 0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch
recipes-support/spice/files/0001-Use-PRI-macros-in-printf-
Quoted 4 lines
new file mode 100644
index 0000000..18fa8farecipes-support/spice/files/0001-Use-PRI-macros-in-printf- new file +0
-0to-keep-compatibility-betwe.patch
recipes-support/spice/files/0001-Use-PRI-macros-in-printf-
Quoted 9 lines
recipes-support/spice/files/0001-Use-PRI-macros-in-printf- new file +7
-0@@ -0,0 +1,72 @@ +From 3cb746329ea4846bd9c65e0198e69423379b6f62 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=EC=86=8C=EB=B3=91=EC=B2=A0?= <[email protected] +Date: Thu, 24 Apr 2014 12:26:32 +0000 +Subject: [PATCH] Use PRI macros in printf to keep compatibility between + 32/64bit system + +gcc's some integer type definitions are different between 32/64bitsystem.
Quoted 11 lines
recipes-support/spice/files/0001-Use-PRI-macros-in-printf- new file +11
-0+This causes platform dependency problem with printf function. However, +we can avoid this problem by using PRI macros that supports platform +independent printf. +--- + server/mjpeg_encoder.c | 7 ++++--- + server/red_worker.c | 4 ++-- + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c +index aea4964..f465d88 100644 +--- a/server/mjpeg_encoder.crecipes-support/spice/files/0001-Use-PRI-macros-in-printf-
Quoted 10 lines
recipes-support/spice/files/0001-Use-PRI-macros-in-printf- new file +10
-0++++ b/server/mjpeg_encoder.c +@@ -23,6 +23,7 @@ + #include "mjpeg_encoder.h" + #include <jerror.h> + #include <jpeglib.h> ++#include <inttypes.h> + + #define MJPEG_MAX_FPS 25 + #define MJPEG_MIN_FPS 1 +@@ -66,7 +67,7 @@ static const int mjpeg_quality_samples[MJPEG_QUALITY_SAMPLE_NUM]= {20, 30, 40,
Quoted 1 line
+ * are not necessarily related to mis-estimation of the bit rate, and
we would
recipes-support/spice/files/0001-Use-PRI-macros-in-printf-
Quoted 8 lines
recipes-support/spice/files/0001-Use-PRI-macros-in-printf- new file +8
-0+ * like to wait till the stream stabilizes. + */ +-#define MJPEG_WARMUP_TIME 3000L // 3 sec ++#define MJPEG_WARMUP_TIME 3000LL // 3 sec + + enum { + MJPEG_QUALITY_EVAL_TYPE_SET, +@@ -638,7 +639,7 @@ static void mjpeg_encoder_adjust_params_to_bit_rate(MJpegEncoder*encoder)
recipes-support/spice/files/0001-Use-PRI-macros-in-printf-
Quoted 5 lines
recipes-support/spice/files/0001-Use-PRI-macros-in-printf- new file +5
-0+ + spice_debug("cur-fps=%u new-fps=%u (new/old=%.2f) |" + "bit-rate=%.2f (Mbps) latency=%u (ms) quality=%d |" +- " new-size-avg %lu , base-size %lu, (new/old=%.2f) ", ++ " new-size-avg %"PRIu64" , base-size %"PRIu64",(new/old=%.2f) ",
Quoted 1 line
+
rate_control->fps,new_fps, ((double)new_fps)/rate_
control->fps,recipes-support/spice/files/0001-Use-PRI-macros-in-printf-
Quoted 3 lines
recipes-support/spice/files/0001-Use-PRI-macros-in-printf- new file +3
-0+ ((double)rate_control->byte_rate*8)/1024/1024, + latency, +@@ -703,7 +704,7 @@ static void mjpeg_encoder_adjust_fps(MJpegEncoder*encoder,
uint64_tnow)recipes-support/spice/files/0001-Use-PRI-macros-in-printf-
Quoted 2 lines
recipes-support/spice/files/0001-Use-PRI-macros-in-printf- new file +2
-0+ + avg_fps = ((double)rate_control->adjusted_fps_num_frames*1000)/
Quoted 2 lines
+
adjusted_fps_time_passed;
+- spice_debug("#frames-adjust=%lu #adjust-time=%luavg-fps=%.2f",
Quoted 1 line
++ spice_debug("#frames-adjust=%"PRIu64" #adjust-time=%"PRIu64"
avg-fps=%.2f",
Quoted 1 line
+
rate_control->adjusted_fps_num_frames,
adjusted_fps_time_passed,avg_fps);Quoted 1 line
+ spice_debug("defined=%u old-adjusted=%.2f",
rate_control->fps,
rate_control->adjusted_fps);recipes-support/spice/files/0001-Use-PRI-macros-in-printf-
Quoted 6 lines
recipes-support/spice/files/0001-Use-PRI-macros-in-printf- new file +6
-0+ fps_ratio = avg_fps / rate_control->fps; +diff --git a/server/red_worker.c b/server/red_worker.c +index 619f7bc..1871e13 100644 +--- a/server/red_worker.c ++++ b/server/red_worker.c +@@ -2594,8 +2594,8 @@ static void red_print_stream_stats(DisplayChannelClient*dcc, StreamAgent *agent
recipes-support/spice/files/0001-Use-PRI-macros-in-printf-
Quoted 4 lines
recipes-support/spice/files/0001-Use-PRI-macros-in-printf- new file +4
-0+ mjpeg_encoder_get_stats(agent->mjpeg_encoder, &encoder_stats); + } + +- spice_debug("stream=%ld dim=(%dx%d) #in-frames=%lu#in-avg-fps=%.2f #out-frames=%lu "
Quoted 1 line
+- "out/in=%.2f #drops=%lu (#pipe=%lu #fps=%lu)
out-avg-fps=%.2f "
Quoted 1 line
++ spice_debug("stream=%"PRIdPTR" dim=(%dx%d) #in-frames=%"PRIu64"
#in-avg-fps=%.2f #out-frames=%"PRIu64" "
Quoted 1 line
++ "out/in=%.2f #drops=%"PRIu64" (#pipe=%"PRIu64"
#fps=%"PRIu64") out-avg-fps=%.2f "
Quoted 1 line
+ "passed-mm-time(sec)=%.2f size-total(MB)=%.2f
size-per-sec(Mbps)=%.2f "
recipes-support/spice/
Quoted 6 lines
recipes-support/spice/files/0001-Use-PRI-macros-in-printf- new file +5
-0+ "size-per-frame(KBpf)=%.2f avg-quality=%.2f " + "start-bit-rate(Mbps)=%.2f end-bit-rate(Mbps)=%.2f", +-- +2.10.2 +recipes-support/spice/ renamed from recipes-support/spice/spice_git.bb +0
-0spice_git.bb
recipes-support/spice/spice_git.bb SRC_URI += " \ · line 36
Quoted 5 lines
index 6f1be3a..cf5c569 100644
recipes-support/spice/spice_git.bb +0
-0@@ -36,6 +36,7 @@ SRC_URI += " \ file://configure.ac-add-subdir-objects-to-AM_INIT_AUTOMAKE.patch\
recipes-support/spice/spice_git.bb SRC_URI += " \ · line 38
Quoted 2 lines
recipes-support/spice/spice_git.bb +0
-0file://build-allow-separated-src-and-build-dirs.patch \ file://0001-red_parse_qxl-Fix-BITMAP_FMT_IS_RGB-defined-but-not-.patch\
recipes-support/spice/spice_git.bb SRC_URI += " \ · line 39
Quoted 1 line
recipes-support/spice/spice_git.bb +1
-0+ file://0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch\
recipes-support/spice/spice_git.bb SRC_URI += " \ · line 42
Quoted 3 lines
recipes-support/spice/spice_git.bb +0
-0" S = "${WORKDIR}/git"--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization
Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"