wldap32: Remove superfluous const in ldap_init declarations.

Hans Leidekker hans at codeweavers.com
Mon Oct 19 04:54:24 CDT 2015


On Mon, 2015-10-19 at 11:28 +0200, Henri Verbeet wrote:
> On 19 October 2015 at 10:09, Hans Leidekker <hans at codeweavers.com> wrote:
> > On Sun, 2015-10-18 at 11:08 +0200, Thomas Faber wrote:
> >> diff --git a/dlls/wldap32/winldap_private.h b/dlls/wldap32/winldap_private.h
> >> index a19ceb1..8596d1d 100644
> >> --- a/dlls/wldap32/winldap_private.h
> >> +++ b/dlls/wldap32/winldap_private.h
> >> @@ -361,8 +361,8 @@ PCHAR * CDECL ldap_get_valuesA(WLDAP32_LDAP*,WLDAP32_LDAPMessage*,PCHAR);
> >>  PWCHAR * CDECL ldap_get_valuesW(WLDAP32_LDAP*,WLDAP32_LDAPMessage*,PWCHAR);
> >>  PBERVAL * CDECL ldap_get_values_lenA(WLDAP32_LDAP*,WLDAP32_LDAPMessage*,PCHAR);
> >>  PBERVAL * CDECL ldap_get_values_lenW(WLDAP32_LDAP*,WLDAP32_LDAPMessage*,PWCHAR);
> >> -WLDAP32_LDAP * CDECL ldap_initA(const PCHAR,ULONG);
> >> -WLDAP32_LDAP * CDECL ldap_initW(const PWCHAR,ULONG);
> >> +WLDAP32_LDAP * CDECL ldap_initA(PCHAR,ULONG);
> >> +WLDAP32_LDAP * CDECL ldap_initW(PWCHAR,ULONG);
> >
> > You should make the implementation match the prototype instead.
> >
> The const does (almost) nothing. The intention may have been for these
> to be "const char *" and "const WCHAR *", but that's not how typedefs
> work. That's also one of the many reasons why pointer typedefs like
> PCHAR and PWCHAR are usually best avoided.

I'm not sure that's a reason to differ from the psdk though. Note that
these definitions are duplicated in winldap_private.h (with some 
modifications) because including the public header would cause conflicts
with native ldap headers.





More information about the wine-devel mailing list