Browse Source

Numerous style police clean ups in cgminer.c

nfactor-troky
ckolivas 13 years ago
parent
commit
830f2902b9
  1. 27
      cgminer.c

27
cgminer.c

@ -445,6 +445,7 @@ struct pool *current_pool(void) @@ -445,6 +445,7 @@ struct pool *current_pool(void)
char *set_int_range(const char *arg, int *i, int min, int max)
{
char *err = opt_set_intval(arg, i);
if (err)
return err;
@ -594,7 +595,7 @@ static char *set_userpass(const char *arg) @@ -594,7 +595,7 @@ static char *set_userpass(const char *arg)
static char *enable_debug(bool *flag)
{
*flag = true;
/* Turn out verbose output, too. */
/* Turn on verbose output, too. */
opt_log_output = true;
return NULL;
}
@ -609,8 +610,8 @@ static char *set_schedtime(const char *arg, struct schedtime *st) @@ -609,8 +610,8 @@ static char *set_schedtime(const char *arg, struct schedtime *st)
return NULL;
}
static char*
set_sharelog(char *arg) {
static char* set_sharelog(char *arg)
{
char *r = "";
long int i = strtol(arg, &r, 10);
@ -662,11 +663,11 @@ static void load_temp_cutoffs() @@ -662,11 +663,11 @@ static void load_temp_cutoffs()
devices[device]->cutofftemp = val;
}
}
else {
for (i = device; i < total_devices; ++i)
} else {
for (i = device; i < total_devices; ++i) {
if (!devices[i]->cutofftemp)
devices[i]->cutofftemp = opt_cutofftemp;
}
return;
}
if (device <= 1) {
@ -1025,6 +1026,7 @@ static char *parse_config(json_t *config, bool fileconf) @@ -1025,6 +1026,7 @@ static char *parse_config(json_t *config, bool fileconf)
name = strdup(opt->names);
for (p = strtok(name, "|"); p; p = strtok(NULL, "|")) {
char *err = NULL;
/* Ignore short options. */
if (p[1] != '-')
continue;
@ -1117,8 +1119,7 @@ static void load_default_config(void) @@ -1117,8 +1119,7 @@ static void load_default_config(void)
if (getenv("HOME") && *getenv("HOME")) {
strcpy(cnfbuf, getenv("HOME"));
strcat(cnfbuf, "/");
}
else
} else
strcpy(cnfbuf, "");
strcat(cnfbuf, ".cgminer/");
#else
@ -4805,6 +4806,7 @@ out: @@ -4805,6 +4806,7 @@ out:
// Make a pipe: [readFD, writeFD]
int pfd[2];
int r = pipe(pfd);
if (r < 0) {
perror("pipe - failed to create pipe for --monitor");
exit(1);
@ -4946,8 +4948,7 @@ bool add_cgpu(struct cgpu_info*cgpu) @@ -4946,8 +4948,7 @@ bool add_cgpu(struct cgpu_info*cgpu)
HASH_FIND_STR(devids, cgpu->api->name, d);
if (d)
cgpu->device_id = ++d->lastid;
else
{
else {
d = malloc(sizeof(*d));
memcpy(d->name, cgpu->api->name, sizeof(d->name));
cgpu->device_id = d->lastid = 0;
@ -5108,12 +5109,14 @@ int main(int argc, char *argv[]) @@ -5108,12 +5109,14 @@ int main(int argc, char *argv[])
#ifdef WANT_CPUMINE
if (0 <= opt_bench_algo) {
double rate = bench_algo_stage3(opt_bench_algo);
if (!skip_to_bench) {
if (!skip_to_bench)
printf("%.5f (%s)\n", rate, algo_names[opt_bench_algo]);
} else {
else {
// Write result to shared memory for parent
#if defined(WIN32)
char unique_name[64];
if (GetEnvironmentVariable("CGMINER_SHARED_MEM", unique_name, 32)) {
HANDLE map_handle = CreateFileMapping(
INVALID_HANDLE_VALUE, // use paging file

Loading…
Cancel
Save