0003-Static-cast-to-unsigned-int-for-cases.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. From a5ca35b044bbf13c0b16f0066bf24646604bb218 Mon Sep 17 00:00:00 2001
  2. From: "Jason A. Donenfeld" <Jason@zx2c4.com>
  3. Date: Thu, 6 Aug 2020 15:22:04 +0200
  4. Subject: [PATCH] Static cast to unsigned int for cases
  5. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
  6. [Retrieved from:
  7. https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/libmp4v2/files/libmp4v2-2.0.0-unsigned-int-cast.patch]
  8. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  9. ---
  10. libutil/Utility.cpp | 2 +-
  11. util/mp4art.cpp | 2 +-
  12. util/mp4chaps.cpp | 2 +-
  13. util/mp4file.cpp | 2 +-
  14. util/mp4subtitle.cpp | 2 +-
  15. util/mp4track.cpp | 2 +-
  16. 6 files changed, 6 insertions(+), 6 deletions(-)
  17. diff --git a/libutil/Utility.cpp b/libutil/Utility.cpp
  18. index 76cdd12..d6739d4 100644
  19. --- a/libutil/Utility.cpp
  20. +++ b/libutil/Utility.cpp
  21. @@ -493,7 +493,7 @@ Utility::process_impl()
  22. if( codes.find( code ) == codes.end() )
  23. continue;
  24. - switch( code ) {
  25. + switch( static_cast<unsigned int>( code ) ) {
  26. case 'z':
  27. _optimize = true;
  28. break;
  29. diff --git a/util/mp4art.cpp b/util/mp4art.cpp
  30. index add935e..6e7f531 100644
  31. --- a/util/mp4art.cpp
  32. +++ b/util/mp4art.cpp
  33. @@ -376,7 +376,7 @@ ArtUtility::utility_option( int code, bool& handled )
  34. {
  35. handled = true;
  36. - switch( code ) {
  37. + switch( static_cast<unsigned int> ( code ) ) {
  38. case LC_ART_ANY:
  39. _artFilter = numeric_limits<uint32_t>::max();
  40. break;
  41. diff --git a/util/mp4chaps.cpp b/util/mp4chaps.cpp
  42. index 98400f8..ccc8b70 100644
  43. --- a/util/mp4chaps.cpp
  44. +++ b/util/mp4chaps.cpp
  45. @@ -632,7 +632,7 @@ ChapterUtility::utility_option( int code, bool& handled )
  46. {
  47. handled = true;
  48. - switch( code ) {
  49. + switch( static_cast<unsigned int> ( code ) ) {
  50. case 'A':
  51. case LC_CHPT_ANY:
  52. _ChapterType = MP4ChapterTypeAny;
  53. diff --git a/util/mp4file.cpp b/util/mp4file.cpp
  54. index c27844b..b127cd1 100644
  55. --- a/util/mp4file.cpp
  56. +++ b/util/mp4file.cpp
  57. @@ -189,7 +189,7 @@ FileUtility::utility_option( int code, bool& handled )
  58. {
  59. handled = true;
  60. - switch( code ) {
  61. + switch( static_cast<unsigned int>( code ) ) {
  62. case LC_LIST:
  63. _action = &FileUtility::actionList;
  64. break;
  65. diff --git a/util/mp4subtitle.cpp b/util/mp4subtitle.cpp
  66. index 7462153..19d977d 100644
  67. --- a/util/mp4subtitle.cpp
  68. +++ b/util/mp4subtitle.cpp
  69. @@ -164,7 +164,7 @@ SubtitleUtility::utility_option( int code, bool& handled )
  70. {
  71. handled = true;
  72. - switch( code ) {
  73. + switch( static_cast<unsigned int>( code ) ) {
  74. case LC_LIST:
  75. _action = &SubtitleUtility::actionList;
  76. break;
  77. diff --git a/util/mp4track.cpp b/util/mp4track.cpp
  78. index d550506..cd63d7e 100644
  79. --- a/util/mp4track.cpp
  80. +++ b/util/mp4track.cpp
  81. @@ -788,7 +788,7 @@ TrackUtility::utility_option( int code, bool& handled )
  82. {
  83. handled = true;
  84. - switch( code ) {
  85. + switch( static_cast<unsigned int>( code ) ) {
  86. case LC_TRACK_WILDCARD:
  87. _trackMode = TM_WILDCARD;
  88. break;
  89. --
  90. 2.28.0