Re: commctrl: modularize progress drawing
From: "Frank Richter" <frank.richter(a)gmail.com>
Frank Richter <frank.richter(a)gmail.com> Split up the drawing code into a set of smaller functions and also moved some common computations into helper functions. All that to facilitate the implementation of the forthcoming theming support.
+static inline int PROGRESS_GetLedSize( PROGRESS_INFO *infoPtr, LONG style,
It has become the norm lately to not have the ALLCAPS_ prefix for internal static functions, but rather have names_with_underscores to easily tell them apart from Win32 APIs. So for the above, I guess get_led_size() would be preferable. -- Dimi Paun <dimi(a)lattica.com> Lattica, Inc.
Dimi Paun wrote:
It has become the norm lately to not have the ALLCAPS_ prefix for internal static functions, but rather have names_with_underscores to easily tell them apart from Win32 APIs.
So for the above, I guess get_led_size() would be preferable.
I thought the only half-official rule would be to keep the style consistent with the rest of the file, which is just what Frank is doing here since progress.c uses ALLCAPS_CamelCase everywhere? And actually I'd prefer ALLCAPS_CamcelCase over kernel_style since the latter looks quite alien in Win32 code... and looking at wine-patches from the last weeks it seems I'm not alone. :) Felix
From: "Felix Nawothnig" <felix.nawothnig(a)t-online.de>
It has become the norm lately to not have the ALLCAPS_ prefix for internal static functions, but rather have names_with_underscores to easily tell them apart from Win32 APIs.
So for the above, I guess get_led_size() would be preferable.
I thought the only half-official rule would be to keep the style consistent with the rest of the file, which is just what Frank is doing here since progress.c uses ALLCAPS_CamelCase everywhere?
Correct. But in this case I think it's warranted as we add a lot more functions than the there exists. And besides, I initially wrote this control, and I think we're better off dropping the illy prefix :)
And actually I'd prefer ALLCAPS_CamcelCase over kernel_style since the latter looks quite alien in Win32 code... and looking at wine-patches from the last weeks it seems I'm not alone. :)
This ALLCAPS prefix comes from a day long gone when we didn't have DLL separation. Now it just hurts the eye and it's distracting, without providing much benefit for internal functions. I think we're safe to assume that the prefered rule is: -- static functions don't have a prefix, and use the_undescode_names -- non-static ones keep the prefix, to avoid namespace polution. -- Dimi Paun <dimi(a)lattica.com> Lattica, Inc.
participants (2)
-
Dimi Paun -
Felix Nawothnig