Explorar o código

src: compiler suggests parentheses around assignment used as truth value

Nathalie Furmento %!s(int64=7) %!d(string=hai) anos
pai
achega
53f2fb3b3d

+ 1 - 1
src/core/dependencies/data_concurrency.c

@@ -409,7 +409,7 @@ int _starpu_notify_data_dependencies(starpu_data_handle_t handle)
 
 	handle->unlocking_reqs = 1;
 	struct _starpu_data_requester *r;
-	while (r = may_unlock_data_req_list_head(handle))
+	while ((r = may_unlock_data_req_list_head(handle)))
 	{
 		/* STARPU_RW accesses are treated as STARPU_W */
 		enum starpu_data_access_mode r_mode = r->mode;

+ 1 - 1
src/core/perfmodel/perfmodel_history.c

@@ -1266,7 +1266,7 @@ int starpu_perfmodel_list(FILE *output)
         if (dp != NULL)
 	{
 		struct dirent *ep;
-                while (ep = readdir(dp))
+                while ((ep = readdir(dp)))
 		{
                         if (strcmp(ep->d_name, ".") && strcmp(ep->d_name, ".."))
                                 fprintf(output, "file: <%s>\n", ep->d_name);

+ 4 - 2
src/core/topology.c

@@ -276,7 +276,8 @@ _starpu_initialize_workers_deviceid (int *explicit_workers_gpuid,
 	 * cores. */
 
 	/* what do we use, explicit value, env. variable, or round-robin ? */
-	if ((strval = starpu_getenv(varname)))
+	strval = starpu_getenv(varname);
+	if (strval)
 	{
 		/* STARPU_WORKERS_CUDAID certainly contains less entries than
 		 * STARPU_NMAXWORKERS, so we reuse its entries in a round
@@ -755,7 +756,8 @@ _starpu_initialize_workers_bindid (struct _starpu_machine_config *config)
 	 * cores. */
 
 	/* what do we use, explicit value, env. variable, or round-robin ? */
-	if (strval = starpu_getenv("STARPU_WORKERS_CPUID"))
+	strval = starpu_getenv("STARPU_WORKERS_CPUID");
+	if (strval)
 	{
 		/* STARPU_WORKERS_CPUID certainly contains less entries than
 		 * STARPU_NMAXWORKERS, so we reuse its entries in a round

+ 1 - 1
src/sched_policies/component_work_stealing.c

@@ -328,7 +328,7 @@ void _ws_remove_child(struct starpu_sched_component * component, struct starpu_s
 	component->children[i_component] = component->children[component->nchildren - 1];
 	component->nchildren--;
 	struct starpu_task * task;
-	while (task = _starpu_prio_deque_pop_task(tmp_fifo))
+	while ((task = _starpu_prio_deque_pop_task(tmp_fifo)))
 	{
 		starpu_sched_component_push_task(NULL, component, task);
 	}

+ 3 - 2
src/util/starpu_clusters_create.c

@@ -521,9 +521,10 @@ int _starpu_cluster_machine(hwloc_obj_type_t cluster_level,
 			     struct starpu_cluster_machine *machine)
 {
 	struct _starpu_cluster_group *g;
-	int ret = 0;
+	int ret;
 
-	if (ret = _starpu_cluster_topology(cluster_level, machine))
+	ret = _starpu_cluster_topology(cluster_level, machine);
+	if (ret)
 		return ret;
 
 	for (g = _starpu_cluster_group_list_begin(machine->groups) ;