Fix libmapiadmin and exchange2mbox compilation warnings
authorJulien Kerihuel <j.kerihuel@openchange.org>
Fri, 24 Feb 2012 13:44:27 +0000 (13:44 +0000)
committerJulien Kerihuel <j.kerihuel@openchange.org>
Fri, 24 Feb 2012 13:44:27 +0000 (13:44 +0000)
libmapiadmin/mapiadmin_user.c
utils/exchange2mbox.c

index 25da89bbfdd25807ba3264c15b397747fcd927b6..9efd4af4b5204ac18d90c99c78dcc8ce9cfc36ff 100644 (file)
@@ -149,7 +149,6 @@ struct tce_async_context {
 static int tce_search_callback(struct ldb_request *req, struct ldb_reply *ares)
 {
        struct tce_async_context        *actx = talloc_get_type(req->context, struct tce_async_context);
-       int                             ret;
 
         switch (ares->type) {
 
@@ -162,7 +161,6 @@ static int tce_search_callback(struct ldb_request *req, struct ldb_reply *ares)
                }
                 break;
         case LDB_REPLY_DONE:
-                ret = 0;
                 break;
         default:
                DEBUG(3, ("[%s:%d]: unknown Reply Type ignore it\n", __FUNCTION__, __LINE__));
@@ -365,7 +363,6 @@ _PUBLIC_ enum MAPISTATUS mapiadmin_user_add(struct mapiadmin_ctx *mapiadmin_ctx)
        NTSTATUS                        status;
        enum MAPISTATUS                 retval;
        struct mapi_context             *mapi_ctx;
-       struct mapi_profile             *profile;
        struct samr_CreateUser2         r;
        struct samr_GetUserPwInfo       pwp;
        struct samr_SetUserInfo         s;
@@ -382,7 +379,6 @@ _PUBLIC_ enum MAPISTATUS mapiadmin_user_add(struct mapiadmin_ctx *mapiadmin_ctx)
        MAPI_RETVAL_IF(retval, retval, mem_ctx);
 
        DEBUG(3, ("Creating account %s\n", mapiadmin_ctx->username));
-       profile = mapiadmin_ctx->session->profile;
 
        mapi_ctx = mapiadmin_ctx->session->mapi_ctx;
        MAPI_RETVAL_IF(!mapi_ctx, MAPI_E_NOT_INITIALIZED, mem_ctx);
index d9e0252ebd8edde7e81fdc6f716e1552ce73b5a7..04b23443bfa15a9edd8c41dd2bb268fe8cc960a8 100644 (file)
@@ -545,10 +545,7 @@ static bool message2mbox(TALLOC_CTX *mem_ctx, FILE *fp,
        const char                      *cc = NULL;
        const char                      *bcc = NULL;
        const char                      *from = NULL;
-       const char                      *normalizedsubject = NULL;
-       const char                      *subject_prefix = NULL;
        const char                      *subject = NULL;
-       const char                      *thread_topic = NULL;
        const char                      *msgid;
        const char                      *msgheaders = NULL;
        const char                      *attach_filename;
@@ -564,10 +561,9 @@ static bool message2mbox(TALLOC_CTX *mem_ctx, FILE *fp,
        struct SRowSet                  rowset_attach;
        uint32_t                        count;
        unsigned int                    i;
-       ssize_t                         len;
-       int header_done = 0;
-       body_stuff_t body[3];
-       int body_count = 0;
+       int                             header_done = 0;
+       body_stuff_t                    body[3];
+       int                             body_count = 0;
 
        has_attach = (const uint8_t *) octool_get_propval(aRow, PR_HASATTACH);
        to = (const char *) octool_get_propval(aRow, PR_DISPLAY_TO);
@@ -586,10 +582,7 @@ static bool message2mbox(TALLOC_CTX *mem_ctx, FILE *fp,
                from = "unknown";
        }
 
-       subject_prefix = (const char *) octool_get_propval(aRow, PR_SUBJECT_PREFIX);
-       normalizedsubject = (const char *) octool_get_propval(aRow, PR_NORMALIZED_SUBJECT);
        subject = (const char*) octool_get_propval(aRow, PR_SUBJECT);
-       thread_topic = (const char *) octool_get_propval(aRow, PR_CONVERSATION_TOPIC);
        msgid = (const char *) octool_get_propval(aRow, PR_INTERNET_MESSAGE_ID);
 
        msgheaders = (const char *) octool_get_propval(aRow, PR_TRANSPORT_MESSAGE_HEADERS);
@@ -688,14 +681,14 @@ old_code:
                /* Second line: Date */
                line = talloc_asprintf(mem_ctx, "Date: %s\n", date);
                if (line) {
-                       len = fwrite(line, strlen(line), 1, fp);
+                       fwrite(line, strlen(line), 1, fp);
                }
                talloc_free(line);
 
                /* Third line From */
                line = talloc_asprintf(mem_ctx, "From: %s\n", from);
                if (line) {
-                       len = fwrite(line, strlen(line), 1, fp);
+                       fwrite(line, strlen(line), 1, fp);
                }
                talloc_free(line);
 
@@ -703,7 +696,7 @@ old_code:
                if (to) {
                        line = talloc_asprintf(mem_ctx, "To: %s\n", to);
                        if (line) {
-                               len = fwrite(line, strlen(line), 1, fp);
+                               fwrite(line, strlen(line), 1, fp);
                        }
                        talloc_free(line);
                }
@@ -711,7 +704,7 @@ old_code:
                if (cc) {
                        line = talloc_asprintf(mem_ctx, "Cc: %s\n", cc);
                        if (line) {
-                               len = fwrite(line, strlen(line), 1, fp);
+                               fwrite(line, strlen(line), 1, fp);
                        }
                        talloc_free(line);
                }
@@ -719,7 +712,7 @@ old_code:
                if (bcc) {
                        line = talloc_asprintf(mem_ctx, "Bcc: %s\n", bcc);
                        if (line) {
-                               len = fwrite(line, strlen(line), 1, fp);
+                               fwrite(line, strlen(line), 1, fp);
                        }
                        talloc_free(line);
                }
@@ -728,7 +721,7 @@ old_code:
                if (subject) {
                        line = talloc_asprintf(mem_ctx, "Subject: %s\n", subject);
                        if (line) {
-                               len = fwrite(line, strlen(line), 1, fp);
+                               fwrite(line, strlen(line), 1, fp);
                        }
                        talloc_free(line);
                }
@@ -736,7 +729,7 @@ old_code:
                if (msgid) {
                        line = talloc_asprintf(mem_ctx, "Message-ID: %s\n", msgid);
                        if (line) {
-                               len = fwrite(line, strlen(line), 1, fp);
+                               fwrite(line, strlen(line), 1, fp);
                        }
                        talloc_free(line);
                }
@@ -757,7 +750,7 @@ old_code:
                if ((has_attach && *has_attach) || body_count > 1) {
                        /* blank line before content */
                        if (!header_done) {
-                               len = fwrite("\n", 1, 1, fp);
+                               fwrite("\n", 1, 1, fp);
                                header_done = 1;
                        }
                        fprintf(fp, "--%s\n", boundary(base_level+0));
@@ -776,21 +769,21 @@ old_code:
                /*
                 * output content type
                 */
-               len = fwrite(body[0].body_header, strlen(body[0].body_header), 1, fp);
+               fwrite(body[0].body_header, strlen(body[0].body_header), 1, fp);
                fprintf(fp, "Content-Disposition: inline\n");
 
                /* blank after header */
-               len = fwrite("\n", 1, 1, fp);
+               fwrite("\n", 1, 1, fp);
                header_done = 1;
 
                fix_froms(body[0].body.data, body[0].body.length);
-               len = fwrite(body[0].body.data, body[0].body.length, 1, fp);
+               fwrite(body[0].body.data, body[0].body.length, 1, fp);
                talloc_free(body[0].body.data);
        }
 
        /* blank line before content */
        if (!header_done) {
-               len = fwrite("\n", 1, 1, fp);
+               fwrite("\n", 1, 1, fp);
                header_done = 1;
        }
 
@@ -801,11 +794,11 @@ old_code:
                } else {
                        fprintf(fp, "\n\n--%s\n", boundary(base_level+0));
                }
-               len = fwrite(body[i].body_header, strlen(body[i].body_header), 1, fp);
+               fwrite(body[i].body_header, strlen(body[i].body_header), 1, fp);
                fprintf(fp, "Content-Disposition: inline\n");
-               len = fwrite("\n", 1, 1, fp);
+               fwrite("\n", 1, 1, fp);
                fix_froms(body[i].body.data, body[i].body.length);
-               len = fwrite(body[i].body.data, body[i].body.length, 1, fp);
+               fwrite(body[i].body.data, body[i].body.length, 1, fp);
        }
 
        if (has_attach && *has_attach) {
@@ -970,7 +963,7 @@ old_code:
 
                        line = talloc_asprintf(mem_ctx, "\n\n--%s--\n\n\n", boundary(base_level+0));
                        if (line) {
-                               len = fwrite(line, strlen(line), 1, fp);
+                               fwrite(line, strlen(line), 1, fp);
                        }
                        talloc_free(line);
                }
@@ -979,7 +972,7 @@ old_code:
                fprintf(fp, "\n\n--%s--\n", boundary(base_level+0));
        }
        
-       len = fwrite("\n\n\n", 3, 1, fp);
+       fwrite("\n\n\n", 3, 1, fp);
 
        return true;
 }