[vlc-devel] [PATCH] Fixed warning on incompatible pointer types

Felix Paul Kühne fkuehne at videolan.org
Mon Nov 18 14:22:32 CET 2013


Hello Maxim,

On 18.11.2013, at 08:44, Maxim Bublis <b at codemonkey.ru> wrote:

> ---
> modules/gui/macosx/wizard.m | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/gui/macosx/wizard.m b/modules/gui/macosx/wizard.m
> index 082b1e9..fbe558c 100644
> --- a/modules/gui/macosx/wizard.m
> +++ b/modules/gui/macosx/wizard.m
> @@ -1133,7 +1133,7 @@ static VLCWizard *_o_sharedInstance = nil;
>                             z += 1;
>                         }
>                     }
> -                    tempString = [NSString stringWithFormat: @"%@%@.%@",
> +                    tempString = [NSMutableString stringWithFormat: @"%@%@.%@",
>                         [o_t7_fld_filePath stringValue],
>                         fileNameToUse, theEncapFormat];
>                     if ([[NSFileManager defaultManager] fileExistsAtPath:
> @@ -1144,7 +1144,7 @@ static VLCWizard *_o_sharedInstance = nil;
>                         int additionalInt = 1;
>                         while( additionalInt < 100)
>                         {
> -                            tempString = [NSString stringWithFormat:@"%@%@ %i.%@",
> +                            tempString = [NSMutableString stringWithFormat:@"%@%@ %i.%@",
>                                 [o_t7_fld_filePath stringValue],
>                                 fileNameToUse, additionalInt, theEncapFormat];
>                             if(! [[NSFileManager defaultManager]
> -- 
> 1.8.3.4 (Apple Git-47)

This patch is technically correct and solves the compilation warning you found. However, the more elegant way would be to fix the tempString definition by switching from NSMutableString to NSString as we don't do any mutable string operations on this temporary variable.

I'll submit such a patch in a minute or two.

Best regards,

Felix





More information about the vlc-devel mailing list