Remove all #include <assert.h>/<cassert> and usage in Obj-C code.

This CL completes the removal of assert() and relative headers from
the codebase (excluded
//examples/objc/AppRTCMobile/third_party/SocketRocket which is in a
third_party sub-directory).

Bug: webrtc:6779
Change-Id: I93ed57168d2c0e011626873d66529488c5f484f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225546
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34528}
This commit is contained in:
Mirko Bonadei 2021-07-09 15:56:57 +02:00 committed by WebRTC LUCI CQ
parent 0e62f7aa98
commit 190244bb59
59 changed files with 12 additions and 67 deletions

View File

@ -10,7 +10,6 @@
#include "api/audio_codecs/audio_decoder.h" #include "api/audio_codecs/audio_decoder.h"
#include <assert.h>
#include <memory> #include <memory>
#include <utility> #include <utility>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/acm2/acm_resampler.h" #include "modules/audio_coding/acm2/acm_resampler.h"
#include <assert.h>
#include <string.h> #include <string.h>
#include "rtc_base/logging.h" #include "rtc_base/logging.h"

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/acm2/acm_send_test.h" #include "modules/audio_coding/acm2/acm_send_test.h"
#include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/include/audio_coding_module.h" #include "modules/audio_coding/include/audio_coding_module.h"
#include <assert.h>
#include <algorithm> #include <algorithm>
#include <cstdint> #include <cstdint>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/accelerate.h" #include "modules/audio_coding/neteq/accelerate.h"
#include <assert.h>
#include "api/array_view.h" #include "api/array_view.h"
#include "modules/audio_coding/neteq/audio_multi_vector.h" #include "modules/audio_coding/neteq/audio_multi_vector.h"

View File

@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <array> #include <array>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/audio_multi_vector.h" #include "modules/audio_coding/neteq/audio_multi_vector.h"
#include <assert.h>
#include <algorithm> #include <algorithm>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/audio_vector.h" #include "modules/audio_coding/neteq/audio_vector.h"
#include <assert.h>
#include <algorithm> #include <algorithm>
#include <memory> #include <memory>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/background_noise.h" #include "modules/audio_coding/neteq/background_noise.h"
#include <assert.h>
#include <string.h> // memcpy #include <string.h> // memcpy
#include <algorithm> // min, max #include <algorithm> // min, max

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/comfort_noise.h" #include "modules/audio_coding/neteq/comfort_noise.h"
#include <assert.h>
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/decision_logic.h" #include "modules/audio_coding/neteq/decision_logic.h"
#include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/delay_manager.h" #include "modules/audio_coding/neteq/delay_manager.h"
#include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/dsp_helper.h" #include "modules/audio_coding/neteq/dsp_helper.h"
#include <assert.h>
#include <string.h> // Access to memset. #include <string.h> // Access to memset.
#include <algorithm> // Access to min, max. #include <algorithm> // Access to min, max.

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/expand.h" #include "modules/audio_coding/neteq/expand.h"
#include <assert.h>
#include <string.h> // memset #include <string.h> // memset
#include <algorithm> // min, max #include <algorithm> // min, max

View File

@ -11,7 +11,6 @@
#ifndef MODULES_AUDIO_CODING_NETEQ_EXPAND_H_ #ifndef MODULES_AUDIO_CODING_NETEQ_EXPAND_H_
#define MODULES_AUDIO_CODING_NETEQ_EXPAND_H_ #define MODULES_AUDIO_CODING_NETEQ_EXPAND_H_
#include <assert.h>
#include <memory> #include <memory>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/merge.h" #include "modules/audio_coding/neteq/merge.h"
#include <assert.h>
#include <string.h> // memmove, memcpy, memset, size_t #include <string.h> // memmove, memcpy, memset, size_t
#include <algorithm> // min, max #include <algorithm> // min, max

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/nack_tracker.h" #include "modules/audio_coding/neteq/nack_tracker.h"
#include <assert.h>
#include <cstdint> #include <cstdint>
#include <utility> #include <utility>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/neteq_impl.h" #include "modules/audio_coding/neteq/neteq_impl.h"
#include <assert.h>
#include <algorithm> #include <algorithm>
#include <cstdint> #include <cstdint>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/red_payload_splitter.h" #include "modules/audio_coding/neteq/red_payload_splitter.h"
#include <assert.h>
#include <stddef.h> #include <stddef.h>
#include <cstdint> #include <cstdint>

View File

@ -12,7 +12,6 @@
#include "modules/audio_coding/neteq/red_payload_splitter.h" #include "modules/audio_coding/neteq/red_payload_splitter.h"
#include <assert.h>
#include <memory> #include <memory>
#include <utility> // pair #include <utility> // pair

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/statistics_calculator.h" #include "modules/audio_coding/neteq/statistics_calculator.h"
#include <assert.h>
#include <string.h> // memset #include <string.h> // memset
#include <algorithm> #include <algorithm>

