Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverity fix #1478

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions cmake/Modules/CUnit/src/main.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,28 @@ static int patmatch(const char *pat, const char *str)

static void usage(const char *name)
{
fprintf(stderr, "Usage: %s OPTIONS\n", name);
fprintf(stderr, "Try '%s -h' for more information\n", name);
(void) fprintf(stderr, "Usage: %s OPTIONS\n", name);
(void) fprintf(stderr, "Try '%s -h' for more information\n", name);
}

static void help(const char *name)
{
printf("Usage: %s [OPTIONS]\n", name);
printf("\n");
printf("Possible options:\n");
printf(" -a run in automated mode\n");
printf(" -f fail fast\n");
printf(" -h display this help and exit\n");
printf(" -j junit format results \n");
printf(" -r FILENAME results file for automated run\n");
printf(" -s PATTERN run only tests in suites matching pattern\n");
printf(" -t PATTERN run only test matching pattern\n");
printf("\n");
printf("Exit codes:\n");
printf(" %-2d Successful termination\n", EXIT_SUCCESS);
printf(" %-2d One or more failing test cases\n", EXIT_FAILURE);
printf(" %-2d Command line usage error\n", EX_USAGE);
printf(" %-2d Internal software error\n", EX_SOFTWARE);
(void) printf("Usage: %s [OPTIONS]\n", name);
(void) printf("\n");
(void) printf("Possible options:\n");
(void) printf(" -a run in automated mode\n");
(void) printf(" -f fail fast\n");
(void) printf(" -h display this help and exit\n");
(void) printf(" -j junit format results \n");
(void) printf(" -r FILENAME results file for automated run\n");
(void) printf(" -s PATTERN run only tests in suites matching pattern\n");
(void) printf(" -t PATTERN run only test matching pattern\n");
(void) printf("\n");
(void) printf("Exit codes:\n");
(void) printf(" %-2d Successful termination\n", EXIT_SUCCESS);
(void) printf(" %-2d One or more failing test cases\n", EXIT_FAILURE);
(void) printf(" %-2d Command line usage error\n", EX_USAGE);
(void) printf(" %-2d Internal software error\n", EX_SOFTWARE);
}

static int parse_options(int argc, char *argv[])
Expand Down Expand Up @@ -198,7 +198,7 @@ int main(int argc, char *argv[])
help(argv[0]);
return ret;
} else if (CU_initialize_registry() != CUE_SUCCESS) {
fprintf(stderr, "CU_initialize_registry: %s\n", CU_get_error_msg());
(void) fprintf(stderr, "CU_initialize_registry: %s\n", CU_get_error_msg());
return EX_SOFTWARE;
}

Expand Down
2 changes: 1 addition & 1 deletion compat/getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const char Id[] = "$Id: os_stdlib_getopt.c,v 1.2 2008-11-17 09:53:45 hans
* However, I am not about to post a copy of anything licensed by AT&T.
*/

#define ERR(szz,czz) if(opterr){fprintf(stderr,"%s%s%c\n",argv[0],szz,czz);}
#define ERR(szz,czz) if(opterr){(void) fprintf(stderr,"%s%s%c\n",argv[0],szz,czz);}

