Browse Source

Merge branch 'bugfix_const' into bfgminer

Luke Dashjr 13 years ago
parent
commit
2d522b092e
4 changed files with 9 additions and 9 deletions
  1. 1 1
      adl.c
  2. 1 1
      driver-icarus.c
  3. 1 1
      miner.c
  4. 6 6
      miner.h

+ 1 - 1
adl.c

@@ -361,7 +361,7 @@ void init_adl(int nDevs)
 
 		applog(LOG_INFO, "GPU %d %s hardware monitoring enabled", gpu, lpInfo[i].strAdapterName);
 		if (gpus[gpu].name)
-			free(gpus[gpu].name);
+			free((void*)gpus[gpu].name);
 		gpus[gpu].name = lpInfo[i].strAdapterName;
 		gpus[gpu].has_adl = true;
 		/* Flag adl as active if any card is successfully activated */

+ 1 - 1
driver-icarus.c

@@ -469,7 +469,7 @@ static void icarus_shutdown(struct thr_info *thr)
 		icarus = thr->cgpu;
 
 		if (icarus->device_path)
-			free(icarus->device_path);
+			free((void*)icarus->device_path);
 
 		icarus_close(icarus->device_fd);
 

+ 1 - 1
miner.c

@@ -3653,7 +3653,7 @@ void *miner_thread(void *userdata)
 	struct thr_info *mythr = userdata;
 	const int thr_id = mythr->id;
 	struct cgpu_info *cgpu = mythr->cgpu;
-	struct device_api *api = cgpu->api;
+	const struct device_api *api = cgpu->api;
 
 	/* Try to cycle approximately 5 times before each log update */
 	const unsigned long def_cycle = opt_log_interval / 5 ? : 1;

+ 6 - 6
miner.h

@@ -191,8 +191,8 @@ struct thr_info;
 struct work;
 
 struct device_api {
-	char*dname;
-	char*name;
+	const char*dname;
+	const char*name;
 
 	// API-global functions
 	void (*api_detect)();
@@ -252,10 +252,10 @@ enum dev_reason {
 
 struct cgpu_info {
 	int cgminer_id;
-	struct device_api *api;
+	const struct device_api *api;
 	int device_id;
-	char *name;
-	char *device_path;
+	const char *name;
+	const char *device_path;
 	FILE *device_file;
 	union {
 #ifdef USE_ZTEX
@@ -285,7 +285,7 @@ struct cgpu_info {
 	int virtual_adl;
 	int intensity;
 	bool dynamic;
-	char *kname;
+	const char *kname;
 #ifdef HAVE_OPENCL
 	cl_uint vwidth;
 	size_t work_size;