0001-sconex-Descriptor.cpp-fix-build-with-gcc-11.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From 5e4cb613d9bb287e9f54da86f99a51d0338b1faa Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Tue, 10 Aug 2021 10:36:53 +0200
  4. Subject: [PATCH] sconex/Descriptor.cpp: fix build with gcc 11
  5. Fix the following build failure with gcc 11:
  6. In file included from ../sconex/sconex.h:229,
  7. from ../sconex/Descriptor.h:63,
  8. from Descriptor.cpp:22:
  9. Descriptor.cpp: In member function 'void scx::Descriptor::add_stream(scx::Stream*)':
  10. Descriptor.cpp:150:22: error: ordered comparison of pointer with integer zero ('scx::Stream*' and 'int')
  11. 150 | DEBUG_ASSERT(stream>=0,"add_stream() Invalid stream");
  12. | ~~~~~~^~~
  13. | ^~~~
  14. Descriptor.cpp: In member function 'bool scx::Descriptor::remove_stream(scx::Stream*)':
  15. Descriptor.cpp:204:22: error: ordered comparison of pointer with integer zero ('scx::Stream*' and 'int')
  16. 204 | DEBUG_ASSERT(stream>=0,"remove_stream() Invalid stream");
  17. | ~~~~~~^~~
  18. Fixes:
  19. - http://autobuild.buildroot.org/results/ccc9562e83fd2bd312d21b3124be42dfe4b7e850
  20. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  21. [Upstream status: https://github.com/sconemad/sconeserver/pull/4]
  22. ---
  23. sconex/Descriptor.cpp | 4 ++--
  24. 1 file changed, 2 insertions(+), 2 deletions(-)
  25. diff --git a/sconex/Descriptor.cpp b/sconex/Descriptor.cpp
  26. index 590adba..4adfd86 100644
  27. --- a/sconex/Descriptor.cpp
  28. +++ b/sconex/Descriptor.cpp
  29. @@ -147,7 +147,7 @@ bool Descriptor::dup(int d)
  30. //=============================================================================
  31. void Descriptor::add_stream(Stream* stream)
  32. {
  33. - DEBUG_ASSERT(stream>=0,"add_stream() Invalid stream");
  34. + DEBUG_ASSERT(stream!=0,"add_stream() Invalid stream");
  35. m_streams.push_back(stream);
  36. stream->set_endpoint(this);
  37. @@ -201,7 +201,7 @@ void Descriptor::add_stream_after(Stream* stream,const Stream* after)
  38. //=============================================================================
  39. bool Descriptor::remove_stream(Stream* stream)
  40. {
  41. - DEBUG_ASSERT(stream>=0,"remove_stream() Invalid stream");
  42. + DEBUG_ASSERT(stream!=0,"remove_stream() Invalid stream");
  43. std::list<Stream*>::iterator it = m_streams.begin();
  44. while (it != m_streams.end()) {
  45. --
  46. 2.30.2