summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvestre Ledru <sledru@mozilla.com>2019-10-27 16:40:02 +0100
committerSylvestre Ledru <sledru@mozilla.com>2019-10-27 16:40:02 +0100
commit953800b153124ab1bbdd07a7cd7b6d6dab1677c5 (patch)
tree32b42c2cec9863a7568b8cb67954c952d38d713d
parent8902972213c05e64c94921f2c8d4728035690de4 (diff)
downloadnspr-hg-953800b153124ab1bbdd07a7cd7b6d6dab1677c5.tar.gz
Bug 1588712 - Remove some useless declarations. r=kaie
-rw-r--r--pr/tests/forktest.c3
-rw-r--r--pr/tests/multiwait.c3
-rw-r--r--pr/tests/sel_spd.c30
-rw-r--r--pr/tests/zerolen.c8
4 files changed, 20 insertions, 24 deletions
diff --git a/pr/tests/forktest.c b/pr/tests/forktest.c
index 7de18524..a6d4bc4b 100644
--- a/pr/tests/forktest.c
+++ b/pr/tests/forktest.c
@@ -199,7 +199,6 @@ finish:
int main(int argc, char **argv)
{
pid_t pid;
- int rv;
/* main test program */
@@ -216,7 +215,7 @@ int main(int argc, char **argv)
printf("Fork succeeded. Parent process continues.\n");
DoIO();
- if ((rv = waitpid(pid, &childStatus, 0)) != pid) {
+ if (waitpid(pid, &childStatus, 0) != pid) {
{
fprintf(stderr, "waitpid failed: %d\n", errno);
failed_already = 1;
diff --git a/pr/tests/multiwait.c b/pr/tests/multiwait.c
index 71e5ebdd..68e80bf2 100644
--- a/pr/tests/multiwait.c
+++ b/pr/tests/multiwait.c
@@ -706,8 +706,7 @@ static void RunThisOne(
static Verbosity ChangeVerbosity(Verbosity verbosity, PRIntn delta)
{
- PRIntn verbage = (PRIntn)verbosity;
- return (Verbosity)(verbage += delta);
+ return (Verbosity)(((PRIntn)verbosity) + delta)
} /* ChangeVerbosity */
int main(int argc, char **argv)
diff --git a/pr/tests/sel_spd.c b/pr/tests/sel_spd.c
index 9eb440b3..6c170423 100644
--- a/pr/tests/sel_spd.c
+++ b/pr/tests/sel_spd.c
@@ -86,7 +86,6 @@ void
_server_thread(void *arg_id)
{
void _client_thread(void *);
- PRThread *thread;
int *id = (int *)arg_id;
PRFileDesc *sock;
PRSocketOptionData sockopt;
@@ -142,13 +141,13 @@ _server_thread(void *arg_id)
}
/* Tell the client to start */
- if ( (thread = PR_CreateThread(PR_USER_THREAD,
- _client_thread,
- id,
- PR_PRIORITY_NORMAL,
- scope2,
- PR_UNJOINABLE_THREAD,
- 0)) == NULL) {
+ if ( PR_CreateThread(PR_USER_THREAD,
+ _client_thread,
+ id,
+ PR_PRIORITY_NORMAL,
+ scope2,
+ PR_UNJOINABLE_THREAD,
+ 0) == NULL) {
fprintf(stderr, "Error creating client thread %d\n", *id);
}
@@ -334,18 +333,17 @@ void do_work(void)
_thread_exit_count = _threads * 2;
for (index=0; index<_threads; index++) {
- PRThread *thread;
int *id = (int *)PR_Malloc(sizeof(int));
*id = index;
- if ( (thread = PR_CreateThread(PR_USER_THREAD,
- _server_thread,
- id,
- PR_PRIORITY_NORMAL,
- scope1,
- PR_UNJOINABLE_THREAD,
- 0)) == NULL) {
+ if ( PR_CreateThread(PR_USER_THREAD,
+ _server_thread,
+ id,
+ PR_PRIORITY_NORMAL,
+ scope1,
+ PR_UNJOINABLE_THREAD,
+ 0) == NULL) {
fprintf(stderr, "Error creating server thread %d\n", index);
}
}
diff --git a/pr/tests/zerolen.c b/pr/tests/zerolen.c
index 15fb6ccb..a84bd432 100644
--- a/pr/tests/zerolen.c
+++ b/pr/tests/zerolen.c
@@ -72,7 +72,7 @@ static void ClientThread(void *arg)
/*
* Then start reading.
*/
- while ((nbytes = PR_Read(sock, buf, sizeof(buf))) > 0) {
+ while (nbytes = PR_Read(sock, buf, sizeof(buf)) > 0) {
/* empty loop body */
}
if (-1 == nbytes) {
@@ -136,7 +136,7 @@ int main()
exit(1);
}
osfd = PR_FileDesc2NativeHandle(acceptSock);
- while ((nbytes = write(osfd, buf, sizeof(buf))) != -1) {
+ while (write(osfd, buf, sizeof(buf)) != -1) {
/* empty loop body */
}
if ((errno != EAGAIN) && (errno != EWOULDBLOCK)) {
@@ -177,7 +177,7 @@ int main()
exit(1);
}
osfd = PR_FileDesc2NativeHandle(acceptSock);
- while ((nbytes = write(osfd, buf, sizeof(buf))) != -1) {
+ while (write(osfd, buf, sizeof(buf)) != -1) {
/* empty loop body */
}
if ((errno != EAGAIN) && (errno != EWOULDBLOCK)) {
@@ -216,7 +216,7 @@ int main()
exit(1);
}
osfd = PR_FileDesc2NativeHandle(acceptSock);
- while ((nbytes = write(osfd, buf, sizeof(buf))) != -1) {
+ while (write(osfd, buf, sizeof(buf)) != -1) {
/* empty loop body */
}
if ((errno != EAGAIN) && (errno != EWOULDBLOCK)) {