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

1711.1 release #2814

Merged
merged 10 commits into from
Nov 10, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions Frameworks/Foundation/NSArray.mm
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,7 @@ - (id)objectAtIndexedSubscript:(NSUInteger)index {
@Status Interoperable
*/
- (NSUInteger)indexOfObject:(id)obj {
int count = [self count];

for (int i = 0; i < count; i++) {
id value = [self objectAtIndex:i];

if ([obj isEqual:value]) {
return i;
}
}

return NSNotFound;
return [self indexOfObject:obj inRange:NSRange{ 0, self.count }];
}

/**
Expand Down
12 changes: 10 additions & 2 deletions Frameworks/Foundation/NSCFArray.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "Starboard.h"
#include "CFHelpers.h"
#include "CFFoundationInternal.h"
#include "ForFoundationOnly.h"
#include <CoreFoundation/CFArray.h>
#include "NSCFArray.h"
#include "BridgeHelpers.h"
Expand Down Expand Up @@ -84,7 +85,9 @@ - (NSUInteger)count {
- (id)objectAtIndex:(NSUInteger)index {
if (index >= CFArrayGetCount((CFArrayRef)self)) {
[NSException raise:@"Array out of bounds"
format:@"objectAtIndex: index > count (%lu > %lu), throwing exception\n", (unsigned long)index, (unsigned long)CFArrayGetCount((CFArrayRef)self)];
format:@"objectAtIndex: index > count (%lu > %lu), throwing exception\n",
(unsigned long)index,
(unsigned long)CFArrayGetCount((CFArrayRef)self)];
return nil;
}
return (id)CFArrayGetValueAtIndex((CFArrayRef)self, index);
Expand All @@ -111,7 +114,7 @@ - (void)replaceObjectAtIndex:(NSUInteger)index withObject:(NSObject*)obj {
CFRange range;
range.location = index;
range.length = 1;
CFArrayReplaceValues(static_cast<CFMutableArrayRef>(self), range, (const void**)(&obj), 1);
_CFArrayReplaceValues(static_cast<CFMutableArrayRef>(self), range, (const void**)(&obj), 1);
}

- (void)insertObject:(NSObject*)objAddr atIndex:(NSUInteger)index {
Expand All @@ -120,6 +123,11 @@ - (void)insertObject:(NSObject*)objAddr atIndex:(NSUInteger)index {
CFArrayInsertValueAtIndex(static_cast<CFMutableArrayRef>(self), index, reinterpret_cast<const void*>(objAddr));
}

- (void)exchangeObjectAtIndex:(NSUInteger)atIndex withObjectAtIndex:(NSUInteger)withIndex {
BRIDGED_THROW_IF_IMMUTABLE(_CFArrayIsMutable, CFArrayRef);
CFArrayExchangeValuesAtIndices(static_cast<CFMutableArrayRef>(self), atIndex, withIndex);
}

- (void)removeAllObjects {
BRIDGED_THROW_IF_IMMUTABLE(_CFArrayIsMutable, CFArrayRef);
CFArrayRemoveAllValues((CFMutableArrayRef)self);
Expand Down
12 changes: 12 additions & 0 deletions Frameworks/Foundation/NSCFCollectionSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,16 @@ CFHashCode _NSCFCallbackHash(const void* value);
} \
} while (false)

#define NS_COLLECTION_VALIDATE_RANGE(range, count) \
do { \
if (range.location + range.length > (count)) { \
[NSException raise:NSInvalidArgumentException \
format:@"*** %s: Range {%lu, %lu} out of bounds; legal range is {0, %lu}", \
__PRETTY_FUNCTION__, \
(unsigned long)range.location, \
(unsigned long)range.length, \
(unsigned long)(count)]; \
} \
} while (false)

#endif // __OBJC__
71 changes: 34 additions & 37 deletions Frameworks/Foundation/NSMutableArray.mm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#import "CFHelpers.h"
#import "NSRaise.h"
#import "NSCFArray.h"
#import "NSCFCollectionSupport.h"
#import "BridgeHelpers.h"

#include <algorithm>
Expand Down Expand Up @@ -154,49 +155,53 @@ - (void)exchangeObjectAtIndex:(NSUInteger)atIndex withObjectAtIndex:(NSUInteger)
[obj2 release];
}

/**
@Status Interoperable
*/
- (void)removeObject:(NSObject*)objAddr {
if (objAddr == nil) {
TraceVerbose(TAG, L"objAddr = nil!");
}
using _NSObjectComparator = bool (*)(id, id);

int idx = [self indexOfObject:objAddr];
if (idx != NSNotFound) {
[self removeObjectAtIndex:idx];
- (void)_removeObject:(NSObject*)object inRange:(NSRange)range withComparator:(_NSObjectComparator)comparator {
NS_COLLECTION_VALIDATE_RANGE(range, self.count);
for (NSUInteger i = range.location + range.length; i > range.location; --i) {
id cur = [self objectAtIndex:i - 1];
if (comparator(object, cur)) {
[self removeObjectAtIndex:i - 1];
}
}
}

/**
@Status Interoperable
*/
- (void)removeObject:(NSObject*)objAddr inRange:(NSRange)range {
for (int i = range.location + range.length - 1; i >= (int)range.location; i--) {
id curObj = [self objectAtIndex:i];
- (void)removeObject:(NSObject*)object {
[self removeObject:object inRange:NSRange{ 0, self.count }];
}
/**
@Status Interoperable
*/
- (void)removeObject:(NSObject*)object inRange:(NSRange)range {
[self _removeObject:object inRange:range withComparator:[](id left, id right) -> bool { return [right isEqual:left]; }];
}

if ([curObj isEqual:objAddr]) {
[self removeObject:curObj];
}
}
/**
@Status Interoperable
*/
- (void)removeObjectIdenticalTo:(NSObject*)object {
[self removeObjectIdenticalTo:object inRange:NSRange{ 0, self.count }];
}

/**
@Status Interoperable
*/
- (void)removeObjectsInRange:(NSRange)range {
for (int i = range.location + range.length - 1; i >= (int)range.location; i--) {
[self removeObjectAtIndex:i];
}
- (void)removeObjectIdenticalTo:(id)object inRange:(NSRange)range {
[self _removeObject:object inRange:range withComparator:[](id left, id right) -> bool { return right == left; }];
}

/**
@Status Interoperable
*/
- (void)removeObjectIdenticalTo:(NSObject*)objAddr {
int idx = [self indexOfObjectIdenticalTo:objAddr];
if (idx != NSNotFound) {
[self removeObjectAtIndex:idx];
- (void)removeObjectsInRange:(NSRange)range {
NS_COLLECTION_VALIDATE_RANGE(range, self.count);

for (NSUInteger i = range.location + range.length; i > range.location; --i) {
[self removeObjectAtIndex:i - 1];
}
}

Expand All @@ -212,10 +217,10 @@ - (void)removeObjectAtIndex:(NSUInteger)index {
@Status Interoperable
*/
- (void)removeObjectsAtIndexes:(NSIndexSet*)indexSet {
[indexSet enumerateIndexesWithOptions:NSEnumerationReverse
usingBlock:^(NSUInteger index, BOOL* stop) {
[self removeObjectAtIndex:index];
}];
[indexSet enumerateRangesWithOptions:NSEnumerationReverse
usingBlock:^(NSRange range, BOOL* stop) {
[self removeObjectsInRange:range];
}];
}

/**
Expand Down Expand Up @@ -492,14 +497,6 @@ - (void)filterUsingPredicate:(NSPredicate*)predicate {
}
}

/**
@Status Stub
@Notes
*/
- (void)removeObjectIdenticalTo:(id)anObject inRange:(NSRange)aRange {
UNIMPLEMENTED();
}

/**
@Status Stub
@Notes
Expand Down
2 changes: 1 addition & 1 deletion Frameworks/UIKit.Xaml/TextField.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ unsigned int TextField::c_borderCornerRadius = 8;
Platform::Boolean TextField::s_dependencyPropertiesRegistered = false;

template <typename T>
T TextField::FindTemplateChild(FrameworkElement^ source, Platform::String^ name) {
static T FindTemplateChild(FrameworkElement^ source, Platform::String^ name) {
T target = nullptr;
if (source) {
unsigned int count = VisualTreeHelper::GetChildrenCount(source);
Expand Down
10 changes: 5 additions & 5 deletions deps/3rdparty/cassowary-0.60/cassowary-0.60-Windows.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -32,29 +32,29 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<TargetName>cassowary-0.60-Debug</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<TargetName>cassowary-0.60-Debug</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<TargetName>cassowary-0.60</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<TargetName>cassowary-0.60</TargetName>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions deps/prebuilt/Universal Windows/ARM/cassowary-0.60-Debug.lib
Git LFS file not shown
4 changes: 2 additions & 2 deletions deps/prebuilt/Universal Windows/ARM/cassowary-0.60-Debug.pdb
Git LFS file not shown
4 changes: 2 additions & 2 deletions deps/prebuilt/Universal Windows/ARM/cassowary-0.60.lib
Git LFS file not shown
4 changes: 2 additions & 2 deletions deps/prebuilt/Universal Windows/ARM/cassowary-0.60.pdb
Git LFS file not shown
4 changes: 2 additions & 2 deletions deps/prebuilt/Universal Windows/x86/cassowary-0.60-Debug.lib
Git LFS file not shown
4 changes: 2 additions & 2 deletions deps/prebuilt/Universal Windows/x86/cassowary-0.60-Debug.pdb
Git LFS file not shown
4 changes: 2 additions & 2 deletions deps/prebuilt/Universal Windows/x86/cassowary-0.60.lib
Git LFS file not shown
4 changes: 2 additions & 2 deletions deps/prebuilt/Universal Windows/x86/cassowary-0.60.pdb
Git LFS file not shown
2 changes: 1 addition & 1 deletion include/Foundation/NSMutableArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ FOUNDATION_EXPORT_CLASS
- (void)removeObjectAtIndex:(NSUInteger)index;
- (void)removeObjectsAtIndexes:(NSIndexSet*)indexes;
- (void)removeObjectIdenticalTo:(ObjectType)anObject;
- (void)removeObjectIdenticalTo:(ObjectType)anObject inRange:(NSRange)aRange STUB_METHOD;
- (void)removeObjectIdenticalTo:(ObjectType)anObject inRange:(NSRange)aRange;
- (void)removeObjectsFromIndices:(NSUInteger*)indices numIndices:(NSUInteger)count STUB_METHOD;
- (void)removeObjectsInArray:(NSArray<ObjectType>*)otherArray;
- (void)removeObjectsInRange:(NSRange)aRange;
Expand Down
2 changes: 1 addition & 1 deletion msvc/sdk-build.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<ItemGroup>
<PackageReference Include="NuGet.Build.Packaging" Version="0.1.186" />
<PackageReference Include="WinObjC.Language" Version="*" />
<PackageReference Include="cppwinrt" Version="*">
<PackageReference Include="cppwinrt" Version="2017.4.6.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion msvc/ut-build.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
<ItemGroup>
<PackageReference Include="WinObjC.Language" Version="*" />
<PackageReference Include="Taef.Redist.Wlk" Version="1.0.170206001-nativeTargets" />
<PackageReference Include="cppwinrt" Version="*" />
<PackageReference Include="cppwinrt" Version="2017.4.6.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<PackageCertificateKeyFile>CoreAnimationTest_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>D095ED4071F7A0D93085697ECF15F78E76342CCF</PackageCertificateThumbprint>
<PackageCertificateThumbprint>3EE1CCE17B6705FF49C5E764CE83A9017E9CEF57</PackageCertificateThumbprint>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<PackageCertificateKeyFile>GLKitComplex_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>D095ED4071F7A0D93085697ECF15F78E76342CCF</PackageCertificateThumbprint>
<PackageCertificateThumbprint>3EE1CCE17B6705FF49C5E764CE83A9017E9CEF57</PackageCertificateThumbprint>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<PackageCertificateKeyFile>HelloGLKit_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>D095ED4071F7A0D93085697ECF15F78E76342CCF</PackageCertificateThumbprint>
<PackageCertificateThumbprint>3EE1CCE17B6705FF49C5E764CE83A9017E9CEF57</PackageCertificateThumbprint>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<PackageCertificateKeyFile>HelloOpenGL_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>D095ED4071F7A0D93085697ECF15F78E76342CCF</PackageCertificateThumbprint>
<PackageCertificateThumbprint>3EE1CCE17B6705FF49C5E764CE83A9017E9CEF57</PackageCertificateThumbprint>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<PackageCertificateKeyFile>HelloUI_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>D095ED4071F7A0D93085697ECF15F78E76342CCF</PackageCertificateThumbprint>
<PackageCertificateThumbprint>3EE1CCE17B6705FF49C5E764CE83A9017E9CEF57</PackageCertificateThumbprint>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down
Binary file not shown.
Binary file not shown.
Loading