From: Eric Bollengier Date: Tue, 19 Apr 2011 14:22:42 +0000 (+0200) Subject: Fix couple of g++ warnings X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2c4046f0086213a88fd788a3e4a94266b3b86239;p=bacula%2Fbacula Fix couple of g++ warnings --- diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 8d37e7b68c..d3e49511e2 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -1864,7 +1864,7 @@ static void store_runscript_cmd(LEX *lc, RES_ITEM *item, int index, int pass) /* Each runscript command takes 2 entries in commands list */ pm_strcpy(c, lc->str); ((RUNSCRIPT*) item->value)->commands->prepend(c); /* command line */ - ((RUNSCRIPT*) item->value)->commands->prepend((void *)item->code); /* command type */ + ((RUNSCRIPT*) item->value)->commands->prepend((void *)(intptr_t)item->code); /* command type */ } scan_to_eol(lc); } diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index 8fb18fcadf..a2f9c288b6 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -345,8 +345,8 @@ static bool dot_bvfs_restore(UAContext *ua, const char *cmd) int limit=2000, offset=0, i; char *path=NULL, *jobid=NULL, *username=NULL; char *empty = (char *)""; - char *fileid, *dirid, *hardlink, *id; - id = fileid = dirid = hardlink = empty; + char *fileid, *dirid, *hardlink; + fileid = dirid = hardlink = empty; if (!bvfs_parse_arg(ua, &pathid, &path, &jobid, &username, &limit, &offset)) diff --git a/bacula/src/dird/ua_label.c b/bacula/src/dird/ua_label.c index 319a8e7a95..df9578fd55 100644 --- a/bacula/src/dird/ua_label.c +++ b/bacula/src/dird/ua_label.c @@ -157,6 +157,7 @@ static bool get_user_slot_list(UAContext *ua, char *slot_list, int num_slots) return true; bail_out: + Dmsg1(100, "Problem with user selection ERR=%s\n", msg); return false; } diff --git a/bacula/src/filed/accurate.c b/bacula/src/filed/accurate.c index 70ab5bbd33..77866a82d3 100644 --- a/bacula/src/filed/accurate.c +++ b/bacula/src/filed/accurate.c @@ -445,8 +445,9 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt) bin_to_base64(digest_buf, BASE64_SIZE(size), md, size, true); if (strcmp(digest_buf, elt.chksum)) { - Dmsg3(dbglvl-1, "%s chksum diff. Cat: %s File: %s\n", + Dmsg4(dbglvl,"%s %s chksum diff. Cat: %s File: %s\n", fname, + digest_name, elt.chksum, digest_buf); stat = true; diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 69eb367279..fdc767b479 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -1612,7 +1612,7 @@ static int level_cmd(JCR *jcr) if (buf) { free_memory(buf); } - generate_plugin_event(jcr, bEventLevel, (void *)jcr->getJobLevel()); + generate_plugin_event(jcr, bEventLevel, (void*)(intptr_t)jcr->getJobLevel()); return dir->fsend(OKlevel); bail_out: @@ -1977,7 +1977,7 @@ static int verify_cmd(JCR *jcr) dir->fsend(OKverify); generate_daemon_event(jcr, "JobStart"); - generate_plugin_event(jcr, bEventLevel, (void *)jcr->getJobLevel()); + generate_plugin_event(jcr, bEventLevel,(void *)(intptr_t)jcr->getJobLevel()); generate_plugin_event(jcr, bEventStartVerifyJob); Dmsg1(110, "filed>dird: %s", dir->msg); diff --git a/bacula/src/filed/status.c b/bacula/src/filed/status.c index e29dd5d5e4..f8cf3fe009 100644 --- a/bacula/src/filed/status.c +++ b/bacula/src/filed/status.c @@ -249,7 +249,6 @@ static void list_running_jobs_api(STATUS_PKT *sp) POOL_MEM msg(PM_MESSAGE); char b1[32], b2[32], b3[32]; int len; - bool found = false; JCR *njcr; char dt[MAX_TIME_LENGTH]; /* @@ -299,7 +298,6 @@ static void list_running_jobs_api(STATUS_PKT *sp) sendit(msg.c_str(), len, sp); } - found = true; if (njcr->store_bsock) { len = Mmsg(msg, " SDReadSeqNo=%" lld "\n fd=%d\n", njcr->store_bsock->read_seqno, njcr->store_bsock->m_fd); diff --git a/bacula/src/stored/autochanger.c b/bacula/src/stored/autochanger.c index b32656e8e7..b63a585b18 100644 --- a/bacula/src/stored/autochanger.c +++ b/bacula/src/stored/autochanger.c @@ -556,7 +556,6 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd) POOLMEM *changer; BPIPE *bpipe; int len = sizeof_pool_memory(dir->msg) - 1; - bool ok = false; int stat; if (!dev->is_autochanger() || !dcr->device->changer_name || @@ -589,7 +588,7 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd) bpipe = open_bpipe(changer, timeout, "r"); if (!bpipe) { dir->fsend(_("3996 Open bpipe failed.\n")); - goto bail_out; + goto bail_out; /* TODO: check if we need to return false */ } if (bstrcmp(cmd, "list") || bstrcmp(cmd, "listall")) { /* Get output from changer */ @@ -618,7 +617,6 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd) dir->fsend(_("Autochanger error: ERR=%s\n"), be.bstrerror()); } bnet_sig(dir, BNET_EOD); - ok = true; bail_out: unlock_changer(dcr);