mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Use switch statement for cgpu->status and fix spelling.
This commit is contained in:
parent
31ddad67b6
commit
0ed757a020
29
api.c
29
api.c
@ -170,7 +170,7 @@ static const char *APIVERSION = "1.14";
|
|||||||
static const char *DEAD = "Dead";
|
static const char *DEAD = "Dead";
|
||||||
static const char *SICK = "Sick";
|
static const char *SICK = "Sick";
|
||||||
static const char *NOSTART = "NoStart";
|
static const char *NOSTART = "NoStart";
|
||||||
static const char *INIT = "Initializing";
|
static const char *INIT = "Initialising";
|
||||||
static const char *DISABLED = "Disabled";
|
static const char *DISABLED = "Disabled";
|
||||||
static const char *ALIVE = "Alive";
|
static const char *ALIVE = "Alive";
|
||||||
static const char *REJECTING = "Rejecting";
|
static const char *REJECTING = "Rejecting";
|
||||||
@ -1257,16 +1257,23 @@ static void gpustatus(int gpu, bool isjson)
|
|||||||
else
|
else
|
||||||
enabled = (char *)NO;
|
enabled = (char *)NO;
|
||||||
|
|
||||||
if (cgpu->status == LIFE_DEAD)
|
switch(cgpu->status) {
|
||||||
status = (char *)DEAD;
|
case LIFE_DEAD:
|
||||||
else if (cgpu->status == LIFE_SICK)
|
status = (char *)DEAD;
|
||||||
status = (char *)SICK;
|
break;
|
||||||
else if (cgpu->status == LIFE_NOSTART)
|
case LIFE_SICK:
|
||||||
status = (char *)NOSTART;
|
status = (char *)SICK;
|
||||||
else if (cgpu->status == LIFE_INIT)
|
break;
|
||||||
status = (char *)INIT;
|
case LIFE_NOSTART:
|
||||||
else
|
status = (char *)NOSTART;
|
||||||
status = (char *)ALIVE;
|
break;
|
||||||
|
case LIFE_INIT:
|
||||||
|
status = (char *)INIT;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
status = (char *)ALIVE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (cgpu->dynamic)
|
if (cgpu->dynamic)
|
||||||
strcpy(intensity, DYNAMIC);
|
strcpy(intensity, DYNAMIC);
|
||||||
|
Loading…
Reference in New Issue
Block a user