Browse Source

Provide a blank get_statline_before function for drivers that don't have one.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
b3d9477eb7
  1. 23
      cgminer.c

23
cgminer.c

@ -1900,10 +1900,7 @@ static void get_statline(char *buf, struct cgpu_info *cgpu)
suffix_string(dr64, displayed_rolling, 4); suffix_string(dr64, displayed_rolling, 4);
sprintf(buf, "%s%d ", cgpu->drv->name, cgpu->device_id); sprintf(buf, "%s%d ", cgpu->drv->name, cgpu->device_id);
if (cgpu->drv->get_statline_before) cgpu->drv->get_statline_before(buf, cgpu);
cgpu->drv->get_statline_before(buf, cgpu);
else
tailsprintf(buf, " | ");
tailsprintf(buf, "(%ds):%s (avg):%sh/s | A:%d R:%d HW:%d U:%.1f/m", tailsprintf(buf, "(%ds):%s (avg):%sh/s | A:%d R:%d HW:%d U:%.1f/m",
opt_log_interval, opt_log_interval,
displayed_rolling, displayed_rolling,
@ -1999,13 +1996,9 @@ static void curses_print_devstatus(int thr_id)
wmove(statuswin,devcursor + cgpu->cgminer_id, 0); wmove(statuswin,devcursor + cgpu->cgminer_id, 0);
wprintw(statuswin, " %s %*d: ", cgpu->drv->name, dev_width, cgpu->device_id); wprintw(statuswin, " %s %*d: ", cgpu->drv->name, dev_width, cgpu->device_id);
if (cgpu->drv->get_statline_before) { logline[0] = '\0';
logline[0] = '\0'; cgpu->drv->get_statline_before(logline, cgpu);
cgpu->drv->get_statline_before(logline, cgpu); wprintw(statuswin, "%s", logline);
wprintw(statuswin, "%s", logline);
}
else
wprintw(statuswin, " | ");
dh64 = (double)cgpu->total_mhashes / total_secs * 1000000ull; dh64 = (double)cgpu->total_mhashes / total_secs * 1000000ull;
dr64 = (double)cgpu->rolling * 1000000ull; dr64 = (double)cgpu->rolling * 1000000ull;
@ -6381,6 +6374,11 @@ void noop_reinit_device(struct cgpu_info __maybe_unused *cgpu)
{ {
} }
void blank_get_statline_before(char *buf, struct cgpu_info __maybe_unused *cgpu)
{
tailsprintf(buf, " | ");
}
/* Fill missing driver api functions with noops */ /* Fill missing driver api functions with noops */
void fill_device_api(struct cgpu_info *cgpu) void fill_device_api(struct cgpu_info *cgpu)
{ {
@ -6388,6 +6386,8 @@ void fill_device_api(struct cgpu_info *cgpu)
if (!drv->reinit_device) if (!drv->reinit_device)
drv->reinit_device = &noop_reinit_device; drv->reinit_device = &noop_reinit_device;
if (!drv->get_statline_before)
drv->get_statline_before = &blank_get_statline_before;
} }
void enable_device(struct cgpu_info *cgpu) void enable_device(struct cgpu_info *cgpu)
@ -6403,6 +6403,7 @@ void enable_device(struct cgpu_info *cgpu)
gpu_threads += cgpu->threads; gpu_threads += cgpu->threads;
} }
#endif #endif
fill_device_api(cgpu);
} }
struct _cgpu_devid_counter { struct _cgpu_devid_counter {

Loading…
Cancel
Save