Skip to content

Commit 2164040

Browse files
restyled-commitswoody-apple
authored andcommitted
Restyled by clang-format
1 parent 66c65a4 commit 2164040

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ - (NSString *)description
7777
std::lock_guard lock(_lock);
7878

7979
return [NSString
80-
stringWithFormat:@"MTRAsyncCallbackWorkQueue context: %@ items count: %lu", self.context, static_cast<unsigned long> (self.items.count)];
80+
stringWithFormat:@"MTRAsyncCallbackWorkQueue context: %@ items count: %lu", self.context, static_cast<unsigned long>(self.items.count)];
8181
}
8282

8383
- (void)enqueueWorkItem:(MTRAsyncCallbackQueueWorkItem *)item

src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm

+9-9
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ - (void)setDuplicateTypeID:(NSUInteger)opaqueDuplicateTypeID handler:(MTRAsyncWo
8484

8585
- (void)assertMutable
8686
{
87-
NSAssert(_state == MTRAsyncWorkItemMutable, @"work item is not mutable (%ld)", static_cast<long> (_state));
87+
NSAssert(_state == MTRAsyncWorkItemMutable, @"work item is not mutable (%ld)", static_cast<long>(_state));
8888
}
8989

9090
#pragma mark Management by the work queue (queue lock held)
@@ -109,7 +109,7 @@ - (NSInteger)retryCount
109109

110110
- (void)callReadyHandlerWithContext:(id)context completion:(MTRAsyncWorkCompletionBlock)completion
111111
{
112-
NSAssert(_state >= MTRAsyncWorkItemEnqueued, @"work item is not enqueued (%ld)", static_cast<long> (_state));
112+
NSAssert(_state >= MTRAsyncWorkItemEnqueued, @"work item is not enqueued (%ld)", static_cast<long>(_state));
113113
NSInteger retryCount = 0;
114114
if (_state == MTRAsyncWorkItemEnqueued) {
115115
_state = MTRAsyncWorkItemRunning;
@@ -161,7 +161,7 @@ - (BOOL)isComplete
161161

162162
- (void)markComplete
163163
{
164-
NSAssert(_state >= MTRAsyncWorkItemEnqueued, @"work item was not enqueued (%ld)", static_cast<long> (_state));
164+
NSAssert(_state >= MTRAsyncWorkItemEnqueued, @"work item was not enqueued (%ld)", static_cast<long>(_state));
165165
_state = MTRAsyncWorkItemComplete;
166166

167167
// Clear all handlers in case any of them captured this object.
@@ -185,7 +185,7 @@ - (NSString *)description
185185
state = @"enqueued";
186186
break;
187187
default:
188-
return [NSString stringWithFormat:@"<%@ %llu running retry: %ld>", self.class, _uniqueID, static_cast<long> (self.retryCount)];
188+
return [NSString stringWithFormat:@"<%@ %llu running retry: %ld>", self.class, _uniqueID, static_cast<long>(self.retryCount)];
189189
}
190190
return [NSString stringWithFormat:@"<%@ %llu %@>", self.class, _uniqueID, state];
191191
}
@@ -236,7 +236,7 @@ - (NSString *)description
236236
{
237237
ContextSnapshot context(self);
238238
std::lock_guard lock(_lock);
239-
return [NSString stringWithFormat:@"<%@ context: %@, items count: %lu>", self.class, context.description, static_cast<unsigned long> (_items.count)];
239+
return [NSString stringWithFormat:@"<%@ context: %@, items count: %lu>", self.class, context.description, static_cast<unsigned long>(_items.count)];
240240
}
241241

242242
- (void)enqueueWorkItem:(MTRAsyncWorkItem *)item
@@ -268,9 +268,9 @@ - (void)enqueueWorkItem:(MTRAsyncWorkItem *)item
268268
// Logging the description once is enough because other log messages
269269
// related to the work item (execution, completion etc) can easily be
270270
// correlated using the unique id.
271-
MTR_LOG("MTRAsyncWorkQueue<%@, items count: %lu> enqueued work item [%llu]: %@", context.description, static_cast<unsigned long> (_items.count), item.uniqueID, description);
271+
MTR_LOG("MTRAsyncWorkQueue<%@, items count: %lu> enqueued work item [%llu]: %@", context.description, static_cast<unsigned long>(_items.count), item.uniqueID, description);
272272
} else {
273-
MTR_LOG("MTRAsyncWorkQueue<%@, items count: %lu> enqueued work item [%llu]", context.description, static_cast<unsigned long> (_items.count), item.uniqueID);
273+
MTR_LOG("MTRAsyncWorkQueue<%@, items count: %lu> enqueued work item [%llu]", context.description, static_cast<unsigned long>(_items.count), item.uniqueID);
274274
}
275275

276276
[self _callNextReadyWorkItemWithContext:context];
@@ -280,7 +280,7 @@ - (void)invalidate
280280
{
281281
ContextSnapshot context(self); // outside of lock
282282
std::lock_guard lock(_lock);
283-
MTR_LOG("MTRAsyncWorkQueue<%@> invalidate %lu items", context.description, static_cast<unsigned long> (_items.count));
283+
MTR_LOG("MTRAsyncWorkQueue<%@> invalidate %lu items", context.description, static_cast<unsigned long>(_items.count));
284284
for (MTRAsyncWorkItem * item in _items) {
285285
[item cancel];
286286
}
@@ -316,7 +316,7 @@ - (void)_postProcessWorkItem:(MTRAsyncWorkItem *)workItem
316316

317317
[workItem markComplete];
318318
[_items removeObjectAtIndex:indexOfWorkItem];
319-
MTR_LOG("MTRAsyncWorkQueue<%@, items count: %lu> completed work item [%llu]", context.description, static_cast<unsigned long> (_items.count), workItem.uniqueID);
319+
MTR_LOG("MTRAsyncWorkQueue<%@, items count: %lu> completed work item [%llu]", context.description, static_cast<unsigned long>(_items.count), workItem.uniqueID);
320320

321321
// sanity check running work item count is positive
322322
if (_runningWorkItemCount == 0) {

src/darwin/Framework/CHIP/MTRBaseDevice.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue
571571
return _MakeDataValueDictionary(typeName, array, dataVersion);
572572
}
573573
default:
574-
MTR_LOG_ERROR("Error: Unsupported TLV type for conversion: %u", static_cast<unsigned> (data->GetType()));
574+
MTR_LOG_ERROR("Error: Unsupported TLV type for conversion: %u", static_cast<unsigned>(data->GetType()));
575575
return nil;
576576
}
577577
}

