Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-15118] iOS: Fixing build warnings #5435

Merged
merged 3 commits into from
Mar 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions iphone/Classes/ASI/ASIDataCompressor.m
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ + (BOOL)compressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destinati
readLength = [inputStream read:inputData maxLength:DATA_CHUNK_SIZE];

// Make sure nothing went wrong
if ([inputStream streamStatus] == NSStreamEventErrorOccurred) {
if ([inputStream streamStatus] == NSStreamStatusError) {
if (err) {
*err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed because we were unable to read from the source data file",sourcePath],NSLocalizedDescriptionKey,[inputStream streamError],NSUnderlyingErrorKey,nil]];
}
Expand All @@ -187,7 +187,7 @@ + (BOOL)compressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destinati
[outputStream write:(const uint8_t *)[outputData bytes] maxLength:[outputData length]];

// Make sure nothing went wrong
if ([inputStream streamStatus] == NSStreamEventErrorOccurred) {
if ([inputStream streamStatus] == NSStreamStatusError) {
if (err) {
*err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed because we were unable to write to the destination data file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStream streamError],NSUnderlyingErrorKey,nil]];
}
Expand All @@ -212,7 +212,7 @@ + (BOOL)compressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destinati

+ (NSError *)deflateErrorWithCode:(int)code
{
return [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of data failed with code %hi",code],NSLocalizedDescriptionKey,nil]];
return [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of data failed with code %i",code],NSLocalizedDescriptionKey,nil]];
}

@synthesize streamReady;
Expand Down
6 changes: 3 additions & 3 deletions iphone/Classes/ASI/ASIDataDecompressor.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ + (BOOL)uncompressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destina
readLength = [inputStream read:inputData maxLength:DATA_CHUNK_SIZE];

// Make sure nothing went wrong
if ([inputStream streamStatus] == NSStreamEventErrorOccurred) {
if ([inputStream streamStatus] == NSStreamStatusError) {
if (err) {
*err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Decompression of %@ failed because we were unable to read from the source data file",sourcePath],NSLocalizedDescriptionKey,[inputStream streamError],NSUnderlyingErrorKey,nil]];
}
Expand All @@ -184,7 +184,7 @@ + (BOOL)uncompressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destina
[outputStream write:(Bytef*)[outputData bytes] maxLength:[outputData length]];

// Make sure nothing went wrong
if ([inputStream streamStatus] == NSStreamEventErrorOccurred) {
if ([inputStream streamStatus] == NSStreamStatusError) {
if (err) {
*err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Decompression of %@ failed because we were unable to write to the destination data file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStream streamError],NSUnderlyingErrorKey,nil]];
}
Expand All @@ -211,7 +211,7 @@ + (BOOL)uncompressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destina

+ (NSError *)inflateErrorWithCode:(int)code
{
return [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Decompression of data failed with code %hi",code],NSLocalizedDescriptionKey,nil]];
return [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Decompression of data failed with code %i",code],NSLocalizedDescriptionKey,nil]];
}

@synthesize streamReady;
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/ASI/ASIHTTPRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -4950,7 +4950,7 @@ + (NSDate *)expiryDateForRequest:(ASIHTTPRequest *)request maxAge:(NSTimeInterva

// RFC 2612 says max-age must override any Expires header
if (maxAge) {
return [[NSDate date] addTimeInterval:maxAge];
return [[NSDate date] dateByAddingTimeInterval:maxAge];
} else {
NSString *expires = [responseHeaders objectForKey:@"Expires"];
if (expires) {
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/AnalyticsModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ -(NSDictionary*)dataToDictionary:(id)data
{
if (data!=nil && [data isKindOfClass:[NSDictionary class]]==NO)
{
id value = [TiUtils jsonValue:data];
id value = [TiUtils jsonParse:data];
data = [NSDictionary dictionaryWithObject:value forKey:@"data"];
}
return data;
Expand Down
19 changes: 2 additions & 17 deletions iphone/Classes/AudioStreamer/AudioStreamerCUR.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ static void MyPacketsProcCUR( void * inClientData,
AudioStreamPacketDescription *inPacketDescriptions);
OSStatus MyEnqueueBufferCUR(AudioStreamerCUR* myData);

#ifdef TARGET_OS_IPHONE
static void MyAudioSessionInterruptionListenerCUR(void *inClientData, UInt32 inInterruptionState);
#endif

#pragma mark Audio Callback Function Implementations

Expand Down Expand Up @@ -151,19 +148,7 @@ void MyAudioQueueIsRunningCallbackCUR(void *inUserData, AudioQueueRef inAQ, Audi
[streamer handlePropertyChangeForQueue:inAQ propertyID:inID];
}

#ifdef TARGET_OS_IPHONE
//
// MyAudioSessionInterruptionListener
//
// Invoked if the audio session is interrupted (like when the phone rings)
//
// TODO: Need to add this into the interruption framework, it's a bug!
void MyAudioSessionInterruptionListenerCUR(void *inClientData, UInt32 inInterruptionState)
{
AudioStreamerCUR* streamer = (AudioStreamerCUR *)inClientData;
[streamer handleInterruptionChangeToState:inInterruptionState];
}
#endif


#pragma mark CFReadStream Callback Function Implementations

Expand Down Expand Up @@ -522,7 +507,7 @@ - (BOOL)openReadStream
if (fileLength > 0 && seekByteOffset > 0)
{
CFHTTPMessageSetHeaderFieldValue(message, CFSTR("Range"),
(CFStringRef)[NSString stringWithFormat:@"bytes=%ld-%ld", seekByteOffset, fileLength]);
(CFStringRef)[NSString stringWithFormat:@"bytes=%ld-%ld", (long)seekByteOffset, (long)fileLength]);
discontinuous = YES;
}

Expand Down
4 changes: 2 additions & 2 deletions iphone/Classes/CodecModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ -(NSNumber*)encodeNumber:(id)args

switch (result) {
case BAD_ENDIAN: {
[self throwException:[NSString stringWithFormat:@"Invalid endianness: %d", byteOrder]
[self throwException:[NSString stringWithFormat:@"Invalid endianness: %ld", byteOrder]
subreason:nil
location:CODELOCATION];
break;
Expand Down Expand Up @@ -110,7 +110,7 @@ -(NSNumber*)decodeNumber:(id)args
case CFByteOrderLittleEndian:
break;
default:
[self throwException:[NSString stringWithFormat:@"Invalid endianness: %d", byteOrder]
[self throwException:[NSString stringWithFormat:@"Invalid endianness: %ld", byteOrder]
subreason:nil
location:CODELOCATION];
}
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/GDataXMLNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ - (NSArray *)nodesForXPath:(NSString *)xpath
int result = xmlXPathRegisterNs(xpathCtx, prefix, nsPtr->href);
if (result != 0) {
#if DEBUG
NSCAssert1(result == 0, @"GDataXMLNode XPath namespace %@ issue",
NSCAssert1(result == 0, @"GDataXMLNode XPath namespace %s issue",
prefix);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/ImageLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ -(void)serialize:(NSData*)imageData

-(NSString*)description
{
return [NSString stringWithFormat:@"<ImageCache:%x> %@[%@]",[self hash],remoteURL,localPath];
return [NSString stringWithFormat:@"<ImageCache:%@> %@[%@]",self,remoteURL,localPath];
}

+(NSString*)cachePathForURL:(NSURL *)url
Expand Down
2 changes: 2 additions & 0 deletions iphone/Classes/LauncherView.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
@property(nonatomic,readonly) BOOL editing;
@property(nonatomic,assign) BOOL editable;

- (id)initWithFrame:(CGRect)frame withRowCount:(int)newRowCount withColumnCount:(int)newColumnCount;

- (void)addItem:(LauncherItem*)item animated:(BOOL)animated;
- (void)removeItem:(LauncherItem*)item animated:(BOOL)animated;

Expand Down
4 changes: 2 additions & 2 deletions iphone/Classes/TiAnimation.m
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,11 @@ -(void)animate:(id)args
//AnimationStarted needs to be called here, otherwise the animation flags for
//the view being transitioned will end up in a improper state, resulting in
//layout warning.
[self animationStarted:[NSString stringWithFormat:@"%X",(void *)theview]
[self animationStarted:[NSString stringWithFormat:@"%@",(void *)theview]
context:self];
}
completion:^(BOOL finished) {
[self animationCompleted:[NSString stringWithFormat:@"%X",(void *)theview]
[self animationCompleted:[NSString stringWithFormat:@"%@",(void *)theview]
finished:[NSNumber numberWithBool:finished]
context:self];

Expand Down
7 changes: 7 additions & 0 deletions iphone/Classes/TiApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ -(void)clearMemoryPanic
@synthesize pendingCompletionHandlers;
@synthesize backgroundTransferCompletionHandlers;
@synthesize localNotification;
@synthesize appBooted;

+(void)initialize
{
Expand Down Expand Up @@ -632,6 +633,12 @@ -(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompl

}

- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask
didResumeAtOffset:(int64_t)fileOffset
expectedTotalBytes:(int64_t)expectedTotalBytes {

}

- (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session
{
[[NSNotificationCenter defaultCenter] postNotificationName:kTiURLSessionEventsCompleted object:self userInfo:nil];
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiDOMNodeProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ -(id)nodeValue

-(void)setNodeValue:(NSString *)data
{
[self throwException:[NSString stringWithFormat:@"Setting NodeValue not supported for %d type of Node",[self nodeType]] subreason:nil location:CODELOCATION];
[self throwException:[NSString stringWithFormat:@"Setting NodeValue not supported for %d type of Node",[[self nodeType] intValue]] subreason:nil location:CODELOCATION];
}

- (id)textContent
Expand Down
1 change: 1 addition & 0 deletions iphone/Classes/TiLayoutQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
*/
+(void)layoutProxy:(TiViewProxy*)thisProxy;

+(void)resetQueue;
@end
5 changes: 2 additions & 3 deletions iphone/Classes/TiMediaVideoPlayerProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,7 @@ -(NSNumber *)volume
-(void)setVolume:(NSNumber *)newVolume
{
double volume = [TiUtils doubleValue:newVolume def:-1.0];
ENSURE_VALUE_RANGE(volume, 0.0, 1.0);

volume = MAX(0.0, MIN(volume, 1.0));
TiThreadPerformOnMainThread(^{
[[MPMusicPlayerController applicationMusicPlayer] setVolume:volume];
}, NO);
Expand Down Expand Up @@ -861,7 +860,7 @@ - (void) handlePlayerNotification: (NSNotification *) notification
NSMutableDictionary *event;
if (reason!=nil)
{
event = [NSDictionary dictionaryWithObject:reason forKey:@"reason"];
event = [NSMutableDictionary dictionaryWithObject:reason forKey:@"reason"];
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiNetworkHTTPClientProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ -(void)send:(id)args
NSData *data = [blob data];
// give it a generated file name for the attachment so you can look at the extension at least to
// attempt to figure out what it is (as well as mime)
NSString *filename = [NSString stringWithFormat:@"%x.%@",data,[Mimetypes extensionForMimeType:[blob mimeType]]];
NSString *filename = [NSString stringWithFormat:@"%@.%@",data,[Mimetypes extensionForMimeType:[blob mimeType]]];
[request setData:data withFileName:filename andContentType:[blob mimeType] forKey:key];
}
}
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiNetworkSocketTCPProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ -(void)setConnectedSocket:(AsyncSocket*)sock onThread:(NSThread*)thread
-(void)socketRunLoop
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[socketThread setName:[NSString stringWithFormat:@"Ti.Network.Socket.TCP (%x)",self]];
[socketThread setName:[NSString stringWithFormat:@"Ti.Network.Socket.TCP (%@)",self]];
// Begin the run loop for the socket
int counter=0;
while (!(internalState & (SOCKET_CLOSED | SOCKET_ERROR)) &&
Expand Down