fix warning: unused variable

Signed-off-by: zhumingxian <zhumingxian@ohos.com.cn>
This commit is contained in:
zhumingxian 2022-06-30 20:49:35 +08:00
parent 12adfd5832
commit 089376994a
13 changed files with 13 additions and 85 deletions

View File

@ -64,12 +64,8 @@ EXIT:
static int Testcase(void)
{
struct sched_param param = { 0 };
int ret;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_t newPthread;
pthread_mutexattr_t mutex;
int index = 0;
pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL);

View File

@ -65,10 +65,8 @@ static int Testcase(void)
{
struct sched_param param = { 0 };
int ret;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_t newPthread;
pthread_mutexattr_t mutex;
int index = 0;
int currThreadPri, currThreadPolicy;

View File

@ -74,12 +74,9 @@ static int Testcase(void)
{
struct sched_param param = { 0 };
int ret;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_t newPthread;
pthread_mutexattr_t mutex;
int count = 0;
int currThreadPri, currThreadPolicy;
g_preTaskPri = 0xffffffff;

View File

@ -49,8 +49,6 @@ static void *ThreadFuncTest3(void *a)
int ret;
int tid = Gettid();
pthread_t thread = pthread_self();
int currThreadPri, currThreadPolicy;
struct sched_param param = { 0 };
ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
@ -124,14 +122,10 @@ EXIT:
static int Testcase(void)
{
struct sched_param param = { 0 };
int ret;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_t newPthread;
pthread_mutexattr_t mutex;
int index = 0;
pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL);
pthread_mutex_init(&g_muxLock001, &mutex);
pthread_mutex_init(&g_muxLock002, &mutex);

View File

@ -49,8 +49,6 @@ static void *ThreadFuncTest3(void *a)
int ret;
int tid;
pthread_t thread = pthread_self();
int currThreadPri, currThreadPolicy;
struct sched_param param = { 0 };
ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
@ -126,14 +124,10 @@ EXIT:
static int Testcase(void)
{
struct sched_param param = { 0 };
int ret;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_t newPthread;
pthread_mutexattr_t mutex;
int index = 0;
pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL);
pthread_mutex_init(&g_muxLock001, &mutex);
pthread_mutex_init(&g_muxLock002, &mutex);

View File

@ -48,8 +48,6 @@ static void *ThreadFuncTest3(void *a)
{
int ret;
int tid = Gettid();
int currThreadPri, currThreadPolicy;
struct sched_param param = { 0 };
pthread_t thread = pthread_self();
ret = pthread_detach(thread);
@ -118,18 +116,14 @@ static void *ThreadFuncTest1(void *a)
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
EXIT:
return nullptr;
return nullptr;
}
static int Testcase(void)
{
struct sched_param param = { 0 };
int ret;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t newPthread, newPthread1;
pthread_t newPthread;
pthread_mutexattr_t mutex;
int index = 0;
pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL);
pthread_mutex_init(&g_mutexLock001, &mutex);
pthread_mutex_init(&g_mutexLock002, &mutex);

View File

@ -43,7 +43,6 @@ static void *ThreadFuncTest3(void *a)
{
int ret;
pthread_t thread = pthread_self();
int currThreadPri, currThreadPolicy;
struct sched_param param = { 0 };
struct timespec time;
struct timeval timeVal = { 0 };
@ -62,7 +61,7 @@ static void *ThreadFuncTest3(void *a)
g_testToCount003++;
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);
@ -96,7 +95,7 @@ static void *ThreadFuncTest2(void *a)
g_testToCount002++;
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);
@ -141,12 +140,8 @@ EXIT:
static int Testcase(void)
{
struct sched_param param = { 0 };
int ret;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_t newPthread;
pthread_mutexattr_t mutex = { 0 };
int index = TEST_COUNT;

View File

@ -41,8 +41,6 @@ static void *ThreadFuncTest3(void *a)
{
int ret;
pthread_t thread = pthread_self();
int currThreadPri, currThreadPolicy;
struct sched_param param = { 0 };
struct timespec time;
struct timeval timeVal = { 0 };
@ -120,12 +118,8 @@ EXIT:
static int Testcase(void)
{
struct sched_param param = { 0 };
int ret;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread, newPthread1;
pthread_t newPthread;
pthread_mutexattr_t mutex;
int index = TEST_COUNT;

View File

@ -38,7 +38,6 @@ static int g_testBackCount = 0;
static void *ThreadFuncTest3(void *a)
{
int ret;
int tid = Gettid();
pthread_t thread = pthread_self();
ret = pthread_detach(thread);
@ -59,8 +58,6 @@ EXIT:
static void *ThreadFuncTest2(void *a)
{
int ret;
int tid = Gettid();
pthread_t thread = pthread_self();
g_testBackCount++;
ret = pthread_mutex_lock(&g_mutexLock);
@ -78,10 +75,8 @@ static int TestCase(void)
{
struct sched_param param = { 0 };
int ret;
void *res = nullptr;
int currThreadPri, currThreadPolicy;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread;
pthread_mutexattr_t mutex;
pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL);

View File

@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a)
{
int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
@ -69,7 +67,6 @@ EXIT:
static void *ThreadFuncTest1(void *a)
{
int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
@ -106,9 +103,7 @@ static int Testcase(void)
struct sched_param param = { 0 };
int ret;
int threadCount;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread[10], newPthread1;
pthread_mutexattr_t mutex;
int index = TEST_COUNT;

View File

@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a)
{
int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
@ -69,9 +67,6 @@ EXIT:
static void *ThreadFuncTest1(void *a)
{
int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_mutex_lock(&g_muxLock001);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
@ -96,7 +91,6 @@ EXIT:
static void *ThreadFuncTest0(void *a)
{
int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
@ -136,9 +130,7 @@ static int Testcase(void)
struct sched_param param = { 0 };
int ret;
int threadCount;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread[10], newPthread1;
pthread_mutexattr_t mutex;
int index = TEST_COUNT;

View File

@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a)
{
int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
@ -69,9 +67,6 @@ EXIT:
static void *ThreadFuncTest1(void *a)
{
int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_mutex_lock(&g_muxLock001);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
@ -96,7 +91,6 @@ EXIT:
static void *ThreadFuncTest0(void *a)
{
int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
@ -136,9 +130,7 @@ static int Testcase(void)
struct sched_param param = { 0 };
int ret;
int threadCount;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread[10], newPthread1;
pthread_mutexattr_t mutex;
int index = TEST_COUNT;

View File

@ -45,8 +45,6 @@ static void *ThreadFuncTest2(void *a)
{
int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_detach(thread);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
@ -69,9 +67,6 @@ EXIT:
static void *ThreadFuncTest1(void *a)
{
int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
ret = pthread_mutex_lock(&g_muxLock001);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
@ -96,7 +91,6 @@ EXIT:
static void *ThreadFuncTest0(void *a)
{
int ret;
pthread_t thread = pthread_self();
struct timespec time;
struct timeval timeVal = { 0 };
@ -136,9 +130,7 @@ static int Testcase(void)
struct sched_param param = { 0 };
int ret;
int threadCount;
void *res = nullptr;
pthread_attr_t a = { 0 };
pthread_t thread = pthread_self();
pthread_t newPthread[10], newPthread1;
pthread_mutexattr_t mutex;
int index = TEST_COUNT;