From 440a86d3f2995b5a61752c8014c36e750db94db0 Mon Sep 17 00:00:00 2001 From: Euan Thoms Date: Wed, 4 Nov 2015 06:02:45 +0800 Subject: [PATCH 1/4] Stage 8 of clang compiler warning patches. --- SoObjects/SOGo/WORequest+SOGo.m | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/SoObjects/SOGo/WORequest+SOGo.m b/SoObjects/SOGo/WORequest+SOGo.m index f528343dd..a0019330a 100644 --- a/SoObjects/SOGo/WORequest+SOGo.m +++ b/SoObjects/SOGo/WORequest+SOGo.m @@ -180,14 +180,24 @@ cc = [self clientCapabilities]; b = ( - [[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound - && [[cc userAgent] rangeOfString: @"Darwin"].location != NSNotFound - || ( - [[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound - || [[cc userAgent] rangeOfString: @"Mac OS X"].location != NSNotFound - ) - && [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound - ); + ( + ( + [[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound + && [[cc userAgent] rangeOfString: @"Darwin"].location != NSNotFound + ) + || + ( + [[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound + && + ( + [[cc userAgent] rangeOfString: @"Mac OS X"].location != NSNotFound + || + [[cc userAgent] rangeOfString: @"Mac_OS_X"].location != NSNotFound + ) + ) + ) + && [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound + ); return b; } From 30488f4f6dc20a20022c452c4608164dde338314 Mon Sep 17 00:00:00 2001 From: ethoms Date: Thu, 5 Nov 2015 10:22:11 +0800 Subject: [PATCH 2/4] Update WORequest+SOGo.m --- SoObjects/SOGo/WORequest+SOGo.m | 36 ++++++++++++++------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/SoObjects/SOGo/WORequest+SOGo.m b/SoObjects/SOGo/WORequest+SOGo.m index a0019330a..bc5bc187e 100644 --- a/SoObjects/SOGo/WORequest+SOGo.m +++ b/SoObjects/SOGo/WORequest+SOGo.m @@ -172,34 +172,28 @@ // Mac OS X/10.8.1 (12B19) AddressBook/1143 // Mac OS X/10.8.2 (12C60) AddressBook/1167 // + - (BOOL) isMacOSXAddressBookApp { WEClientCapabilities *cc; - BOOL b; + BOOL isMacOSX_AB, hasAddressBook, hasCFNetwork, isMacOSX10_6_le, isMacOSX10_7, isMacOSX10_8_ge; cc = [self clientCapabilities]; - b = ( - ( - ( - [[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound - && [[cc userAgent] rangeOfString: @"Darwin"].location != NSNotFound - ) - || - ( - [[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound - && - ( - [[cc userAgent] rangeOfString: @"Mac OS X"].location != NSNotFound - || - [[cc userAgent] rangeOfString: @"Mac_OS_X"].location != NSNotFound - ) - ) - ) - && [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound - ); + hasAddressBook = ( [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound \ + || [[cc userAgent] rangeOfString: @"Address%20Book"].location != NSNotFound ); + hasCFNetwork = [[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound; - return b; + // note that 'le' signifies less than or equal, 'ge' signifies greater than or equal + // these are only assumed from the user agent strings we currently know. + + isMacOSX10_6_le = ( hasAddressBook && hasCFNetwork && [[cc userAgent] rangeOfString: @"Darwin"].location != NSNotFound ); + isMacOSX10_7 = ( hasAddressBook && hasCFNetwork && [[cc userAgent] rangeOfString: @"Mac_OS_X"].location != NSNotFound ); + isMacOSX10_8_ge = ( hasAddressBook && [[cc userAgent] rangeOfString: @"Mac OS X"].location != NSNotFound ); + + isMacOSX_AB = ( isMacOSX10_6_le || isMacOSX10_7 || isMacOSX10_8_ge); + + return isMacOSX_AB; } - (BOOL) isIPhoneAddressBookApp From bf87c71671850b2299396d7641780dd74d882399 Mon Sep 17 00:00:00 2001 From: ethoms Date: Thu, 5 Nov 2015 10:23:01 +0800 Subject: [PATCH 3/4] Update WORequest+SOGo.m --- SoObjects/SOGo/WORequest+SOGo.m | 1 - 1 file changed, 1 deletion(-) diff --git a/SoObjects/SOGo/WORequest+SOGo.m b/SoObjects/SOGo/WORequest+SOGo.m index bc5bc187e..f98615deb 100644 --- a/SoObjects/SOGo/WORequest+SOGo.m +++ b/SoObjects/SOGo/WORequest+SOGo.m @@ -172,7 +172,6 @@ // Mac OS X/10.8.1 (12B19) AddressBook/1143 // Mac OS X/10.8.2 (12C60) AddressBook/1167 // - - (BOOL) isMacOSXAddressBookApp { WEClientCapabilities *cc; From 3a103fd0dd06601ed5160bc4e85b7c93e6e6ddf8 Mon Sep 17 00:00:00 2001 From: ethoms Date: Fri, 6 Nov 2015 01:47:32 +0800 Subject: [PATCH 4/4] Update WORequest+SOGo.m --- SoObjects/SOGo/WORequest+SOGo.m | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/SoObjects/SOGo/WORequest+SOGo.m b/SoObjects/SOGo/WORequest+SOGo.m index f98615deb..d7c750b65 100644 --- a/SoObjects/SOGo/WORequest+SOGo.m +++ b/SoObjects/SOGo/WORequest+SOGo.m @@ -175,24 +175,28 @@ - (BOOL) isMacOSXAddressBookApp { WEClientCapabilities *cc; - BOOL isMacOSX_AB, hasAddressBook, hasCFNetwork, isMacOSX10_6_le, isMacOSX10_7, isMacOSX10_8_ge; + BOOL b; cc = [self clientCapabilities]; - hasAddressBook = ( [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound \ - || [[cc userAgent] rangeOfString: @"Address%20Book"].location != NSNotFound ); - hasCFNetwork = [[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound; + b = ( + ( + [[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound + && [[cc userAgent] rangeOfString: @"Darwin"].location != NSNotFound + ) + || + ( + [[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound + && [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound + ) + || + ( + [[cc userAgent] rangeOfString: @"Mac OS X"].location != NSNotFound + && [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound + ) + ); - // note that 'le' signifies less than or equal, 'ge' signifies greater than or equal - // these are only assumed from the user agent strings we currently know. - - isMacOSX10_6_le = ( hasAddressBook && hasCFNetwork && [[cc userAgent] rangeOfString: @"Darwin"].location != NSNotFound ); - isMacOSX10_7 = ( hasAddressBook && hasCFNetwork && [[cc userAgent] rangeOfString: @"Mac_OS_X"].location != NSNotFound ); - isMacOSX10_8_ge = ( hasAddressBook && [[cc userAgent] rangeOfString: @"Mac OS X"].location != NSNotFound ); - - isMacOSX_AB = ( isMacOSX10_6_le || isMacOSX10_7 || isMacOSX10_8_ge); - - return isMacOSX_AB; + return b; } - (BOOL) isIPhoneAddressBookApp