Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Issue 1168753002: Match existing type usage better. (Closed)

Created:
5 years, 6 months ago by Peter Kasting
Modified:
5 years, 6 months ago
CC:
aluebs-webrtc, Andrew MacDonald, bjornv1, hlundin-webrtc, tlegrand-webrtc, tterriberry_mozilla.com, webrtc-reviews_webrtc.org
Base URL:
https://chromium.googlesource.com/external/webrtc@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Match existing type usage better. This makes a variety of small changes to synchronize bits of code using different types, remove useless code or casts, and add explicit casts in some places previously doing implicit ones. For example: * Change a few type declarations to better match how the majority of code uses those objects. * Eliminate "< 0" check for unsigned values. * Replace "(float)sin(x)", where |x| is also a float, with "sinf(x)", and similar. * Add casts to uint32_t in many places timestamps were used and the existing code stored signed values into the unsigned objects. * Remove downcasts when the results would be passed to a larger type, e.g. calling "foo((int16_t)x)" with an int |x| when foo() takes an int instead of an int16_t. * Similarly, add casts when passing a larger type to a function taking a smaller one. * Add casts to int16_t when doing something like "int16_t = int16_t + int16_t" as the "+" operation would implicitly upconvert to int, and similar. * Use "false" instead of "0" for setting a bool. * Shift a few temp types when doing a multi-stage calculation involving typecasts, so as to put the most logical/semantically correct type possible into the temps. For example, when doing "int foo = int + int; size_t bar = (size_t)foo + size_t;", we might change |foo| to a size_t and move the cast if it makes more sense for |foo| to be represented as a size_t. BUG=none R=andrew@webrtc.org, asapersson@webrtc.org, henrika@webrtc.org, juberti@webrtc.org, kwiberg@webrtc.org TBR=andrew, asapersson, henrika Committed: https://chromium.googlesource.com/external/webrtc/+/b7e5054414ff524f9db81dab7917729b8c4c8bcb

Patch Set 1 #

Patch Set 2 : Attempted test fix #

Total comments: 25

Patch Set 3 : Review comments + resync #

Total comments: 2

Patch Set 4 : Resync #

