Fix some warnings in ObjC code.

BUG=

Review URL: https://codereview.webrtc.org/1824573002

Cr-Commit-Position: refs/heads/master@{#12076}
This commit is contained in:
tkchin 2016-03-21 09:08:40 -07:00 committed by Commit bot
parent 1d1944187f
commit 121ac122b9
5 changed files with 20 additions and 20 deletions

View File

@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
/** The data channel's |bufferedAmount| changed. */
- (void)dataChannel:(RTCDataChannel *)dataChannel
didChangeBufferedAmount:(NSUInteger)amount;
didChangeBufferedAmount:(uint64_t)amount;
@end

View File

@ -34,8 +34,8 @@ class DataChannelDelegateAdapter : public DataChannelObserver {
void OnBufferedAmountChange(uint64_t previousAmount) override {
id<RTCDataChannelDelegate> delegate = channel_.delegate;
if ([delegate
respondsToSelector:@selector(channel:didChangeBufferedAmount:)]) {
SEL sel = @selector(dataChannel:didChangeBufferedAmount:);
if ([delegate respondsToSelector:sel]) {
[delegate dataChannel:channel_ didChangeBufferedAmount:previousAmount];
}
}

View File

@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
* The index (starting at zero) of the media description this candidate is
* associated with in the SDP.
*/
@property(nonatomic, readonly) NSInteger sdpMLineIndex;
@property(nonatomic, readonly) int sdpMLineIndex;
/** The SDP string for this candidate. */
@property(nonatomic, readonly) NSString *sdp;
@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
* Initialize an RTCIceCandidate from SDP.
*/
- (instancetype)initWithSdp:(NSString *)sdp
sdpMLineIndex:(NSInteger)sdpMLineIndex
sdpMLineIndex:(int)sdpMLineIndex
sdpMid:(nullable NSString *)sdpMid
NS_DESIGNATED_INITIALIZER;

View File

@ -21,7 +21,7 @@
@synthesize sdp = _sdp;
- (instancetype)initWithSdp:(NSString *)sdp
sdpMLineIndex:(NSInteger)sdpMLineIndex
sdpMLineIndex:(int)sdpMLineIndex
sdpMid:(NSString *)sdpMid {
NSParameterAssert(sdp.length);
if (self = [super init]) {
@ -33,9 +33,9 @@
}
- (NSString *)description {
return [NSString stringWithFormat:@"RTCIceCandidate:\n%@\n%ld\n%@",
return [NSString stringWithFormat:@"RTCIceCandidate:\n%@\n%d\n%@",
_sdpMid,
(long)_sdpMLineIndex,
_sdpMLineIndex,
_sdp];
}

View File

@ -148,7 +148,7 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets;
NSOpenGLContext *_context;
#endif
BOOL _isInitialized;
NSUInteger _currentTextureSet;
GLint _currentTextureSet;
// Handles for OpenGL constructs.
GLuint _textures[kNumTextures];
GLuint _program;
@ -313,10 +313,10 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets;
frame.chromaHeight == _lastDrawnFrame.chromaHeight) {
return YES;
}
GLsizei lumaWidth = frame.width;
GLsizei lumaHeight = frame.height;
GLsizei chromaWidth = frame.chromaWidth;
GLsizei chromaHeight = frame.chromaHeight;
GLsizei lumaWidth = static_cast<GLsizei>(frame.width);
GLsizei lumaHeight = static_cast<GLsizei>(frame.height);
GLsizei chromaWidth = static_cast<GLsizei>(frame.chromaWidth);
GLsizei chromaHeight = static_cast<GLsizei>(frame.chromaHeight);
for (GLint i = 0; i < kNumTextureSets; i++) {
glActiveTexture(GL_TEXTURE0 + i * 3);
glTexImage2D(GL_TEXTURE_2D,
@ -361,11 +361,11 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets;
- (void)uploadPlane:(const uint8_t *)plane
sampler:(GLint)sampler
offset:(NSUInteger)offset
offset:(GLint)offset
width:(size_t)width
height:(size_t)height
stride:(int32_t)stride {
glActiveTexture(GL_TEXTURE0 + offset);
glActiveTexture(static_cast<GLenum>(GL_TEXTURE0 + offset));
// When setting texture sampler uniforms, the texture index is used not
// the texture handle.
glUniform1i(sampler, offset);
@ -382,8 +382,8 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets;
glTexImage2D(GL_TEXTURE_2D,
0,
RTC_PIXEL_FORMAT,
width,
height,
static_cast<GLsizei>(width),
static_cast<GLsizei>(height),
0,
RTC_PIXEL_FORMAT,
GL_UNSIGNED_BYTE,
@ -403,8 +403,8 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets;
glTexImage2D(GL_TEXTURE_2D,
0,
RTC_PIXEL_FORMAT,
width,
height,
static_cast<GLsizei>(width),
static_cast<GLsizei>(height),
0,
RTC_PIXEL_FORMAT,
GL_UNSIGNED_BYTE,
@ -412,7 +412,7 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets;
}
- (BOOL)updateTextureDataForFrame:(RTCVideoFrame *)frame {
NSUInteger textureOffset = _currentTextureSet * 3;
GLint textureOffset = _currentTextureSet * 3;
NSAssert(textureOffset + 3 <= kNumTextures, @"invalid offset");
[self uploadPlane:frame.yPlane