mu, tests: fix gcc-8.2.0 warnings

Without this commit gcc-8.2.0 whines

|   CC       mu-msg-json.lo
| mu-msg-json.c: In function ‘get_temp_file_maybe’:
| mu-msg-json.c:254:14: warning: unused variable ‘tmpfile’ [-Wunused-variable]
|   char *tmp, *tmpfile;
|               ^~~~~~~
| mu-msg-json.c:254:8: warning: unused variable ‘tmp’ [-Wunused-variable]
|   char *tmp, *tmpfile;
|         ^~~
| mu-msg-json.c: In function ‘add_part_crypto’:
| mu-msg-json.c:276:21: warning: unused variable ‘s’ [-Wunused-variable]
|   char    *signers, *s;
|                      ^
| mu-msg-json.c:276:11: warning: unused variable ‘signers’ [-Wunused-variable]
|   char    *signers, *s;
|            ^~~~~~~
| mu-msg-json.c: In function ‘each_part’:
| mu-msg-json.c:332:14: warning: variable ‘cid’ set but not used [-Wunused-but-set-variable]
|   const char *cid;
|               ^~~

and

|   CC       test-mu-str.o
| test-mu-str.c: In function ‘test_mu_str_subject_normalize’:
| test-mu-str.c:282:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "test123", "test123" },
|      ^~~~~~~~~
| test-mu-str.c:282:16: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "test123", "test123" },
|                 ^~~~~~~~~
| test-mu-str.c:283:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re:test123", "test123" },
|      ^~~~~~~~~~~~
| test-mu-str.c:283:19: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re:test123", "test123" },
|                    ^~~~~~~~~
| test-mu-str.c:284:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re: Fwd: test123", "test123" },
|      ^~~~~~~~~~~~~~~~~~
| test-mu-str.c:284:25: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re: Fwd: test123", "test123" },
|                          ^~~~~~~~~
| test-mu-str.c:285:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re[3]: Fwd: test123", "test123" },
|      ^~~~~~~~~~~~~~~~~~~~~
| test-mu-str.c:285:28: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re[3]: Fwd: test123", "test123" },
|                             ^~~~~~~~~
| test-mu-str.c:286:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "operation: mindcrime", "operation: mindcrime" }, /*...*/
|      ^~~~~~~~~~~~~~~~~~~~~~
| test-mu-str.c:286:29: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "operation: mindcrime", "operation: mindcrime" }, /*...*/
|                              ^~~~~~~~~~~~~~~~~~~~~~
| test-mu-str.c:287:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "", "" }
|      ^~
| test-mu-str.c:287:9: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "", "" }
|          ^~
This commit is contained in:
Ulrich Ölmann 2019-01-11 06:19:46 +01:00
parent 57150a47f3
commit 493a9efa7a
2 changed files with 1 additions and 6 deletions

View File

@ -251,8 +251,6 @@ errexit:
static gchar*
get_temp_file_maybe (MuMsg *msg, MuMsgPart *part, MuMsgOptions opts)
{
char *tmp, *tmpfile;
opts |= MU_MSG_OPTION_USE_EXISTING;
if (!(opts & MU_MSG_OPTION_EXTRACT_IMAGES) ||
@ -273,7 +271,6 @@ typedef struct _PartInfo PartInfo;
static void
add_part_crypto (JsonBuilder *bob, MuMsgPart *mpart, PartInfo *pinfo)
{
char *signers, *s;
const char *verdict;
MuMsgPartSigStatusReport *report;
@ -329,13 +326,11 @@ static void
each_part (MuMsg *msg, MuMsgPart *part, PartInfo *pinfo)
{
char *name, *tmpfile;
const char *cid;
pinfo->bob = json_builder_begin_object(pinfo->bob);
name = mu_msg_part_get_filename (part, TRUE);
tmpfile = get_temp_file_maybe (msg, part, pinfo->opts);
cid = mu_msg_part_get_content_id(part);
add_int_member (pinfo->bob, "index", part->index);
add_string_member (pinfo->bob, "name", name);

View File

@ -277,7 +277,7 @@ test_mu_str_subject_normalize (void)
int i;
struct {
char *src, *exp;
const char *src, *exp;
} tests[] = {
{ "test123", "test123" },
{ "Re:test123", "test123" },