未验证 提交 5e701291 编写于 作者: O openharmony_ci 提交者: Gitee

!917 【OpenHarmony开源贡献者计划2022】fix warning: unused variable

Merge pull request !917 from rtos_ming/unused
...@@ -64,12 +64,8 @@ EXIT: ...@@ -64,12 +64,8 @@ EXIT:
static int Testcase(void) static int Testcase(void)
{ {
struct sched_param param = { 0 };
int ret; int ret;
void *res = nullptr; pthread_t newPthread;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
int index = 0; int index = 0;
pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL); pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL);
......
...@@ -65,10 +65,8 @@ static int Testcase(void) ...@@ -65,10 +65,8 @@ static int Testcase(void)
{ {
struct sched_param param = { 0 }; struct sched_param param = { 0 };
int ret; int ret;
void *res = nullptr;
pthread_attr_t a = { 0 }; pthread_attr_t a = { 0 };
pthread_t thread = pthread_self(); pthread_t newPthread;
pthread_t newPthread, newPthread1;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
int index = 0; int index = 0;
int currThreadPri, currThreadPolicy; int currThreadPri, currThreadPolicy;
......
...@@ -74,12 +74,9 @@ static int Testcase(void) ...@@ -74,12 +74,9 @@ static int Testcase(void)
{ {
struct sched_param param = { 0 }; struct sched_param param = { 0 };
int ret; int ret;
void *res = nullptr;
pthread_attr_t a = { 0 }; pthread_attr_t a = { 0 };
pthread_t thread = pthread_self(); pthread_t newPthread;
pthread_t newPthread, newPthread1;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
int count = 0;
int currThreadPri, currThreadPolicy; int currThreadPri, currThreadPolicy;
g_preTaskPri = 0xffffffff; g_preTaskPri = 0xffffffff;
......
...@@ -49,8 +49,6 @@ static void *ThreadFuncTest3(void *a) ...@@ -49,8 +49,6 @@ static void *ThreadFuncTest3(void *a)
int ret; int ret;
int tid = Gettid(); int tid = Gettid();
pthread_t thread = pthread_self(); pthread_t thread = pthread_self();
int currThreadPri, currThreadPolicy;
struct sched_param param = { 0 };
ret = pthread_detach(thread); ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
...@@ -124,14 +122,10 @@ EXIT: ...@@ -124,14 +122,10 @@ EXIT:
static int Testcase(void) static int Testcase(void)
{ {
struct sched_param param = { 0 };
int ret; int ret;
void *res = nullptr; pthread_t newPthread;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
int index = 0;
pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL); pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL);
pthread_mutex_init(&g_muxLock001, &mutex); pthread_mutex_init(&g_muxLock001, &mutex);
pthread_mutex_init(&g_muxLock002, &mutex); pthread_mutex_init(&g_muxLock002, &mutex);
......
...@@ -49,8 +49,6 @@ static void *ThreadFuncTest3(void *a) ...@@ -49,8 +49,6 @@ static void *ThreadFuncTest3(void *a)
int ret; int ret;
int tid; int tid;
pthread_t thread = pthread_self(); pthread_t thread = pthread_self();
int currThreadPri, currThreadPolicy;
struct sched_param param = { 0 };
ret = pthread_detach(thread); ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
...@@ -126,14 +124,10 @@ EXIT: ...@@ -126,14 +124,10 @@ EXIT:
static int Testcase(void) static int Testcase(void)
{ {
struct sched_param param = { 0 };
int ret; int ret;
void *res = nullptr; pthread_t newPthread;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
int index = 0;
pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL); pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL);
pthread_mutex_init(&g_muxLock001, &mutex); pthread_mutex_init(&g_muxLock001, &mutex);
pthread_mutex_init(&g_muxLock002, &mutex); pthread_mutex_init(&g_muxLock002, &mutex);
......
...@@ -48,8 +48,6 @@ static void *ThreadFuncTest3(void *a) ...@@ -48,8 +48,6 @@ static void *ThreadFuncTest3(void *a)
{ {
int ret; int ret;
int tid = Gettid(); int tid = Gettid();
int currThreadPri, currThreadPolicy;
struct sched_param param = { 0 };
pthread_t thread = pthread_self(); pthread_t thread = pthread_self();
ret = pthread_detach(thread); ret = pthread_detach(thread);
...@@ -118,18 +116,14 @@ static void *ThreadFuncTest1(void *a) ...@@ -118,18 +116,14 @@ static void *ThreadFuncTest1(void *a)
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
EXIT: EXIT:
return nullptr; return nullptr;
} }
static int Testcase(void) static int Testcase(void)
{ {
struct sched_param param = { 0 };
int ret; int ret;
void *res = nullptr; pthread_t newPthread;
pthread_attr_t a = { 0 };
pthread_t newPthread, newPthread1;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
int index = 0;
pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL); pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL);
pthread_mutex_init(&g_mutexLock001, &mutex); pthread_mutex_init(&g_mutexLock001, &mutex);
pthread_mutex_init(&g_mutexLock002, &mutex); pthread_mutex_init(&g_mutexLock002, &mutex);
......
...@@ -43,7 +43,6 @@ static void *ThreadFuncTest3(void *a) ...@@ -43,7 +43,6 @@ static void *ThreadFuncTest3(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self(); pthread_t thread = pthread_self();
int currThreadPri, currThreadPolicy;
struct sched_param param = { 0 }; struct sched_param param = { 0 };
struct timespec time; struct timespec time;
struct timeval timeVal = { 0 }; struct timeval timeVal = { 0 };
...@@ -62,7 +61,7 @@ static void *ThreadFuncTest3(void *a) ...@@ -62,7 +61,7 @@ static void *ThreadFuncTest3(void *a)
g_testToCount003++; g_testToCount003++;
while (g_testToCount002 == 0) { while (g_testToCount002 == 0) {
SLEEP_AND_YIELD(2); // 2, delay enouge time SLEEP_AND_YIELD(2); // 2, delay enough time
} }
ret = pthread_mutex_unlock(&g_muxLock003); ret = pthread_mutex_unlock(&g_muxLock003);
...@@ -96,7 +95,7 @@ static void *ThreadFuncTest2(void *a) ...@@ -96,7 +95,7 @@ static void *ThreadFuncTest2(void *a)
g_testToCount002++; g_testToCount002++;
while (g_testToCount001 == 0) { while (g_testToCount001 == 0) {
SLEEP_AND_YIELD(2); // 2, delay enouge time SLEEP_AND_YIELD(2); // 2, delay enough time
} }
ret = pthread_mutex_unlock(&g_muxLock002); ret = pthread_mutex_unlock(&g_muxLock002);
...@@ -141,12 +140,8 @@ EXIT: ...@@ -141,12 +140,8 @@ EXIT:
static int Testcase(void) static int Testcase(void)
{ {
struct sched_param param = { 0 };
int ret; int ret;
void *res = nullptr; pthread_t newPthread;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_mutexattr_t mutex = { 0 }; pthread_mutexattr_t mutex = { 0 };
int index = TEST_COUNT; int index = TEST_COUNT;
......
...@@ -41,8 +41,6 @@ static void *ThreadFuncTest3(void *a) ...@@ -41,8 +41,6 @@ static void *ThreadFuncTest3(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self(); pthread_t thread = pthread_self();
int currThreadPri, currThreadPolicy;
struct sched_param param = { 0 };
struct timespec time; struct timespec time;
struct timeval timeVal = { 0 }; struct timeval timeVal = { 0 };
...@@ -120,12 +118,8 @@ EXIT: ...@@ -120,12 +118,8 @@ EXIT:
static int Testcase(void) static int Testcase(void)
{ {
struct sched_param param = { 0 };
int ret; int ret;
void *res = nullptr; pthread_t newPthread;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
int index = TEST_COUNT; int index = TEST_COUNT;
......
...@@ -38,7 +38,6 @@ static int g_testBackCount = 0; ...@@ -38,7 +38,6 @@ static int g_testBackCount = 0;
static void *ThreadFuncTest3(void *a) static void *ThreadFuncTest3(void *a)
{ {
int ret; int ret;
int tid = Gettid();
pthread_t thread = pthread_self(); pthread_t thread = pthread_self();
ret = pthread_detach(thread); ret = pthread_detach(thread);
...@@ -59,8 +58,6 @@ EXIT: ...@@ -59,8 +58,6 @@ EXIT:
static void *ThreadFuncTest2(void *a) static void *ThreadFuncTest2(void *a)
{ {
int ret; int ret;
int tid = Gettid();
pthread_t thread = pthread_self();
g_testBackCount++; g_testBackCount++;
ret = pthread_mutex_lock(&g_mutexLock); ret = pthread_mutex_lock(&g_mutexLock);
...@@ -78,10 +75,8 @@ static int TestCase(void) ...@@ -78,10 +75,8 @@ static int TestCase(void)
{ {
struct sched_param param = { 0 }; struct sched_param param = { 0 };
int ret; int ret;
void *res = nullptr;
int currThreadPri, currThreadPolicy; int currThreadPri, currThreadPolicy;
pthread_attr_t a = { 0 }; pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread; pthread_t newPthread;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL); pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL);
......
...@@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a) ...@@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self(); pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_detach(thread); ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
...@@ -69,7 +67,6 @@ EXIT: ...@@ -69,7 +67,6 @@ EXIT:
static void *ThreadFuncTest1(void *a) static void *ThreadFuncTest1(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self();
struct timespec time; struct timespec time;
struct timeval timeVal = { 0 }; struct timeval timeVal = { 0 };
...@@ -106,9 +103,7 @@ static int Testcase(void) ...@@ -106,9 +103,7 @@ static int Testcase(void)
struct sched_param param = { 0 }; struct sched_param param = { 0 };
int ret; int ret;
int threadCount; int threadCount;
void *res = nullptr;
pthread_attr_t a = { 0 }; pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread[10], newPthread1; pthread_t newPthread[10], newPthread1;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
int index = TEST_COUNT; int index = TEST_COUNT;
......
...@@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a) ...@@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self(); pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_detach(thread); ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
...@@ -69,9 +67,6 @@ EXIT: ...@@ -69,9 +67,6 @@ EXIT:
static void *ThreadFuncTest1(void *a) static void *ThreadFuncTest1(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_mutex_lock(&g_muxLock001); ret = pthread_mutex_lock(&g_muxLock001);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
...@@ -96,7 +91,6 @@ EXIT: ...@@ -96,7 +91,6 @@ EXIT:
static void *ThreadFuncTest0(void *a) static void *ThreadFuncTest0(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self();
struct timespec time; struct timespec time;
struct timeval timeVal = { 0 }; struct timeval timeVal = { 0 };
...@@ -136,9 +130,7 @@ static int Testcase(void) ...@@ -136,9 +130,7 @@ static int Testcase(void)
struct sched_param param = { 0 }; struct sched_param param = { 0 };
int ret; int ret;
int threadCount; int threadCount;
void *res = nullptr;
pthread_attr_t a = { 0 }; pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread[10], newPthread1; pthread_t newPthread[10], newPthread1;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
int index = TEST_COUNT; int index = TEST_COUNT;
......
...@@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a) ...@@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self(); pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_detach(thread); ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
...@@ -69,9 +67,6 @@ EXIT: ...@@ -69,9 +67,6 @@ EXIT:
static void *ThreadFuncTest1(void *a) static void *ThreadFuncTest1(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_mutex_lock(&g_muxLock001); ret = pthread_mutex_lock(&g_muxLock001);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
...@@ -96,7 +91,6 @@ EXIT: ...@@ -96,7 +91,6 @@ EXIT:
static void *ThreadFuncTest0(void *a) static void *ThreadFuncTest0(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self();
struct timespec time; struct timespec time;
struct timeval timeVal = { 0 }; struct timeval timeVal = { 0 };
...@@ -136,9 +130,7 @@ static int Testcase(void) ...@@ -136,9 +130,7 @@ static int Testcase(void)
struct sched_param param = { 0 }; struct sched_param param = { 0 };
int ret; int ret;
int threadCount; int threadCount;
void *res = nullptr;
pthread_attr_t a = { 0 }; pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread[10], newPthread1; pthread_t newPthread[10], newPthread1;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
int index = TEST_COUNT; int index = TEST_COUNT;
......
...@@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a) ...@@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self(); pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_detach(thread); ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
...@@ -69,9 +67,6 @@ EXIT: ...@@ -69,9 +67,6 @@ EXIT:
static void *ThreadFuncTest1(void *a) static void *ThreadFuncTest1(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_mutex_lock(&g_muxLock001); ret = pthread_mutex_lock(&g_muxLock001);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
...@@ -96,7 +91,6 @@ EXIT: ...@@ -96,7 +91,6 @@ EXIT:
static void *ThreadFuncTest0(void *a) static void *ThreadFuncTest0(void *a)
{ {
int ret; int ret;
pthread_t thread = pthread_self();
struct timespec time; struct timespec time;
struct timeval timeVal = { 0 }; struct timeval timeVal = { 0 };
...@@ -136,9 +130,7 @@ static int Testcase(void) ...@@ -136,9 +130,7 @@ static int Testcase(void)
struct sched_param param = { 0 }; struct sched_param param = { 0 };
int ret; int ret;
int threadCount; int threadCount;
void *res = nullptr;
pthread_attr_t a = { 0 }; pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread[10], newPthread1; pthread_t newPthread[10], newPthread1;
pthread_mutexattr_t mutex; pthread_mutexattr_t mutex;
int index = TEST_COUNT; int index = TEST_COUNT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册