From 78b5d3b4a55c288c0e3c13e89e297c310e9b3ec9 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 24 Oct 2017 09:46:44 -0700 Subject: [PATCH] db_purge: fix compile warnings. No functional change --- sched/db_purge.cpp | 52 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/sched/db_purge.cpp b/sched/db_purge.cpp index 2e79a3e77b..c5a86ca202 100644 --- a/sched/db_purge.cpp +++ b/sched/db_purge.cpp @@ -479,21 +479,31 @@ int archive_result_gz (DB_RESULT& result) { xml_escape(result.stderr_out, stderr_out_escaped, sizeof(stderr_out_escaped)); n = snprintf(buf, sizeof(buf), RESULT_ARCHIVE_DATA); - if ((n <= 0) || n > sizeof(buf)) fail("ERROR: printing result archive failed\n"); + if ((n <= 0) || n > (int)sizeof(buf)) { + fail("ERROR: printing result archive failed\n"); + } n = gzwrite((gzFile)re_stream, buf, (unsigned int)n); - if (n <= 0) fail("ERROR: writing result archive failed\n"); + if (n <= 0) { + fail("ERROR: writing result archive failed\n"); + } n = gzflush((gzFile)re_stream, Z_FULL_FLUSH); - if (n != Z_OK) fail("ERROR: writing result archive failed (flush)\n"); + if (n != Z_OK) { + fail("ERROR: writing result archive failed (flush)\n"); + } n = gzprintf((gzFile)re_index_stream, - "%lu %d %s\n", - result.id, time_int, result.name - ); - if (n <= 0) fail("ERROR: writing result index failed\n"); + "%lu %d %s\n", + result.id, time_int, result.name + ); + if (n <= 0) { + fail("ERROR: writing result index failed\n"); + } n = gzflush((gzFile)re_index_stream, Z_SYNC_FLUSH); - if (n != Z_OK) fail("ERROR: writing result index failed (flush)\n"); + if (n != Z_OK) { + fail("ERROR: writing result index failed (flush)\n"); + } return 0; } @@ -503,21 +513,31 @@ int archive_wu_gz (DB_WORKUNIT& wu) { char buf[BLOB_SIZE*2]; n = snprintf(buf, sizeof(buf), WU_ARCHIVE_DATA); - if ((n <= 0) || n > sizeof(buf)) fail("ERROR: printing workunit archive failed\n"); + if ((n <= 0) || n > (int)sizeof(buf)) { + fail("ERROR: printing workunit archive failed\n"); + } n = gzwrite((gzFile)wu_stream, buf, (unsigned int)n); - if (n <= 0) fail("ERROR: writing workunit archive failed\n"); + if (n <= 0) { + fail("ERROR: writing workunit archive failed\n"); + } n = gzflush((gzFile)re_stream,Z_FULL_FLUSH); - if (n != Z_OK) fail("ERROR: writing workunit archive failed (flush)\n"); + if (n != Z_OK) { + fail("ERROR: writing workunit archive failed (flush)\n"); + } n = gzprintf((gzFile)wu_index_stream, - "%lu %d %s\n", - wu.id, time_int, wu.name - ); - if (n <= 0) fail("ERROR: writing workunit index failed\n"); + "%lu %d %s\n", + wu.id, time_int, wu.name + ); + if (n <= 0) { + fail("ERROR: writing workunit index failed\n"); + } n = gzflush((gzFile)re_stream,Z_SYNC_FLUSH); - if (n != Z_OK) fail("ERROR: writing workunit index failed (flush)\n"); + if (n != Z_OK) { + fail("ERROR: writing workunit index failed (flush)\n"); + } return 0; }