wldap32: Don't produce unreachable code during conditional compilation. Found bySmatch.

Michael Stefaniuc mstefani at redhat.de
Mon Jul 23 15:25:50 CDT 2007


---
 dlls/wldap32/init.c  |   24 ++++++++++++++++--------
 dlls/wldap32/misc.c  |   12 ++++++++----
 dlls/wldap32/page.c  |    5 ++---
 dlls/wldap32/value.c |    6 ++++--
 4 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/dlls/wldap32/init.c b/dlls/wldap32/init.c
index a1cf79b..08cab81 100644
--- a/dlls/wldap32/init.c
+++ b/dlls/wldap32/init.c
@@ -236,8 +236,9 @@ exit:
     strfreeW( hostnameW );
     return ld;
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
@@ -288,8 +289,9 @@ exit:
     strfreeU( url );
     return ld;
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
@@ -342,8 +344,9 @@ exit:
     strfreeW( hostnameW );
     return ld;
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
@@ -395,8 +398,9 @@ exit:
     strfreeU( url );
     return ld;
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
@@ -423,8 +427,9 @@ exit:
     strfreeW( hostnameW );
     return ld;
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
@@ -475,8 +480,9 @@ exit:
     strfreeU( url );
     return ld;
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
@@ -502,8 +508,9 @@ WLDAP32_LDAP * CDECL ldap_sslinitA( PCHAR hostname, ULONG portnumber, int secure
     strfreeW( hostnameW );
     return ld;
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
@@ -559,8 +566,9 @@ exit:
     strfreeU( url );
     return ld;
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
diff --git a/dlls/wldap32/misc.c b/dlls/wldap32/misc.c
index 9007faf..9d938c8 100644
--- a/dlls/wldap32/misc.c
+++ b/dlls/wldap32/misc.c
@@ -375,8 +375,9 @@ WLDAP32_LDAPMessage * CDECL WLDAP32_ldap_first_entry( WLDAP32_LDAP *ld, WLDAP32_
     if (!ld || !res) return NULL;
     return ldap_first_entry( ld, res );
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
@@ -401,8 +402,9 @@ WLDAP32_LDAPMessage * CDECL WLDAP32_ldap_first_reference( WLDAP32_LDAP *ld, WLDA
     if (!ld) return NULL;
     return ldap_first_reference( ld, res );
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
@@ -536,8 +538,9 @@ WLDAP32_LDAPMessage * CDECL WLDAP32_ldap_next_entry( WLDAP32_LDAP *ld, WLDAP32_L
     if (!ld || !entry) return NULL;
     return ldap_next_entry( ld, entry );
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
@@ -565,8 +568,9 @@ WLDAP32_LDAPMessage * CDECL WLDAP32_ldap_next_reference( WLDAP32_LDAP *ld, WLDAP
     if (!ld || !entry) return NULL;
     return ldap_next_reference( ld, entry );
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
diff --git a/dlls/wldap32/page.c b/dlls/wldap32/page.c
index cc1d0af..a3ed112 100644
--- a/dlls/wldap32/page.c
+++ b/dlls/wldap32/page.c
@@ -152,9 +152,7 @@ static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie,
 ULONG CDECL ldap_create_page_controlW( WLDAP32_LDAP *ld, ULONG pagesize,
     struct WLDAP32_berval *cookie, UCHAR critical, PLDAPControlW *control )
 {
-    ULONG ret = LDAP_NOT_SUPPORTED;
 #ifdef HAVE_LDAP
-
     TRACE( "(%p, 0x%08x, %p, 0x%02x, %p)\n", ld, pagesize, cookie,
            critical, control );
 
@@ -163,8 +161,9 @@ ULONG CDECL ldap_create_page_controlW( WLDAP32_LDAP *ld, ULONG pagesize,
 
     return create_page_control( pagesize, cookie, critical, control );
 
+#else
+    return LDAP_NOT_SUPPORTED;
 #endif
-    return ret;
 }
 
 ULONG CDECL ldap_get_next_page( WLDAP32_LDAP *ld, PLDAPSearch search, ULONG pagesize,
diff --git a/dlls/wldap32/value.c b/dlls/wldap32/value.c
index 1d1155b..61bcfc3 100644
--- a/dlls/wldap32/value.c
+++ b/dlls/wldap32/value.c
@@ -272,8 +272,9 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenA( WLDAP32_LDAP *ld,
     strfreeW( attrW );
     return ret;
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
@@ -314,8 +315,9 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenW( WLDAP32_LDAP *ld,
     strfreeU( attrU );
     return (struct WLDAP32_berval **)ret;
 
-#endif
+#else
     return NULL;
+#endif
 }
 
 /***********************************************************************
-- 
1.5.2.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070723/9e6d5017/attachment-0001.pgp


More information about the wine-patches mailing list