int opterr = 1;
int optind = 1;
Expand Down
12 changes: 6 additions & 6 deletions docs/manual/config/config_file_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2677,9 +2677,9 @@ The default value is: "none".
generated from ddsi_cfgelems.h[11913cd398f1cd1b52e06d924718df62a5981beb]
generated from ddsi_config.c[ed9898f72f9dbcfa20ce7706835da091efcea0ca]
generated from _confgen.h[f2d235d5551cbf920a8a2962831dddeabd2856ac]
generated from _confgen.c[1193219ddb4769b90566cf197e73d22fb6f75835]
generated from generate_rnc.c[a2ec6e48d33ac14a320c8ec3f320028a737920e0]
generated from generate_md.c[a61b6a9649d18afeca4c73b5784f36989d7994e0]
generated from generate_rst.c[34dcb6b5e2ac2cd15e78497107ce0b6eed6e6e94]
generated from generate_xsd.c[45064e8869b3c00573057d7c8f02d20f04b40e16]
generated from generate_defconfig.c[eec9ab7b2d053e68500799b693d089e84153a37b]
generated from _confgen.c[c23ec2e896226a424a21f1a4b343cb780056f52e]
generated from generate_rnc.c[79379fcd8615d777c20c0c0324547bfdcc180c60]
generated from generate_md.c[f3669b494645cfff74758b587b4a552910901378]
generated from generate_rst.c[1e95348d13f06a441bc0cef8731e4ffeb99cad1a]
generated from generate_xsd.c[22ae895de728df202f681642178300f14102af65]
generated from generate_defconfig.c[e2f6526ef516323caa0b0f497c493f69d02a40ff]
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ The subscriber application implements the steps defined in :ref:`the Key Steps <
DDS_ERR_CHECK (reader, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
dds_delete_qos(qos);

printf ("\n=== [Subscriber] Waiting for a sample ...\n");
(void) printf ("\n=== [Subscriber] Waiting for a sample ...\n");

/* Initialize the sample buffer, by pointing the void pointer within
* the buffer array to a valid sample memory location. */
Expand All @@ -281,8 +281,8 @@ The subscriber application implements the steps defined in :ref:`the Key Steps <
{
/* Print Message. */
msg = (HelloWorldData_Msg*) samples[0];
printf ("=== [Subscriber] Received : ");
printf ("Message (%d, %s)\n", msg->userID, msg->message);
(void) printf ("=== [Subscriber] Received : ");
(void) printf ("Message (%d, %s)\n", msg->userID, msg->message);
break;
}
else
Expand Down Expand Up @@ -412,8 +412,8 @@ data type and display the contents.
.. code-block:: C

msg = (HelloWorldData_Msg*) samples[0];
printf ("=== [Subscriber] Received : ");
printf ("Message (%d, %s)\n", msg->userID, msg->message);
(void) printf ("=== [Subscriber] Received : ");
(void) printf ("Message (%d, %s)\n", msg->userID, msg->message);
break;

When data is received and the polling loop is stopped, we release the
Expand All @@ -422,7 +422,7 @@ allocated memory and delete the domain participant.
.. code-block:: C

HelloWorldData_Msg_free (samples[0], DDS_FREE_ALL);
dds_delete (participant);
(void) dds_delete (participant);

All the entities that are created under the participant, such as the
data reader and topic, are recursively deleted.
Expand Down Expand Up @@ -471,7 +471,7 @@ subscriber program in any order.
/* Create a Writer. */
writer = dds_create_writer (participant, topic, NULL, NULL);

printf("=== [Publisher] Waiting for a reader to be discovered ...\n");
(void) printf("=== [Publisher] Waiting for a reader to be discovered ...\n");

