Commit d6906413 authored by Eric Covener's avatar Eric Covener
Browse files

backport r1125877 from trunk


Fix various "variable 'x' set but not used" warnings.


Submitted By: sf
Reviewed By: ylavic, wrowe, covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1777403 13f79535-47bb-0310-9956-ffa450edef68
parent 64f3f90c
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1050,7 +1050,6 @@ static const char *gen_nonce(apr_pool_t *p, apr_time_t now, const char *opaque,
                             const digest_config_rec *conf)
{
    char *nonce = apr_palloc(p, NONCE_LEN+1);
    int len;
    time_rec t;

    if (conf->nonce_lifetime != 0) {
@@ -1066,7 +1065,7 @@ static const char *gen_nonce(apr_pool_t *p, apr_time_t now, const char *opaque,
        /* XXX: WHAT IS THIS CONSTANT? */
        t.time = 42;
    }
    len = apr_base64_encode_binary(nonce, t.arr, sizeof(t.arr));
    apr_base64_encode_binary(nonce, t.arr, sizeof(t.arr));
    gen_nonce_hash(nonce+NONCE_TIME_LEN, nonce, opaque, server, conf);

    return nonce;
@@ -1411,7 +1410,6 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,
                       const digest_config_rec *conf)
{
    apr_time_t dt;
    int len;
    time_rec nonce_time;
    char tmp, hash[NONCE_HASH_LEN+1];

@@ -1425,7 +1423,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,

    tmp = resp->nonce[NONCE_TIME_LEN];
    resp->nonce[NONCE_TIME_LEN] = '\0';
    len = apr_base64_decode_binary(nonce_time.arr, resp->nonce);
    apr_base64_decode_binary(nonce_time.arr, resp->nonce);
    gen_nonce_hash(hash, resp->nonce, resp->opaque, r->server, conf);
    resp->nonce[NONCE_TIME_LEN] = tmp;
    resp->nonce_time = nonce_time.time;
+1 −2
Original line number Diff line number Diff line
@@ -485,7 +485,6 @@ static void dav_propdb_close(dav_db *db)
        dav_propdb_metadata m;
        apr_datum_t key;
        apr_datum_t value;
        dav_error *err;

        key.dptr = DAV_GDBM_NS_KEY;
        key.dsize = DAV_GDBM_NS_KEY_LEN;
@@ -500,8 +499,8 @@ static void dav_propdb_close(dav_db *db)

        memcpy(db->ns_table.buf, &m, sizeof(m));

        err = dav_dbm_store(db, key, value);
        /* ### what to do with the error? */
        dav_dbm_store(db, key, value);
    }

    dav_dbm_close(db);
+11 −8
Original line number Diff line number Diff line
@@ -1127,7 +1127,6 @@ static int parse_expr(include_ctx_t *ctx, const char *expr, int *was_error)
    request_rec *rr = NULL;
    const char *error = "Invalid expression \"%s\" in file %s";
    const char *parse = expr;
    int was_unmatched = 0;
    unsigned regex = 0;

    *was_error = 0;
@@ -1144,14 +1143,18 @@ static int parse_expr(include_ctx_t *ctx, const char *expr, int *was_error)
         */
        CREATE_NODE(ctx, new);

        was_unmatched = get_ptoken(ctx, &parse, &new->token,
        {
#ifdef DEBUG_INCLUDE
            int was_unmatched =
#endif
            get_ptoken(ctx, &parse, &new->token,
                       (current != NULL ? &current->token : NULL));
        if (!parse) {
            if (!parse)
                break;
        }

            DEBUG_DUMP_UNMATCHED(ctx, was_unmatched);
            DEBUG_DUMP_TOKEN(ctx, &new->token);
        }

        if (!current) {
            switch (new->token.type) {
+4 −2
Original line number Diff line number Diff line
@@ -1150,12 +1150,14 @@ static int config_log_transaction(request_rec *r, config_log_state *cls,
        len += strl[i] = strlen(strs[i]);
    }
    if (!log_writer) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                "log writer isn't correctly setup");
         return HTTP_INTERNAL_SERVER_ERROR;
    }
    rv = log_writer(r, cls->log_writer, strs, strl, format->nelts, len);
    /* xxx: do we return an error on log_writer? */
    if (rv != APR_SUCCESS)
        ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, "Error writing to %s",
                      cls->fname);
    return OK;
}