From 628684c3c1416f167adb474676ab875b707bcc89 Mon Sep 17 00:00:00 2001 From: Michael Rebello Date: Thu, 12 Sep 2019 22:40:02 -0700 Subject: [PATCH] ios: fix formatting warnings (#438) Fixes the following warnings: ``` library/objective-c/EnvoyConfiguration.m:26:61: warning: values of type 'UInt32' should not be used as format arguments; add an explicit cast to 'unsigned int' instead [-Wformat] @"connect_timeout" : [NSString stringWithFormat:@"%is", self.connectTimeoutSeconds], ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~ %u (unsigned int) library/objective-c/EnvoyConfiguration.m:27:62: warning: values of type 'UInt32' should not be used as format arguments; add an explicit cast to 'unsigned int' instead [-Wformat] @"dns_refresh_rate" : [NSString stringWithFormat:@"%is", self.dnsRefreshSeconds], ~~ ^~~~~~~~~~~~~~~~~~~~~~ %u (unsigned int) library/objective-c/EnvoyConfiguration.m:28:66: warning: values of type 'UInt32' should not be used as format arguments; add an explicit cast to 'unsigned int' instead [-Wformat] @"stats_flush_interval" : [NSString stringWithFormat:@"%is", self.statsFlushSeconds] ~~ ^~~~~~~~~~~~~~~~~~~~~~ %u (unsigned int) ``` Signed-off-by: Michael Rebello Signed-off-by: JP Simard --- mobile/library/objective-c/EnvoyConfiguration.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mobile/library/objective-c/EnvoyConfiguration.m b/mobile/library/objective-c/EnvoyConfiguration.m index e908cee82bc3..a4e29cde8c1b 100644 --- a/mobile/library/objective-c/EnvoyConfiguration.m +++ b/mobile/library/objective-c/EnvoyConfiguration.m @@ -23,9 +23,11 @@ - (instancetype)initWithDomain:(NSString *)domain - (nullable NSString *)resolveTemplate:(NSString *)templateYAML { NSDictionary *templateKeysToValues = @{ @"domain" : self.domain, - @"connect_timeout" : [NSString stringWithFormat:@"%is", self.connectTimeoutSeconds], - @"dns_refresh_rate" : [NSString stringWithFormat:@"%is", self.dnsRefreshSeconds], - @"stats_flush_interval" : [NSString stringWithFormat:@"%is", self.statsFlushSeconds] + @"connect_timeout" : + [NSString stringWithFormat:@"%lu", (unsigned long)self.connectTimeoutSeconds], + @"dns_refresh_rate" : [NSString stringWithFormat:@"%lu", (unsigned long)self.dnsRefreshSeconds], + @"stats_flush_interval" : + [NSString stringWithFormat:@"%lu", (unsigned long)self.statsFlushSeconds] }; for (NSString *templateKey in templateKeysToValues) {