Browse Source

Remove const qualifier from driver structs

Pretty much only needed to improve cgminer merge compatibility
Luke Dashjr 12 years ago
parent
commit
b5601b7899
5 changed files with 17 additions and 17 deletions
  1. 2 2
      api.c
  2. 10 10
      deviceapi.c
  3. 1 1
      driver-avalon.c
  4. 3 3
      miner.c
  5. 1 1
      miner.h

+ 2 - 2
api.c

@@ -1789,7 +1789,7 @@ static void pgadisable(struct io_data *io_data, __maybe_unused SOCKETTYPE c, cha
 static void pgaidentify(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *param, bool isjson, __maybe_unused char group)
 {
 	struct cgpu_info *cgpu;
-	const struct device_drv *drv;
+	struct device_drv *drv;
 	int numpga = numpgas();
 	int id;
 
@@ -3030,7 +3030,7 @@ static void setconfig(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char
 static void pgaset(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson, __maybe_unused char group)
 {
 	struct cgpu_info *cgpu;
-	const struct device_drv *drv;
+	struct device_drv *drv;
 	char buf[TMPBUFSIZ];
 	int numpga = numpgas();
 

+ 10 - 10
deviceapi.c

@@ -126,7 +126,7 @@ static
 struct work *get_and_prepare_work(struct thr_info *thr)
 {
 	struct cgpu_info *proc = thr->cgpu;
-	const struct device_drv *api = proc->drv;
+	struct device_drv *api = proc->drv;
 	struct work *work;
 	
 	work = get_work(thr);
@@ -145,7 +145,7 @@ struct work *get_and_prepare_work(struct thr_info *thr)
 void minerloop_scanhash(struct thr_info *mythr)
 {
 	struct cgpu_info *cgpu = mythr->cgpu;
-	const struct device_drv *api = cgpu->drv;
+	struct device_drv *api = cgpu->drv;
 	struct timeval tv_start, tv_end;
 	struct timeval tv_hashes, tv_worktime;
 	uint32_t max_nonce = api->can_limit_work ? api->can_limit_work(mythr) : 0xffffffff;
@@ -200,7 +200,7 @@ disabled:
 bool do_job_prepare(struct thr_info *mythr, struct timeval *tvp_now)
 {
 	struct cgpu_info *proc = mythr->cgpu;
-	const struct device_drv *api = proc->drv;
+	struct device_drv *api = proc->drv;
 	struct timeval tv_worktime;
 	
 	mythr->tv_morework.tv_sec = -1;
@@ -247,7 +247,7 @@ void job_prepare_complete(struct thr_info *mythr)
 void do_get_results(struct thr_info *mythr, bool proceed_with_new_job)
 {
 	struct cgpu_info *proc = mythr->cgpu;
-	const struct device_drv *api = proc->drv;
+	struct device_drv *api = proc->drv;
 	struct work *work = mythr->work;
 	
 	mythr->_job_transition_in_progress = true;
@@ -276,7 +276,7 @@ void job_results_fetched(struct thr_info *mythr)
 void do_job_start(struct thr_info *mythr)
 {
 	struct cgpu_info *proc = mythr->cgpu;
-	const struct device_drv *api = proc->drv;
+	struct device_drv *api = proc->drv;
 	
 	thread_reportin(mythr);
 	api->job_start(mythr);
@@ -323,7 +323,7 @@ void job_start_abort(struct thr_info *mythr, bool failure)
 bool do_process_results(struct thr_info *mythr, struct timeval *tvp_now, struct work *work, bool stopping)
 {
 	struct cgpu_info *proc = mythr->cgpu;
-	const struct device_drv *api = proc->drv;
+	struct device_drv *api = proc->drv;
 	struct timeval tv_hashes;
 	int64_t hashes = 0;
 	
@@ -383,7 +383,7 @@ void minerloop_async(struct thr_info *mythr)
 {
 	struct thr_info *thr = mythr;
 	struct cgpu_info *cgpu = mythr->cgpu;
-	const struct device_drv *api = cgpu->drv;
+	struct device_drv *api = cgpu->drv;
 	struct timeval tv_now;
 	struct timeval tv_timeout;
 	struct cgpu_info *proc;
@@ -453,7 +453,7 @@ static
 void do_queue_flush(struct thr_info *mythr)
 {
 	struct cgpu_info *proc = mythr->cgpu;
-	const struct device_drv *api = proc->drv;
+	struct device_drv *api = proc->drv;
 	
 	api->queue_flush(mythr);
 	if (mythr->next_work)
@@ -467,7 +467,7 @@ void minerloop_queue(struct thr_info *thr)
 {
 	struct thr_info *mythr;
 	struct cgpu_info *cgpu = thr->cgpu;
-	const struct device_drv *api = cgpu->drv;
+	struct device_drv *api = cgpu->drv;
 	struct timeval tv_now;
 	struct timeval tv_timeout;
 	struct cgpu_info *proc;
@@ -545,7 +545,7 @@ void *miner_thread(void *userdata)
 	struct thr_info *mythr = userdata;
 	const int thr_id = mythr->id;
 	struct cgpu_info *cgpu = mythr->cgpu;
-	const struct device_drv *drv = cgpu->drv;
+	struct device_drv *drv = cgpu->drv;
 
 	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
 

+ 1 - 1
driver-avalon.c

@@ -961,7 +961,7 @@ void minerloop_avalon(struct thr_info *mythr)
 {
 	const int thr_id = mythr->id;
 	struct cgpu_info *cgpu = mythr->cgpu;
-	const struct device_drv *api = cgpu->drv;
+	struct device_drv *api = cgpu->drv;
 	struct timeval tv_start, tv_end;
 	struct timeval tv_hashes;
 	uint32_t max_nonce = api->can_limit_work ? api->can_limit_work(mythr) : 0xffffffff;

+ 3 - 3
miner.c

@@ -2275,7 +2275,7 @@ static void get_statline2(char *buf, struct cgpu_info *cgpu, bool for_curses)
 #else
 	assert(for_curses == false);
 #endif
-	const struct device_drv *drv = cgpu->drv;
+	struct device_drv *drv = cgpu->drv;
 	void (*statline_func)(char *, struct cgpu_info *);
 	enum h2bs_fmt hashrate_style = for_curses ? H2B_SHORT : H2B_SPACED;
 	char cHr[h2bs_fmt_size[H2B_NOUNIT]], aHr[h2bs_fmt_size[H2B_NOUNIT]], uHr[h2bs_fmt_size[hashrate_style]];
@@ -6950,7 +6950,7 @@ void mt_disable_start(struct thr_info *mythr)
 
 void mt_disable_finish(struct thr_info *mythr)
 {
-	const struct device_drv *drv = mythr->cgpu->drv;
+	struct device_drv *drv = mythr->cgpu->drv;
 	
 	thread_reportin(mythr);
 	__thr_being_msg(mythr, "re-enabled");
@@ -8500,7 +8500,7 @@ begin_bench:
 	k = 0;
 	for (i = 0; i < total_devices; ++i) {
 		struct cgpu_info *cgpu = devices[i];
-		const struct device_drv *api = cgpu->drv;
+		struct device_drv *api = cgpu->drv;
 		int threadobj = cgpu->threads;
 		if (!threadobj)
 			// Create a fake thread object to handle hashmeter etc

+ 1 - 1
miner.h

@@ -403,7 +403,7 @@ struct cgminer_pool_stats {
 struct cgpu_info {
 	int cgminer_id;
 	int device_line_id;
-	const struct device_drv *drv;
+	struct device_drv *drv;
 	const char *devtype;
 	int device_id;
 	char *dev_repr;