View File

@ -11,7 +11,6 @@
#ifndef MODULES_AUDIO_CODING_NETEQ_TIME_STRETCH_H_ #ifndef MODULES_AUDIO_CODING_NETEQ_TIME_STRETCH_H_
#define MODULES_AUDIO_CODING_NETEQ_TIME_STRETCH_H_ #define MODULES_AUDIO_CODING_NETEQ_TIME_STRETCH_H_
#include <assert.h>
#include <string.h> // memset, size_t #include <string.h> // memset, size_t
#include "modules/audio_coding/neteq/audio_multi_vector.h" #include "modules/audio_coding/neteq/audio_multi_vector.h"

View File

@ -11,7 +11,6 @@
#ifndef MODULES_AUDIO_CODING_NETEQ_TOOLS_OUTPUT_AUDIO_FILE_H_ #ifndef MODULES_AUDIO_CODING_NETEQ_TOOLS_OUTPUT_AUDIO_FILE_H_
#define MODULES_AUDIO_CODING_NETEQ_TOOLS_OUTPUT_AUDIO_FILE_H_ #define MODULES_AUDIO_CODING_NETEQ_TOOLS_OUTPUT_AUDIO_FILE_H_
#include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>

View File

@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <memory> #include <memory>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/tools/rtp_file_source.h" #include "modules/audio_coding/neteq/tools/rtp_file_source.h"
#include <assert.h>
#include <string.h> #include <string.h>
#ifndef WIN32 #ifndef WIN32
#include <netinet/in.h> #include <netinet/in.h>

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/tools/rtp_generator.h" #include "modules/audio_coding/neteq/tools/rtp_generator.h"
#include <assert.h>
namespace webrtc { namespace webrtc {
namespace test { namespace test {

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/test/Channel.h" #include "modules/audio_coding/test/Channel.h"
#include <assert.h>
#include <iostream> #include <iostream>

View File

@ -10,7 +10,6 @@
#include "modules/audio_device/linux/audio_device_alsa_linux.h" #include "modules/audio_device/linux/audio_device_alsa_linux.h"
#include <assert.h>
#include "modules/audio_device/audio_device_config.h" #include "modules/audio_device/audio_device_config.h"
#include "rtc_base/logging.h" #include "rtc_base/logging.h"

View File

@ -25,7 +25,6 @@
#include "modules/audio_device/win/audio_device_core_win.h" #include "modules/audio_device/win/audio_device_core_win.h"
#include <assert.h>
#include <string.h> #include <string.h>
#include <comdef.h> #include <comdef.h>

View File

@ -14,6 +14,8 @@
#include <algorithm> #include <algorithm>
#include <Cocoa/Cocoa.h> #include <Cocoa/Cocoa.h>
#include "rtc_base/checks.h"
#if !defined(MAC_OS_X_VERSION_10_7) || \ #if !defined(MAC_OS_X_VERSION_10_7) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
@ -40,7 +42,7 @@ DesktopRect NSRectToDesktopRect(const NSRect& ns_rect) {
// relative to |bounds|. // relative to |bounds|.
void InvertRectYOrigin(const DesktopRect& bounds, void InvertRectYOrigin(const DesktopRect& bounds,
DesktopRect* rect) { DesktopRect* rect) {
assert(bounds.top() == 0); RTC_DCHECK_EQ(bounds.top(), 0);
*rect = DesktopRect::MakeXYWH( *rect = DesktopRect::MakeXYWH(
rect->left(), bounds.bottom() - rect->bottom(), rect->left(), bounds.bottom() - rect->bottom(),
rect->width(), rect->height()); rect->width(), rect->height());
@ -106,7 +108,7 @@ MacDesktopConfiguration MacDesktopConfiguration::GetCurrent(Origin origin) {
MacDesktopConfiguration desktop_config; MacDesktopConfiguration desktop_config;
NSArray* screens = [NSScreen screens]; NSArray* screens = [NSScreen screens];
assert(screens); RTC_DCHECK(screens);
// Iterator over the monitors, adding the primary monitor and monitors whose // Iterator over the monitors, adding the primary monitor and monitors whose
// DPI match that of the primary monitor. // DPI match that of the primary monitor.

View File

@ -10,7 +10,6 @@
#include "modules/desktop_capture/mouse_cursor_monitor.h" #include "modules/desktop_capture/mouse_cursor_monitor.h"
#include <assert.h>
#include <memory> #include <memory>
@ -26,6 +25,7 @@
#include "modules/desktop_capture/mac/desktop_configuration_monitor.h" #include "modules/desktop_capture/mac/desktop_configuration_monitor.h"
#include "modules/desktop_capture/mac/window_list_utils.h" #include "modules/desktop_capture/mac/window_list_utils.h"
#include "modules/desktop_capture/mouse_cursor.h" #include "modules/desktop_capture/mouse_cursor.h"
#include "rtc_base/checks.h"
namespace webrtc { namespace webrtc {
@ -88,21 +88,21 @@ MouseCursorMonitorMac::MouseCursorMonitorMac(const DesktopCaptureOptions& option
screen_id_(screen_id), screen_id_(screen_id),
callback_(NULL), callback_(NULL),
mode_(SHAPE_AND_POSITION) { mode_(SHAPE_AND_POSITION) {
assert(window_id == kCGNullWindowID || screen_id == kInvalidScreenId); RTC_DCHECK(window_id == kCGNullWindowID || screen_id == kInvalidScreenId);
} }
MouseCursorMonitorMac::~MouseCursorMonitorMac() {} MouseCursorMonitorMac::~MouseCursorMonitorMac() {}
void MouseCursorMonitorMac::Init(Callback* callback, Mode mode) { void MouseCursorMonitorMac::Init(Callback* callback, Mode mode) {
assert(!callback_); RTC_DCHECK(!callback_);
assert(callback); RTC_DCHECK(callback);
callback_ = callback; callback_ = callback;
mode_ = mode; mode_ = mode;
} }
void MouseCursorMonitorMac::Capture() { void MouseCursorMonitorMac::Capture() {
assert(callback_); RTC_DCHECK(callback_);
CGEventRef event = CGEventCreate(NULL); CGEventRef event = CGEventCreate(NULL);
CGPoint gc_position = CGEventGetLocation(event); CGPoint gc_position = CGEventGetLocation(event);

View File

@ -10,7 +10,6 @@
#include "modules/desktop_capture/mouse_cursor_monitor.h" #include "modules/desktop_capture/mouse_cursor_monitor.h"
#include <assert.h>
#include <stddef.h> #include <stddef.h>
#include <memory> #include <memory>

View File

@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include <assert.h>
#include <string.h> #include <string.h>
#include <memory> #include <memory>

View File

@ -10,7 +10,6 @@
#include "modules/desktop_capture/screen_capturer_helper.h" #include "modules/desktop_capture/screen_capturer_helper.h"
#include <assert.h>
namespace webrtc { namespace webrtc {

View File

@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include <assert.h>
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
#include <Cocoa/Cocoa.h> #include <Cocoa/Cocoa.h>
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
@ -24,6 +23,7 @@
#include "modules/desktop_capture/mac/desktop_frame_cgimage.h" #include "modules/desktop_capture/mac/desktop_frame_cgimage.h"
#include "modules/desktop_capture/mac/window_list_utils.h" #include "modules/desktop_capture/mac/window_list_utils.h"
#include "modules/desktop_capture/window_finder_mac.h" #include "modules/desktop_capture/window_finder_mac.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h" #include "rtc_base/constructor_magic.h"
#include "rtc_base/logging.h" #include "rtc_base/logging.h"
#include "rtc_base/trace_event.h" #include "rtc_base/trace_event.h"
@ -142,8 +142,8 @@ bool WindowCapturerMac::IsOccluded(const DesktopVector& pos) {
} }
void WindowCapturerMac::Start(Callback* callback) { void WindowCapturerMac::Start(Callback* callback) {
assert(!callback_); RTC_DCHECK(!callback_);
assert(callback); RTC_DCHECK(callback);
callback_ = callback; callback_ = callback;
} }

View File

@ -13,7 +13,6 @@
#include <inttypes.h> #include <inttypes.h>
#include <algorithm> #include <algorithm>
#include <cassert>
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
#include <string> #include <string>

View File

@ -10,8 +10,6 @@
#include "modules/remote_bitrate_estimator/inter_arrival.h" #include "modules/remote_bitrate_estimator/inter_arrival.h"
#include <cassert>
#include "modules/include/module_common_types_public.h" #include "modules/include/module_common_types_public.h"
#include "rtc_base/logging.h" #include "rtc_base/logging.h"

View File

@ -10,7 +10,6 @@
#include "modules/remote_bitrate_estimator/overuse_estimator.h" #include "modules/remote_bitrate_estimator/overuse_estimator.h"
#include <assert.h>
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>

View File

@ -10,7 +10,6 @@
#include "modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h" #include "modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h"
#include <assert.h>
#include <cstdint> #include <cstdint>
#include <utility> #include <utility>

View File

@ -10,7 +10,6 @@
#include "modules/rtp_rtcp/source/rtp_format_video_generic.h" #include "modules/rtp_rtcp/source/rtp_format_video_generic.h"
#include <assert.h>
#include <string.h> #include <string.h>
#include "absl/types/optional.h" #include "absl/types/optional.h"

View File

@ -10,7 +10,6 @@
#include "modules/rtp_rtcp/source/rtp_utility.h" #include "modules/rtp_rtcp/source/rtp_utility.h"
#include <assert.h>
#include <stddef.h> #include <stddef.h>
#include <string> #include <string>

View File

@ -11,7 +11,6 @@
#include "modules/utility/include/helpers_android.h" #include "modules/utility/include/helpers_android.h"
#include <android/log.h> #include <android/log.h>
#include <assert.h>
#include <pthread.h> #include <pthread.h>
#include <stddef.h> #include <stddef.h>
#include <unistd.h> #include <unistd.h>

View File

@ -10,7 +10,6 @@
#include "modules/video_capture/device_info_impl.h" #include "modules/video_capture/device_info_impl.h"
#include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include "absl/strings/match.h" #include "absl/strings/match.h"

View File

@ -10,7 +10,6 @@
#include "modules/video_capture/windows/device_info_ds.h" #include "modules/video_capture/windows/device_info_ds.h"
#include <assert.h>
#include <dvdmedia.h> #include <dvdmedia.h>
#include "modules/video_capture/video_capture_config.h" #include "modules/video_capture/video_capture_config.h"

View File

@ -10,7 +10,6 @@
#include "modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h" #include "modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h"
#include <assert.h>
#include <string.h> #include <string.h>
#include <algorithm> #include <algorithm>

View File

@ -14,7 +14,6 @@
#ifndef MODULES_VIDEO_CODING_CODECS_VP9_INCLUDE_VP9_GLOBALS_H_ #ifndef MODULES_VIDEO_CODING_CODECS_VP9_INCLUDE_VP9_GLOBALS_H_
#define MODULES_VIDEO_CODING_CODECS_VP9_INCLUDE_VP9_GLOBALS_H_ #define MODULES_VIDEO_CODING_CODECS_VP9_INCLUDE_VP9_GLOBALS_H_
#include <assert.h>
#include <stdint.h> #include <stdint.h>
#include "modules/video_coding/codecs/interface/common_constants.h" #include "modules/video_coding/codecs/interface/common_constants.h"

View File

@ -10,7 +10,6 @@
#include "modules/video_coding/frame_buffer.h" #include "modules/video_coding/frame_buffer.h"
#include <assert.h>
#include <string.h> #include <string.h>
#include "api/video/encoded_image.h" #include "api/video/encoded_image.h"

View File

@ -9,7 +9,6 @@
*/ */
#include "modules/video_coding/jitter_buffer.h" #include "modules/video_coding/jitter_buffer.h"
#include <assert.h>
#include <algorithm> #include <algorithm>
#include <limits> #include <limits>

View File

@ -10,7 +10,6 @@
#include "modules/video_coding/jitter_estimator.h" #include "modules/video_coding/jitter_estimator.h"
#include <assert.h>
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>

View File

@ -10,7 +10,6 @@
#include "modules/video_coding/media_opt_util.h" #include "modules/video_coding/media_opt_util.h"
#include <assert.h>
#include <math.h> #include <math.h>
#include <algorithm> #include <algorithm>

View File

@ -10,7 +10,6 @@
#include "modules/video_coding/receiver.h" #include "modules/video_coding/receiver.h"
#include <assert.h>
#include <cstdint> #include <cstdint>
#include <cstdlib> #include <cstdlib>

View File

@ -10,7 +10,6 @@
#include "modules/video_coding/session_info.h" #include "modules/video_coding/session_info.h"
#include <assert.h>
#include <string.h> #include <string.h>
#include <vector> #include <vector>

View File

@ -10,7 +10,6 @@
#include "modules/video_coding/timing.h" #include "modules/video_coding/timing.h"
#include <assert.h>
#include <algorithm> #include <algorithm>

View File

@ -16,7 +16,6 @@
#include "rtc_base/third_party/base64/base64.h" #include "rtc_base/third_party/base64/base64.h"
#include <assert.h>
#include <string.h> #include <string.h>
#include "rtc_base/checks.h" #include "rtc_base/checks.h"

View File

@ -11,7 +11,6 @@
#include "test/field_trial.h" #include "test/field_trial.h"
#include <algorithm> #include <algorithm>
#include <cassert>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>

View File

@ -10,7 +10,6 @@
#include "test/frame_generator.h" #include "test/frame_generator.h"
#include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View File

@ -12,7 +12,6 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <assert.h>
#include <stdlib.h> #include <stdlib.h>
namespace webrtc { namespace webrtc {

View File

@ -10,7 +10,6 @@
#include "test/rtp_file_reader.h" #include "test/rtp_file_reader.h"
#include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <map> #include <map>

View File

@ -10,7 +10,6 @@
#include "test/testsupport/file_utils.h" #include "test/testsupport/file_utils.h"
#include <assert.h>
#if defined(WEBRTC_POSIX) #if defined(WEBRTC_POSIX)
#include <unistd.h> #include <unistd.h>