Unified diffs Side-by-side diffs Delta from patch set Stats (+175 lines, -151 lines) Patch
M talk/app/webrtc/test/fakeaudiocapturemodule.cc View 1 chunk +1 line, -1 line 0 comments Download
M talk/app/webrtc/test/fakeaudiocapturemodule_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/common_audio/fft4g.c View 1 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/common_audio/lapped_transform_unittest.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M webrtc/common_audio/real_fourier.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M webrtc/common_audio/signal_processing/auto_correlation.c View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M webrtc/common_audio/signal_processing/complex_fft.c View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/common_audio/signal_processing/get_scaling_square.c View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c View 3 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/cb_search.c View 1 2 3 2 chunks +4 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/decode.c View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/decode_residual.c View 1 2 3 4 chunks +4 lines, -5 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/encode.c View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c View 1 2 3 5 chunks +7 lines, -8 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/frame_classify.c View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/my_corr.c View 3 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/nearest_neighbor.c View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/refiner.c View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/state_construct.c View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/state_search.c View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/xcorr_coef.c View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/decode_plc.c View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/encode.c View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.c View 3 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/test/test_iSACfixfloat.c View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/main/source/isac.c View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/main/test/ReleaseTest-API/ReleaseTest-API.cc View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/main/test/simpleKenny.c View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc View 3 2 chunks +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/opus/opus_fec_test.cc View 3 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/main/acm2/acm_receiver.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/main/acm2/acm_send_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/main/acm2/acm_send_test_oldapi.cc View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc View 1 2 3 2 chunks +5 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/main/test/initial_delay_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/background_noise.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/background_noise.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/decision_logic_normal.cc View 3 chunks +11 lines, -9 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/expand.h View 3 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/expand.cc View 1 2 3 6 chunks +11 lines, -8 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/merge.cc View 1 2 3 3 chunks +9 lines, -6 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_impl.cc View 1 2 3 7 chunks +14 lines, -9 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_unittest.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/normal.cc View 1 2 3 5 chunks +16 lines, -13 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/statistics_calculator.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/statistics_calculator.cc View 3 chunks +6 lines, -5 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/test/RTPencode.cc View 1 2 3 4 chunks +6 lines, -6 lines 0 comments Download
M webrtc/modules/audio_device/audio_device_buffer.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_device/dummy/file_audio_device.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_processing/ns/ns_core.c View 4 chunks +6 lines, -6 lines 0 comments Download
M webrtc/modules/audio_processing/ns/nsx_core_mips.c View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/utility/source/coder.cc View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/voice_engine/channel.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/voice_engine/utility_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 21 (3 generated)
Peter Kasting
This is a reupload of https://webrtc-codereview.appspot.com/55529004/ . TBRing to henrika, andrew, and asapersson since they ...
5 years, 6 months ago (2015-06-05 21:41:36 UTC) #2
Andrew MacDonald
lgtm
5 years, 6 months ago (2015-06-05 23:47:39 UTC) #3
kwiberg-webrtc
Sorry for taking so long. I'm not really a fan of having explicit casts in ...
5 years, 6 months ago (2015-06-08 13:09:38 UTC) #4
Peter Kasting
New snap not up, just replying to questions for now. On 2015/06/08 13:09:38, kwiberg1 wrote: ...
5 years, 6 months ago (2015-06-08 20:44:29 UTC) #5
kwiberg-webrtc
On 2015/06/08 20:44:29, Peter Kasting wrote: > New snap not up, just replying to questions ...
5 years, 6 months ago (2015-06-08 23:58:25 UTC) #6
kwiberg-webrtc
lgtm for webrtc/modules/audio_coding/ because in the end it's more productive to yield to MSVC than ...
5 years, 6 months ago (2015-06-09 00:48:12 UTC) #7
Peter Kasting
Hey Nico, I've added you as my go-to clang guy. Do you think the warnings ...
5 years, 6 months ago (2015-06-09 01:18:14 UTC) #9
kwiberg-webrtc
https://codereview.webrtc.org/1168753002/diff/20001/webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c File webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c (right): https://codereview.webrtc.org/1168753002/diff/20001/webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c#newcode373 webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c:373: SIDdata[0] = (uint8_t)index; On 2015/06/09 01:18:14, Peter Kasting wrote: ...
5 years, 6 months ago (2015-06-09 01:28:26 UTC) #10
Peter Kasting
https://codereview.webrtc.org/1168753002/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc File webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc (right): https://codereview.webrtc.org/1168753002/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc#newcode65 webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc:65: BN_data->arrival_time += static_cast<uint32_t>( On 2015/06/09 01:28:26, kwiberg1 wrote: > ...
5 years, 6 months ago (2015-06-09 02:10:13 UTC) #11
kwiberg-webrtc
https://codereview.webrtc.org/1168753002/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc File webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc (right): https://codereview.webrtc.org/1168753002/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc#newcode65 webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc:65: BN_data->arrival_time += static_cast<uint32_t>( On 2015/06/09 02:10:13, Peter Kasting wrote: ...
5 years, 6 months ago (2015-06-09 10:56:31 UTC) #12
henrika_webrtc
LGTM
5 years, 6 months ago (2015-06-09 14:55:45 UTC) #13
Peter Kasting
New snap up. Justin, I'm just waiting on your LGTM now. https://codereview.chromium.org/1168753002/diff/20001/webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c File webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c (right): ...
5 years, 6 months ago (2015-06-10 01:09:54 UTC) #15
juberti1
https://codereview.webrtc.org/1168753002/diff/40001/talk/app/webrtc/test/fakeaudiocapturemodule.cc File talk/app/webrtc/test/fakeaudiocapturemodule.cc (right): https://codereview.webrtc.org/1168753002/diff/40001/talk/app/webrtc/test/fakeaudiocapturemodule.cc#newcode48 talk/app/webrtc/test/fakeaudiocapturemodule.cc:48: static const uint8_t kNumberOfChannels = 1; Generally I think ...
5 years, 6 months ago (2015-06-10 05:40:54 UTC) #16
åsapersson
lgtm
5 years, 6 months ago (2015-06-10 06:46:53 UTC) #17
Peter Kasting
https://codereview.webrtc.org/1168753002/diff/40001/talk/app/webrtc/test/fakeaudiocapturemodule.cc File talk/app/webrtc/test/fakeaudiocapturemodule.cc (right): https://codereview.webrtc.org/1168753002/diff/40001/talk/app/webrtc/test/fakeaudiocapturemodule.cc#newcode48 talk/app/webrtc/test/fakeaudiocapturemodule.cc:48: static const uint8_t kNumberOfChannels = 1; On 2015/06/10 05:40:53, ...
5 years, 6 months ago (2015-06-11 04:03:46 UTC) #18
juberti1
On 2015/06/11 at 04:03:46, pkasting wrote: > https://codereview.webrtc.org/1168753002/diff/40001/talk/app/webrtc/test/fakeaudiocapturemodule.cc > File talk/app/webrtc/test/fakeaudiocapturemodule.cc (right): > > https://codereview.webrtc.org/1168753002/diff/40001/talk/app/webrtc/test/fakeaudiocapturemodule.cc#newcode48 ...
5 years, 6 months ago (2015-06-11 05:45:59 UTC) #19
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/b7e5054414ff524f9db81dab7917729b8c4c8bcb Cr-Commit-Position: refs/heads/master@{#9419}
5 years, 6 months ago (2015-06-11 19:56:10 UTC) #20
Peter Kasting
5 years, 6 months ago (2015-06-11 19:56:13 UTC) #21
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
b7e5054414ff524f9db81dab7917729b8c4c8bcb (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698