ret = dds_set_status_mask(writer, DDS_PUBLICATION_MATCHED_STATUS);
DDS_ERR_CHECK (ret, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
Expand All @@ -493,8 +493,8 @@ subscriber program in any order.
msg.userID = 1;
msg.message = "Hello World";

printf ("=== [Publisher] Writing : ");
printf ("Message (%d, %s)\n", msg.userID, msg.message);
(void) printf ("=== [Publisher] Writing : ");
(void) printf ("Message (%d, %s)\n", msg.userID, msg.message);

ret = dds_write (writer, &msg);
DDS_ERR_CHECK (ret, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
Expand Down
12 changes: 6 additions & 6 deletions docs/manual/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -1877,9 +1877,9 @@ The default value is: "none".
<!--- generated from ddsi_cfgelems.h[11913cd398f1cd1b52e06d924718df62a5981beb] -->
<!--- generated from ddsi_config.c[ed9898f72f9dbcfa20ce7706835da091efcea0ca] -->
<!--- generated from _confgen.h[f2d235d5551cbf920a8a2962831dddeabd2856ac] -->
<!--- generated from _confgen.c[1193219ddb4769b90566cf197e73d22fb6f75835] -->
<!--- generated from generate_rnc.c[a2ec6e48d33ac14a320c8ec3f320028a737920e0] -->
<!--- generated from generate_md.c[a61b6a9649d18afeca4c73b5784f36989d7994e0] -->
<!--- generated from generate_rst.c[34dcb6b5e2ac2cd15e78497107ce0b6eed6e6e94] -->
<!--- generated from generate_xsd.c[45064e8869b3c00573057d7c8f02d20f04b40e16] -->
<!--- generated from generate_defconfig.c[eec9ab7b2d053e68500799b693d089e84153a37b] -->
<!--- generated from _confgen.c[c23ec2e896226a424a21f1a4b343cb780056f52e] -->
<!--- generated from generate_rnc.c[79379fcd8615d777c20c0c0324547bfdcc180c60] -->
<!--- generated from generate_md.c[f3669b494645cfff74758b587b4a552910901378] -->
<!--- generated from generate_rst.c[1e95348d13f06a441bc0cef8731e4ffeb99cad1a] -->
<!--- generated from generate_xsd.c[22ae895de728df202f681642178300f14102af65] -->
<!--- generated from generate_defconfig.c[e2f6526ef516323caa0b0f497c493f69d02a40ff] -->
12 changes: 6 additions & 6 deletions etc/cyclonedds.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -1304,9 +1304,9 @@ MIIEpAIBAAKCAQEA3HIh...AOBaaqSV37XBUJg==<br>
# generated from ddsi_cfgelems.h[11913cd398f1cd1b52e06d924718df62a5981beb]
# generated from ddsi_config.c[ed9898f72f9dbcfa20ce7706835da091efcea0ca]
# generated from _confgen.h[f2d235d5551cbf920a8a2962831dddeabd2856ac]
# generated from _confgen.c[1193219ddb4769b90566cf197e73d22fb6f75835]
# generated from generate_rnc.c[a2ec6e48d33ac14a320c8ec3f320028a737920e0]
# generated from generate_md.c[a61b6a9649d18afeca4c73b5784f36989d7994e0]
# generated from generate_rst.c[34dcb6b5e2ac2cd15e78497107ce0b6eed6e6e94]
# generated from generate_xsd.c[45064e8869b3c00573057d7c8f02d20f04b40e16]
# generated from generate_defconfig.c[eec9ab7b2d053e68500799b693d089e84153a37b]
# generated from _confgen.c[c23ec2e896226a424a21f1a4b343cb780056f52e]
# generated from generate_rnc.c[79379fcd8615d777c20c0c0324547bfdcc180c60]
# generated from generate_md.c[f3669b494645cfff74758b587b4a552910901378]
# generated from generate_rst.c[1e95348d13f06a441bc0cef8731e4ffeb99cad1a]
# generated from generate_xsd.c[22ae895de728df202f681642178300f14102af65]
# generated from generate_defconfig.c[e2f6526ef516323caa0b0f497c493f69d02a40ff]
12 changes: 6 additions & 6 deletions etc/cyclonedds.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1977,9 +1977,9 @@ MIIEpAIBAAKCAQEA3HIh...AOBaaqSV37XBUJg==&lt;br&gt;
<!--- generated from ddsi_cfgelems.h[11913cd398f1cd1b52e06d924718df62a5981beb] -->
<!--- generated from ddsi_config.c[ed9898f72f9dbcfa20ce7706835da091efcea0ca] -->
<!--- generated from _confgen.h[f2d235d5551cbf920a8a2962831dddeabd2856ac] -->
<!--- generated from _confgen.c[1193219ddb4769b90566cf197e73d22fb6f75835] -->
<!--- generated from generate_rnc.c[a2ec6e48d33ac14a320c8ec3f320028a737920e0] -->
<!--- generated from generate_md.c[a61b6a9649d18afeca4c73b5784f36989d7994e0] -->
<!--- generated from generate_rst.c[34dcb6b5e2ac2cd15e78497107ce0b6eed6e6e94] -->
<!--- generated from generate_xsd.c[45064e8869b3c00573057d7c8f02d20f04b40e16] -->
<!--- generated from generate_defconfig.c[eec9ab7b2d053e68500799b693d089e84153a37b] -->
<!--- generated from _confgen.c[c23ec2e896226a424a21f1a4b343cb780056f52e] -->
<!--- generated from generate_rnc.c[79379fcd8615d777c20c0c0324547bfdcc180c60] -->
<!--- generated from generate_md.c[f3669b494645cfff74758b587b4a552910901378] -->
<!--- generated from generate_rst.c[1e95348d13f06a441bc0cef8731e4ffeb99cad1a] -->
<!--- generated from generate_xsd.c[22ae895de728df202f681642178300f14102af65] -->
<!--- generated from generate_defconfig.c[e2f6526ef516323caa0b0f497c493f69d02a40ff] -->
Loading