src/darwin/Framework/CHIP/MTRDevice.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -2551,7 +2551,7 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID
25512551
MTRBaseDevice * baseDevice = [self newBaseDevice];
25522552
// Make sure to use writeRequests here, because that's what our batching
25532553
// handler will modify as needed.
2554-
NSCAssert(writeRequests.count == 1, @"Incorrect number of write requests: %lu", static_cast<unsigned long> (writeRequests.count));
2554+
NSCAssert(writeRequests.count == 1, @"Incorrect number of write requests: %lu", static_cast<unsigned long>(writeRequests.count));
25552555

25562556
auto * request = writeRequests[0];
25572557
MTRAttributePath * path = request[MTRDeviceWriteRequestFieldPathIndex];

src/darwin/Framework/CHIP/MTRDeviceController.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,14 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory
265265
concurrentSubscriptionPoolSize = static_cast<NSUInteger>(subscriptionPoolSizeOverride);
266266
}
267267

268-
MTR_LOG(" *** Overriding pool size of MTRDeviceController with: %lu", static_cast<unsigned long> (concurrentSubscriptionPoolSize));
268+
MTR_LOG(" *** Overriding pool size of MTRDeviceController with: %lu", static_cast<unsigned long>(concurrentSubscriptionPoolSize));
269269
}
270270

271271
if (!concurrentSubscriptionPoolSize) {
272272
concurrentSubscriptionPoolSize = 1;
273273
}
274274

275-
MTR_LOG("Setting up pool size of MTRDeviceController with: %lu", static_cast<unsigned long> (concurrentSubscriptionPoolSize));
275+
MTR_LOG("Setting up pool size of MTRDeviceController with: %lu", static_cast<unsigned long>(concurrentSubscriptionPoolSize));
276276

277277
_concurrentSubscriptionPool = [[MTRAsyncWorkQueue alloc] initWithContext:self width:concurrentSubscriptionPoolSize];
278278

0 commit comments

Comments
 (0)