]> git.sur5r.net Git - openldap/commitdiff
Silence compiler warnings
authorRalf Haferkamp <ralf@openldap.org>
Fri, 21 Sep 2007 11:27:23 +0000 (11:27 +0000)
committerRalf Haferkamp <ralf@openldap.org>
Fri, 21 Sep 2007 11:27:23 +0000 (11:27 +0000)
contrib/ldapc++/examples/main.cpp
contrib/ldapc++/examples/readSchema.cpp
contrib/ldapc++/src/LDAPAsynConnection.cpp

index 8fff4d4a1ede39662d820aeebc70afc96a7332f3..079413807552bf995640881ef25321500d94d2f2 100644 (file)
@@ -3,8 +3,8 @@
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
-#include<iostream.h>
-#include<strstream>
+#include<iostream>
+#include<sstream>
 #include "LDAPConnection.h"
 #include "LDAPConstraints.h"
 #include "LDAPSearchReference.h"
@@ -25,13 +25,13 @@ int main(){
     cons->setServerControls(ctrls);
     LDAPConnection *lc=new LDAPConnection("localhost",9009);
     lc->setConstraints(cons);
-    cout << "----------------------doing bind...." <<  endl;
+    std::cout << "----------------------doing bind...." << std::endl;
     try{
         lc->bind("cn=Manager,o=Organisation,c=DE" , "secret",cons);
-        cout << lc->getHost() << endl;    
+        std::cout << lc->getHost() << std::endl;    
         bool result = lc->compare("cn=Manager,o=Organisation,c=DE", 
                 LDAPAttribute("cn","Manaer"));
-        cout << "Compare: " << result << endl;
+        std::cout << "Compare: " << result << std::endl;
     
         LDAPAttributeList* attrs=new LDAPAttributeList();
         StringList values;
@@ -52,17 +52,17 @@ int main(){
         if (entries != 0){
             LDAPEntry* entry = entries->getNext();
             if(entry != 0){
-                cout << *(entry) << endl;
+                std::cout << *(entry) << std::endl;
             }
             while(entry){
                 try{
                     entry = entries->getNext();
                     if(entry != 0){
-                        cout << *(entry) << endl;
+                        std::cout << *(entry) << std::endl;
                     }
                     delete entry;
                 }catch(LDAPReferralException e){
-                    cout << "Caught Referral" << endl;
+                    std::cout << "Caught Referral" << std::endl;
                 }
             }
         }
@@ -70,12 +70,12 @@ int main(){
         lc->unbind();
         delete lc;
    }catch (LDAPException e){
-        cout << "------------------------- caught Exception ---------"<< endl;
-        cout << e << endl;
+        std::cout << "-------------- caught Exception ---------"<< std::endl;
+        std::cout << e << std::endl;
     }
 
     /*
-    cout << "--------------------starting search" << endl;
+    std::cout << "--------------------starting search" << std::endl;
     LDAPAttributeList* attrs=new LDAPAttributeList();
     StringList values;
     values.add("top");
@@ -105,28 +105,28 @@ int main(){
                 case LDAP_RES_SEARCH_ENTRY :
                     res2= (LDAPSearchResult*)res;
                     entry=  res2->getEntry();
-                    cout << "Entry:            " << *entry << endl; 
+                    std::cout << "Entry:            " << *entry << std::endl; 
                     delete res;
                     res=q->getNext();
                 break;
                 case LDAP_RES_SEARCH_REFERENCE :
-                    cout << "Reference:         "  << endl;
+                    std::cout << "Reference:         "  << std::endl;
                     delete res;
                     res=q->getNext();
                 break;
                 default :
-                    cout << ( *(LDAPResult*) res) << endl;
+                    std::cout << ( *(LDAPResult*) res) << std::endl;
                     delete res;
-                    cout  << "-----------------search done" << endl;
+                    std::cout  << "-----------------search done" << std::endl;
                     cont=false;
                 break;
             }
         }
         delete q;
     }catch (LDAPException e){
-        cout << "----------------error during search" << endl;
+        std::cout << "----------------error during search" << std::endl;
         delete q;
-        cout << e << endl;
+        std::cout << e << std::endl;
     }
     lc->unbind();
     */
index 483e50360fa5ff7105bbc89df0bd20b606ce9aa2..780e92bd951c2ef2e2149a9ad752419bfc78757d 100644 (file)
@@ -1,5 +1,5 @@
-#include<iostream.h>
-#include<strstream>
+#include<iostream>
+#include<sstream>
 #include "LDAPConnection.h"
 #include "LDAPConstraints.h"
 #include "LDAPSearchReference.h"
 
 int main(){
     LDAPConnection *lc=new LDAPConnection("192.168.3.128",389);
-    cout << "----------------------doing bind...." <<  endl;
+    std::cout << "----------------------doing bind...." <<  std::endl;
     try{
         lc->bind("uid=admin,dc=home,dc=local" , "secret");
-        cout << lc->getHost() << endl;
+        std::cout << lc->getHost() << std::endl;
         StringList tmp;
         tmp.add("subschemasubentry");
         LDAPSearchResults* entries = lc->search("", 
@@ -45,14 +45,14 @@ int main(){
                 LDAPSchema schema;
                 schema.setObjectClasses((oc->getValues()));
                 LDAPObjClass test = schema.getObjectClassByName("inetOrgPerson");
-                cout << test.getDesc() << endl;
+                std::cout << test.getDesc() << std::endl;
 //                StringList mustAttr = test.getMay();
 //                for( StringList::const_iterator i = mustAttr.begin(); i != mustAttr.end(); i++ ){
-//                    cout << *i << endl;
+//                    std::cout << *i << std::endl;
 //                }
                 StringList sup = test.getSup();
                 for( StringList::const_iterator i = sup.begin(); i != sup.end(); i++ ){
-                    cout << *i << endl;
+                    std::cout << *i << std::endl;
                 }
             }
         }
@@ -60,8 +60,8 @@ int main(){
         lc->unbind();
         delete lc;
    }catch (LDAPException e){
-        cout << "------------------------- caught Exception ---------"<< endl;
-        cout << e << endl;
+        std::cout << "---------------- caught Exception ---------"<< std::endl;
+        std::cout << e << std::endl;
     }
 
 }
index 7774a674d580b397a25eed6c3a8ce8d1554735c7..cb2542b514ce3c41a0edd4cb778e2619b52196e1 100644 (file)
@@ -53,7 +53,7 @@ void LDAPAsynConnection::init(const string& hostname, int port){
     LDAPURLDesc url;
     memset( &url, 0, sizeof(url));
 
-    url.lud_scheme = "ldap";
+    url.lud_scheme = strdup("ldap");
     url.lud_host = strdup(hostname.c_str());
     url.lud_port = port;
     url.lud_scope = LDAP_SCOPE_DEFAULT;