Bug 99199

Summary: Tiny correction to the .vapi
Product: PulseAudio Reporter: Corentin Noël <corentin>
Component: miscAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Use the correct syntax

Description Corentin Noël 2016-12-26 10:54:45 UTC
Here is a small correction to use the right Vala syntax
Comment 1 Corentin Noël 2016-12-26 10:55:18 UTC
Created attachment 128655 [details] [review]
Use the correct syntax
Comment 2 Tanu Kaskinen 2017-01-03 17:28:08 UTC
Thanks for the patch!

So "static" was dropped from the declarations. Can you explain why "static" shouldn't be used? Do you have any guesses for why "static" was used in the first place? I'm sure your patch is correct, but I'd like to understand the patches that I apply, and I'm not familiar with Vala syntax.
Comment 3 Corentin Noël 2017-01-05 17:55:50 UTC
(In reply to Tanu Kaskinen from comment #2)
> Thanks for the patch!
> 
> So "static" was dropped from the declarations. Can you explain why "static"
> shouldn't be used? Do you have any guesses for why "static" was used in the
> first place? I'm sure your patch is correct, but I'd like to understand the
> patches that I apply, and I'm not familiar with Vala syntax.

This syntax was allowed on previous Vala version but this is a misuse of the "static" keyword. Only variables can be "static" and static means that the same content of the variable is accessible to any instances of an object.

In Vala, const is the equivalent to preprocessor constant used in C, so here the right way to declare them is to use const and not static, or here "static const"
Comment 4 Tanu Kaskinen 2017-01-07 00:38:28 UTC
Thanks for the explanation!

I pushed the patch now to the "next" branch.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.