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 <assert.h>
#include <memory>
#include <utility>

View file

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

View file

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

View file

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

View file

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/accelerate.h"
#include <assert.h>
#include "api/array_view.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.
*/
#include <assert.h>
#include <stdlib.h>
#include <array>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -11,7 +11,6 @@
#ifndef 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 "modules/audio_coding/neteq/audio_multi_vector.h"

View file

@ -11,7 +11,6 @@
#ifndef 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 <string>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -10,7 +10,6 @@
#include "modules/video_capture/windows/device_info_ds.h"
#include <assert.h>
#include <dvdmedia.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 <assert.h>
#include <string.h>
#include <algorithm>

View file

@ -14,7 +14,6 @@
#ifndef 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 "modules/video_coding/codecs/interface/common_constants.h"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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