Revert "Fix compile warnings in api.c" This reverts commit 8a90f1a756b60914afe61b2ea7362313026a9f1a. Breaks windows build.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
diff --git a/api.c b/api.c
index e53b1ba..ed17137 100644
--- a/api.c
+++ b/api.c
@@ -336,7 +336,7 @@ struct CODES {
{ SEVERITY_ERR, MSG_MISFN, PARAM_NONE, "Missing save filename parameter" },
{ SEVERITY_ERR, MSG_BADFN, PARAM_STR, "Can't open or create save file '%s'" },
{ SEVERITY_ERR, MSG_SAVED, PARAM_STR, "Configuration saved to file '%s'" },
- { SEVERITY_FAIL, 0, 0, NULL }
+ { SEVERITY_FAIL }
};
static int bye = 0;
@@ -445,7 +445,7 @@ static char *message(int messageid, int paramid, char *param2, bool isjson)
return msg_buffer;
}
-static void apiversion(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+static void apiversion(SOCKETTYPE c, char *param, bool isjson)
{
if (isjson)
sprintf(io_buffer, "%s," JSON_VERSION "{\"CGMiner\":\"%s\",\"API\":\"%s\"}" JSON_CLOSE,
@@ -457,7 +457,7 @@ static void apiversion(__maybe_unused SOCKETTYPE c, __maybe_unused char *param,
VERSION, APIVERSION, SEPARATOR);
}
-static void minerconfig(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+static void minerconfig(SOCKETTYPE c, char *param, bool isjson)
{
char buf[BUFSIZ];
int cpucount = 0;
@@ -573,7 +573,7 @@ static void cpustatus(int cpu, bool isjson)
}
#endif
-static void devstatus(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+static void devstatus(SOCKETTYPE c, char *param, bool isjson)
{
int i;
@@ -610,7 +610,7 @@ static void devstatus(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, b
strcat(io_buffer, JSON_CLOSE);
}
-static void gpudev(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
+static void gpudev(SOCKETTYPE c, char *param, bool isjson)
{
int id;
@@ -644,7 +644,7 @@ static void gpudev(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
}
#ifdef WANT_CPUMINE
-static void cpudev(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
+static void cpudev(SOCKETTYPE c, char *param, bool isjson)
{
int id;
@@ -678,7 +678,7 @@ static void cpudev(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
}
#endif
-static void poolstatus(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+static void poolstatus(SOCKETTYPE c, char *param, bool isjson)
{
char buf[BUFSIZ];
char *status, *lp;
@@ -740,7 +740,7 @@ static void poolstatus(__maybe_unused SOCKETTYPE c, __maybe_unused char *param,
strcat(io_buffer, JSON_CLOSE);
}
-static void summary(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+static void summary(SOCKETTYPE c, char *param, bool isjson)
{
double utility, mhs;
@@ -786,7 +786,7 @@ static void summary(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, boo
#endif
}
-static void gpuenable(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
+static void gpuenable(SOCKETTYPE c, char *param, bool isjson)
{
struct thr_info *thr;
int gpu;
@@ -832,7 +832,7 @@ static void gpuenable(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
strcpy(io_buffer, message(MSG_GPUREN, id, NULL, isjson));
}
-static void gpudisable(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
+static void gpudisable(SOCKETTYPE c, char *param, bool isjson)
{
int id;
@@ -862,7 +862,7 @@ static void gpudisable(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
strcpy(io_buffer, message(MSG_GPUDIS, id, NULL, isjson));
}
-static void gpurestart(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
+static void gpurestart(SOCKETTYPE c, char *param, bool isjson)
{
int id;
@@ -887,7 +887,7 @@ static void gpurestart(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
strcpy(io_buffer, message(MSG_GPUREI, id, NULL, isjson));
}
-static void gpucount(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+static void gpucount(SOCKETTYPE c, char *param, bool isjson)
{
char buf[BUFSIZ];
@@ -901,7 +901,7 @@ static void gpucount(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bo
strcat(io_buffer, buf);
}
-static void cpucount(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+static void cpucount(SOCKETTYPE c, char *param, bool isjson)
{
char buf[BUFSIZ];
int count = 0;
@@ -920,7 +920,7 @@ static void cpucount(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bo
strcat(io_buffer, buf);
}
-static void switchpool(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
+static void switchpool(SOCKETTYPE c, char *param, bool isjson)
{
struct pool *pool;
int id;
@@ -983,7 +983,7 @@ static bool splitgpuvalue(char *param, int *gpu, char **value, bool isjson)
return true;
}
-static void gpuintensity(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
+static void gpuintensity(SOCKETTYPE c, char *param, bool isjson)
{
int id;
char *value;
@@ -1012,7 +1012,7 @@ static void gpuintensity(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
strcpy(io_buffer, message(MSG_GPUINT, id, intensitystr, isjson));
}
-static void gpumem(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+static void gpumem(SOCKETTYPE c, char *param, bool isjson)
{
#ifdef HAVE_ADL
int id;
@@ -1033,7 +1033,7 @@ static void gpumem(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool
#endif
}
-static void gpuengine(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+static void gpuengine(SOCKETTYPE c, char *param, bool isjson)
{
#ifdef HAVE_ADL
int id;
@@ -1054,7 +1054,7 @@ static void gpuengine(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, b
#endif
}
-static void gpufan(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+static void gpufan(SOCKETTYPE c, char *param, bool isjson)
{
#ifdef HAVE_ADL
int id;
@@ -1075,7 +1075,7 @@ static void gpufan(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool
#endif
}
-static void gpuvddc(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+static void gpuvddc(SOCKETTYPE c, char *param, bool isjson)
{
#ifdef HAVE_ADL
int id;
@@ -1098,7 +1098,7 @@ static void gpuvddc(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, boo
static void send_result(SOCKETTYPE c, bool isjson);
-void doquit(SOCKETTYPE c, __maybe_unused char *param, bool isjson)
+void doquit(SOCKETTYPE c, char *param, bool isjson)
{
if (isjson)
strcpy(io_buffer, JSON_START JSON_BYE);
@@ -1111,7 +1111,7 @@ void doquit(SOCKETTYPE c, __maybe_unused char *param, bool isjson)
kill_work();
}
-void dosave(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
+void dosave(SOCKETTYPE c, char *param, bool isjson)
{
FILE *fcfg;
@@ -1158,7 +1158,7 @@ struct CMDS {
{ "gpuvddc", gpuvddc},
{ "save", dosave },
{ "quit", doquit },
- { NULL, NULL }
+ { NULL }
};
static void send_result(SOCKETTYPE c, bool isjson)
@@ -1251,7 +1251,7 @@ void api(void)
if (!opt_api_network) {
serv.sin_addr.s_addr = inet_addr(localaddr);
- if (serv.sin_addr.s_addr == (in_addr_t)INVINETADDR) {
+ if (serv.sin_addr.s_addr == INVINETADDR) {
applog(LOG_ERR, "API2 initialisation failed (%s)%s", SOCKERRMSG, UNAVAILABLE);
return;
}
diff --git a/miner.h b/miner.h
index fcef5e5..8f4e035 100644
--- a/miner.h
+++ b/miner.h
@@ -147,7 +147,6 @@ enum {
#define unlikely(expr) (expr)
#define likely(expr) (expr)
#endif
-#define __maybe_unused __attribute__((unused))
#if defined(__i386__)
#define WANT_CRYPTOPP_ASM32