Skip to content

Commit 66c65a4

Browse files
committed
Fixing format
1 parent b9b1cba commit 66c65a4

6 files changed

+21
-21
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

+4-4
Original file line numberDiff line numberDiff line change
@@ -2158,7 +2158,7 @@ - (void)_setupSubscription
21582158
return;
21592159
}
21602160

2161-
MTR_LOG("%@ Subscribe with data version list size %lu, reduced by %lu", self, static_cast<unsigned long> dataVersions.count, static_cast<unsigned long> dataVersionFilterListSizeReduction);
2161+
MTR_LOG("%@ Subscribe with data version list size %lu, reduced by %lu", self, static_cast<unsigned long>(dataVersions.count), static_cast<unsigned long>(dataVersionFilterListSizeReduction));
21622162

21632163
// Callback and ClusterStateCache and ReadClient will be deleted
21642164
// when OnDone is called.
@@ -2389,7 +2389,7 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath)
23892389
[readRequestsNext removeObjectAtIndex:0];
23902390
[readRequestsCurrent addObject:readItem];
23912391
MTR_LOG("Batching read attribute work item [%llu]: added %@ (now %lu requests total) [0x%016llX:%@:0x%llx:0x%llx]",
2392-
workItemID, readItem, static_cast<unsigned long> readRequestsCurrent.count, nodeID.unsignedLongLongValue, endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue);
2392+
workItemID, readItem, static_cast<unsigned long>(readRequestsCurrent.count), nodeID.unsignedLongLongValue, endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue);
23932393
outcome = MTRBatchedPartially;
23942394
}
23952395
NSCAssert(readRequestsNext.count == 0, @"should have batched everything or returned early");
@@ -2516,7 +2516,7 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID
25162516

25172517
if (writeRequestsCurrent.count != 1) {
25182518
// Very unexpected!
2519-
MTR_LOG_ERROR("Batching write attribute work item [%llu]: Unexpected write request count %lu", workItemID, static_cast<unsigned long> writeRequestsCurrent.count);
2519+
MTR_LOG_ERROR("Batching write attribute work item [%llu]: Unexpected write request count %lu", workItemID, static_cast<unsigned long>(writeRequestsCurrent.count));
25202520
return MTRNotBatched;
25212521
}
25222522

@@ -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

+5-5
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

@@ -1842,7 +1842,7 @@ - (MTRBaseDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:(NSError
18421842
- (BOOL)openPairingWindow:(uint64_t)deviceID duration:(NSUInteger)duration error:(NSError * __autoreleasing *)error
18431843
{
18441844
if (duration > UINT16_MAX) {
1845-
MTR_LOG_ERROR("Error: Duration %lu is too large. Max value %d", static_cast<unsigned long> duration, UINT16_MAX);
1845+
MTR_LOG_ERROR("Error: Duration %lu is too large. Max value %d", static_cast<unsigned long>(duration), UINT16_MAX);
18461846
if (error) {
18471847
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_INTEGER_VALUE];
18481848
}
@@ -1868,15 +1868,15 @@ - (NSString *)openPairingWindowWithPIN:(uint64_t)deviceID
18681868
error:(NSError * __autoreleasing *)error
18691869
{
18701870
if (duration > UINT16_MAX) {
1871-
MTR_LOG_ERROR("Error: Duration %lu is too large. Max value %d", static_cast<unsigned long> duration, UINT16_MAX);
1871+
MTR_LOG_ERROR("Error: Duration %lu is too large. Max value %d", static_cast<unsigned long>(duration), UINT16_MAX);
18721872
if (error) {
18731873
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_INTEGER_VALUE];
18741874
}
18751875
return nil;
18761876
}
18771877

18781878
if (discriminator > 0xfff) {
1879-
MTR_LOG_ERROR("Error: Discriminator %lu is too large. Max value %d", static_cast<unsigned long> discriminator, 0xfff);
1879+
MTR_LOG_ERROR("Error: Discriminator %lu is too large. Max value %d", static_cast<unsigned long>(discriminator), 0xfff);
18801880
if (error) {
18811881
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_INTEGER_VALUE];
18821882
}

src/darwin/Framework/CHIP/MTRThreadOperationalDataset.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ - (BOOL)_populateCppOperationalDataset
102102
- (BOOL)_checkDataLength:(NSData *)data expectedLength:(size_t)expectedLength
103103
{
104104
if (data.length != expectedLength) {
105-
MTR_LOG_ERROR("Length Check Failed. Length:%lu is incorrect, must be %tu", static_cast<unsigned long> data.length, expectedLength);
105+
MTR_LOG_ERROR("Length Check Failed. Length:%lu is incorrect, must be %tu", static_cast<unsigned long>(data.length), expectedLength);
106106
return NO;
107107
}
108108
return YES;

0 commit comments

Comments
 (0)