Skip to content

Commit

Permalink
Fix some compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Oct 7, 2014
1 parent d9f75b9 commit cca28c9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
14 changes: 7 additions & 7 deletions src/dird/dird_conf.c
Expand Up @@ -931,7 +931,7 @@ static inline void print_config_run(RES_ITEM *item, POOL_MEM &cfg_str)

POOL_MEM t; /* is one entry of day/month/week etc. */

pm_strcpy(temp, '\0');
pm_strcpy(temp, "");
for (int i = 0; i < 32; i++) { /* search for one more than needed to detect also intervals that stop on last value */
if (bit_is_set(i, run->mday)) {
if (interval_start == -1) { // bit is set and we are not in an interval
Expand Down Expand Up @@ -973,7 +973,7 @@ static inline void print_config_run(RES_ITEM *item, POOL_MEM &cfg_str)
interval_start = -1;

all_set = true;
pm_strcpy(temp, '\0');
pm_strcpy(temp, "");
for (int i = 0; i < 5; i++) {
if (bit_is_set(i, run->wom)) {
if (interval_start == -1) { // bit is set and we are not in an interval
Expand Down Expand Up @@ -1013,7 +1013,7 @@ static inline void print_config_run(RES_ITEM *item, POOL_MEM &cfg_str)
* run->wday output is Sun, Mon, ..., Sat comma separated
*/
all_set = true;
pm_strcpy(temp, '\0');
pm_strcpy(temp, "");
for (int i = 0; i < 7; i++) {
if (bit_is_set(i, run->wday)) {
if (interval_start == -1) { // bit is set and we are not in an interval
Expand Down Expand Up @@ -1051,7 +1051,7 @@ static inline void print_config_run(RES_ITEM *item, POOL_MEM &cfg_str)
* run->woy output is w00 - w53, comma separated
*/
all_set = true;
pm_strcpy(temp, '\0');
pm_strcpy(temp, "");
for (int i = 0; i < 55; i++) {
if (bit_is_set(i, run->woy)) {
if (interval_start == -1) { // bit is set and we are not in an interval
Expand Down Expand Up @@ -1089,7 +1089,7 @@ static inline void print_config_run(RES_ITEM *item, POOL_MEM &cfg_str)
* only "hourly" sets all bits.
*/
all_set = true;
pm_strcpy(temp, '\0');
pm_strcpy(temp, "");
for (int i = 0; i < 24; i++) {
if bit_is_set(i, run->hour) {
Mmsg(temp, "at %02d:%02d\n", i, run->minute);
Expand Down Expand Up @@ -3151,10 +3151,10 @@ extern "C" char *job_code_callback_director(JCR *jcr, const char *param)
if (jcr->VolumeName) {
return jcr->VolumeName;
} else {
return _("*none*");
return (char *)_("*none*");
}
} else {
return _("*none*");
return (char *)_("*none*");
}
break;
}
Expand Down
4 changes: 1 addition & 3 deletions src/dird/ndmp_dma.c
Expand Up @@ -1807,9 +1807,7 @@ static inline int native_to_ndmp_loglevel(CLIENTRES *client, int debuglevel, NIS
/*
* Make sure the level is in the wanted range.
*/
if (level < 0) {
level = 0;
} else if (level > 9) {
if (level > 9) {
level = 9;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ndmp/Makefile.in
Expand Up @@ -169,7 +169,7 @@ ndmp9.h ndmp9_xdr.c: ndmp9.x

ndmos.lo: ndmos.c
@echo "Compiling $<"
$(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) \
$(NO_ECHO)$(LIBTOOL_COMPILE) $(CC) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) \
-DNDMOS_CONST_PRODUCT_NAME='"BAREOS NDMP"' \
-DNDMOS_CONST_VENDOR_NAME='"Bareos GmbH & Co. KG"' \
-DNDMOS_CONST_NDMJOBLIB_REVISION='"bareos-$(LIBBAREOSNDMP_LT_RELEASE)"' \
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/filed/python-fd.c
Expand Up @@ -2722,7 +2722,7 @@ static int PyIoPacket_init(PyIoPacket *self, PyObject *args, PyObject *kwds)
self->status = 0;
self->io_errno = 0;
self->lerror = 0;
self->whence - 0;
self->whence = 0;
self->offset = 0;
self->win32 = false;

Expand Down
8 changes: 3 additions & 5 deletions src/stored/ndmp_tape.c
Expand Up @@ -161,9 +161,7 @@ static inline int native_to_ndmp_loglevel(int debuglevel, NIS *nis)
/*
* Make sure the level is in the wanted range.
*/
if (level < 0) {
level = 0;
} else if (level > 9) {
if (level > 9) {
level = 9;
}

Expand Down Expand Up @@ -273,7 +271,7 @@ extern "C" int bndmp_auth_clear(struct ndm_session *sess, char *name, char *pass

nis = (NIS *)sess->param->log.ctx;
if (nis->LogLevel != auth_config->LogLevel) {
if (auth_config->LogLevel >= 0 && auth_config->LogLevel <= 9) {
if (auth_config->LogLevel <= 9) {
nis->LogLevel = auth_config->LogLevel;
}
}
Expand Down Expand Up @@ -318,7 +316,7 @@ extern "C" int bndmp_auth_md5(struct ndm_session *sess, char *name, char digest[

nis = (NIS *)sess->param->log.ctx;
if (nis->LogLevel != auth_config->LogLevel) {
if (auth_config->LogLevel >= 0 && auth_config->LogLevel <= 9) {
if (auth_config->LogLevel <= 9) {
nis->LogLevel = auth_config->LogLevel;
}
}
Expand Down

0 comments on commit cca28c9

Please sign in to comment.