Guido Serassio wrote:
Hi Amos,

Hi,

Who can help me to fix the following C++ errors on Visual Studio ?

1>auth_basic.cc
1>c:\work\nt-3.0\src\SquidString.h(97) : error C2057: expected
constant
expression
1>../../../src\auth/User.h(39) : warning C4099:
'AuthUserHashPointer' :
type name first seen using 'struct' now seen using 'class'
1>        ../../../src\auth/Gadgets.h(51) : see declaration of
'AuthUserHashPointer'
Regards

Guido

I think the TODO just needs to be enacted.
Changing the 'struct' to 'class'.


I need some hints for the SquidString.h error: it's a blocking error.
I remember you that my C++ knowledge is too much limited.


Hmm, looking deeper there is a few typedefs to clean out as well.

Patch attached.


Amos
--
Please be using
  Current Stable Squid 2.7.STABLE6 or 3.0.STABLE18
  Current Beta Squid 3.1.0.13
=== modified file 'src/auth/Gadgets.h'
--- src/auth/Gadgets.h	2009-03-08 21:19:10 +0000
+++ src/auth/Gadgets.h	2009-08-23 11:34:28 +0000
@@ -45,10 +45,8 @@
  * This is used to link auth_users into the username cache.
  * Because some schemes may link in aliases to a user,
  * the link is not part of the AuthUser structure itself.
- *
- \todo Inheritance in a struct? this should be a class.
  */
-struct AuthUserHashPointer : public hash_link {
+class AuthUserHashPointer : public hash_link {
     /* first two items must be same as hash_link */
 
 public:

=== modified file 'src/auth/digest/auth_digest.cc'
--- src/auth/digest/auth_digest.cc	2009-03-08 19:34:36 +0000
+++ src/auth/digest/auth_digest.cc	2009-08-23 11:36:37 +0000
@@ -463,10 +463,10 @@
     AuthUser *auth_user;
     debugs(29, 9, HERE << "Looking for user '" << username << "'");
 
-    if (username && (usernamehash = static_cast < auth_user_hash_pointer * >(hash_lookup(proxy_auth_username_cache, username)))) {
+    if (username && (usernamehash = static_cast < AuthUserHashPointer * >(hash_lookup(proxy_auth_username_cache, username)))) {
         while ((usernamehash->user()->auth_type != AUTH_DIGEST) &&
                 (usernamehash->next))
-            usernamehash = static_cast < auth_user_hash_pointer * >(usernamehash->next);
+            usernamehash = static_cast < AuthUserHashPointer * >(usernamehash->next);
 
         auth_user = NULL;
 
@@ -488,7 +488,7 @@
     AuthUser *auth_user;
     hash_first(proxy_auth_username_cache);
 
-    while ((usernamehash = ((auth_user_hash_pointer *) hash_next(proxy_auth_username_cache)))) {
+    while ((usernamehash = ((AuthUserHashPointer *) hash_next(proxy_auth_username_cache)))) {
         auth_user = usernamehash->user();
 
         if (strcmp(auth_user->config->type(), "digest") == 0)

=== modified file 'src/auth/ntlm/auth_ntlm.cc'
--- src/auth/ntlm/auth_ntlm.cc	2009-08-23 09:30:49 +0000
+++ src/auth/ntlm/auth_ntlm.cc	2009-08-23 11:37:09 +0000
@@ -404,7 +404,7 @@
         debugs(29, 4, "AuthNTLMUserRequest::authenticate: authenticated user " << ntlm_user->username());
         /* see if this is an existing user with a different proxy_auth
          * string */
-        auth_user_hash_pointer *usernamehash = static_cast<AuthUserHashPointer *>(hash_lookup(proxy_auth_username_cache, ntlm_user->username()));
+        AuthUserHashPointer *usernamehash = static_cast<AuthUserHashPointer *>(hash_lookup(proxy_auth_username_cache, ntlm_user->username()));
         AuthUser *local_auth_user = ntlm_request->user();
         while (usernamehash && (usernamehash->user()->auth_type != AUTH_NTLM || strcmp(usernamehash->user()->username(), ntlm_user->username()) != 0))
             usernamehash = static_cast<AuthUserHashPointer *>(usernamehash->next);

=== modified file 'src/typedefs.h'
--- src/typedefs.h	2009-07-27 21:50:59 +0000
+++ src/typedefs.h	2009-08-23 11:35:37 +0000
@@ -51,10 +51,6 @@
 
 
 /// \ingroup AuthAPI
-/// \deprecated Use AuthUserHashPointer instead.
-typedef struct AuthUserHashPointer auth_user_hash_pointer;
-
-/// \ingroup AuthAPI
 /// \deprecated Use AuthUserIP instead.
 typedef struct AuthUserIP auth_user_ip_t;
 

Reply via email to