Skip to content

Commit

Permalink
ios: fix formatting warnings (#438)
Browse files Browse the repository at this point in the history
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 <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
  • Loading branch information
rebello95 authored and jpsim committed Nov 28, 2022
1 parent efd9047 commit 628684c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mobile/library/objective-c/EnvoyConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ - (instancetype)initWithDomain:(NSString *)domain
- (nullable NSString *)resolveTemplate:(NSString *)templateYAML {
NSDictionary<NSString *, NSString *> *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) {
Expand Down

0 comments on commit 628684c

Please sign in to comment.