From: Steve Brokenshire Date: Sun, 2 Aug 2015 18:29:34 +0000 (+0100) Subject: Removed unused variables and some code cleanup done on the CardDAV support. X-Git-Tag: release-0.05~101 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=b7afe0edc05dcd011a87064f787691e8403b4161;p=xestiaab%2F.git Removed unused variables and some code cleanup done on the CardDAV support. --- diff --git a/source/carddav/carddav.cpp b/source/carddav/carddav.cpp index 5a07c41..095ab95 100644 --- a/source/carddav/carddav.cpp +++ b/source/carddav/carddav.cpp @@ -13,7 +13,6 @@ size_t WritebackFunc(char *ptr, size_t size, size_t nmemb, wxString *stream){ wxString Data; - wxString *PageInput; Data = wxString::FromUTF8((char *)ptr); stream->Append(Data); @@ -496,7 +495,7 @@ void CardDAV::ProcessDataThread(){ struct UploadDataStruc UploadData; - ActIter = ActivityListPtr->find(ItemIndex); + ActIter = ActivityListPtr->find((int)ItemIndex); // Update result flag. @@ -768,7 +767,7 @@ void CardDAV::ProcessDataThread(){ fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(claconncode)); - long http_code = 0; + int http_code = 0; curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code); fprintf(stderr, "Error code was: %d\n", http_code); @@ -778,7 +777,7 @@ void CardDAV::ProcessDataThread(){ fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(claconncode)); - long http_code = 0; + int http_code = 0; curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code); fprintf(stderr, "Error code was: %d\n", http_code); @@ -1062,7 +1061,7 @@ void CardDAV::GetServerContactData() struct UploadDataStruc UploadData; - ActIter = ActivityListPtr->find(ItemIndex); + ActIter = ActivityListPtr->find((int)ItemIndex); //ActIter->second = 1; @@ -1299,7 +1298,7 @@ void CardDAV::GetServerContactData() fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(claconncode)); - long http_code = 0; + int http_code = 0; curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code); fprintf(stderr, "Error code was: %d\n", http_code); @@ -1309,7 +1308,7 @@ void CardDAV::GetServerContactData() fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(claconncode)); - long http_code = 0; + int http_code = 0; curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code); fprintf(stderr, "Error code was: %d\n", http_code); @@ -1452,7 +1451,7 @@ void CardDAV::GetServerETagValueThread() struct UploadDataStruc UploadData; - ActIter = ActivityListPtr->find(ItemIndex); + ActIter = ActivityListPtr->find((int)ItemIndex); static const char* query = "" @@ -1702,7 +1701,7 @@ void CardDAV::GetServerETagValueThread() fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(claconncode)); - long http_code = 0; + int http_code = 0; curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code); fprintf(stderr, "Error code was: %d\n", http_code); @@ -1712,7 +1711,7 @@ void CardDAV::GetServerETagValueThread() fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(claconncode)); - long http_code = 0; + int http_code = 0; curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code); fprintf(stderr, "Error code was: %d\n", http_code); @@ -1778,7 +1777,7 @@ void CardDAV::GetServerETagValueThread() xmlDocPtr xmlCardDAVDoc; - xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), PageData.Len(), "noname.xml", NULL, 0); + xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), (int)PageData.Len(), "noname.xml", NULL, 0); xmlNodePtr nodeLevel1; xmlNodePtr nodeLevel2; @@ -1892,7 +1891,7 @@ void CardDAV::GetServerETagValueThread() } - if (HREFFound = TRUE && ETagFound == TRUE){ + if (HREFFound == TRUE && ETagFound == TRUE){ // Add to the map data. @@ -1915,7 +1914,6 @@ void CardDAV::GetServerETagValueThread() xmlFreeDoc(xmlCardDAVDoc); // Get the first result. - for (std::map::iterator iter = xmlDataMap.begin(); iter != xmlDataMap.end(); ++iter){ @@ -2005,12 +2003,10 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ AbortConnection = FALSE; CURL *conn; - CURLcode conncode; wxString ServerAddressURL; wxString ServerAuth; wxString ServerAddressSSL; - wxString ServerAddressNormal; - + wxString ServerAddressNormal; conn = curl_easy_init(); @@ -2098,7 +2094,7 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ std::map::iterator ActIter; struct UploadDataStruc UploadData; - ActIter = ActivityListPtr->find(ItemIndex); + ActIter = ActivityListPtr->find((int)ItemIndex); curl_slist *slist = NULL; @@ -2346,7 +2342,7 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(claconncode)); - long http_code = 0; + int http_code = 0; curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code); fprintf(stderr, "Error code was: %d\n", http_code); @@ -2356,7 +2352,7 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(claconncode)); - long http_code = 0; + int http_code = 0; curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code); fprintf(stderr, "Error code was: %d\n", http_code); @@ -2411,9 +2407,9 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(claconncode)); - long http_code = 0; + int http_code = 0; curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code); - fprintf(stderr, "Error code was: %l\n", http_code); + fprintf(stderr, "Error code was: %i\n", http_code); return ContactListFinal; @@ -2421,9 +2417,9 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(claconncode)); - long http_code = 0; + int http_code = 0; curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code); - fprintf(stderr, "Error code was: %l\n", http_code); + fprintf(stderr, "Error code was: %i\n", http_code); return ContactListFinal; @@ -2432,7 +2428,7 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ } xmlDocPtr xmlCardDAVDoc; - xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), PageData.Len(), "noname.xml", NULL, 0); + xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), (int)PageData.Len(), "noname.xml", NULL, 0); xmlNodePtr nodeLevel1; xmlNodePtr nodeLevel2; @@ -2541,8 +2537,8 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ if ((!xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"status") || !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"d:status") || - !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"D:status") && HTTPStatus == FALSE) - ){ + !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"D:status")) && HTTPStatus == FALSE) + { // Get the filename. @@ -2750,8 +2746,8 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ if ((!xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"status") || !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"d:status") || - !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"D:status") && HTTPStatus == FALSE) - ){ + !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"D:status")) && HTTPStatus == FALSE) + { // Get the filename. @@ -3147,7 +3143,7 @@ wxString CardDAV::GetDefaultAddressBookURL(){ // Process the XML data from the application. xmlDocPtr xmlCardDAVDoc; - xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), PageData.Len(), "noname.xml", NULL, 0); + xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), (int)PageData.Len(), "noname.xml", NULL, 0); xmlNodePtr nodeLevel1; xmlNodePtr nodeLevel2; @@ -3326,7 +3322,7 @@ wxString CardDAV::GetDefaultAddressBookURL(){ } - xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), PageData.Len(), "noname.xml", NULL, 0); + xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), (int)PageData.Len(), "noname.xml", NULL, 0); for (nodeLevel1 = xmlCardDAVDoc->children; nodeLevel1 != NULL; @@ -3497,7 +3493,7 @@ wxString CardDAV::GetDefaultAddressBookURL(){ } - xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), PageData.Len(), "noname.xml", NULL, 0); + xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), (int)PageData.Len(), "noname.xml", NULL, 0); for (nodeLevel1 = xmlCardDAVDoc->children; nodeLevel1 != NULL;