From 06b54823b193c724d05045bc032fdad79b4b6a65 Mon Sep 17 00:00:00 2001
From: Tim Wickberg <tim@schedmd.com>
Date: Tue, 17 Nov 2015 16:13:18 -0800
Subject: [PATCH] remove pow() function calls to avoid dependency on -lm for
 clang

---
 src/common/gres.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/common/gres.c b/src/common/gres.c
index 6d04fef8683..4a9158d43a7 100644
--- a/src/common/gres.c
+++ b/src/common/gres.c
@@ -816,9 +816,9 @@ static int _parse_gres_config(void **dest, slurm_parser_enum_t type,
 		else if ((last[0] == 'g') || (last[0] == 'G'))
 			tmp_uint64 *= (1024 * 1024 * 1024);
 		else if ((last[0] == 't') || (last[0] == 'T'))
-			tmp_uint64 *= (uint64_t)pow(1024, 4);
+			tmp_uint64 *= (1024 * 1024 * 1024 * 1024);
 		else if ((last[0] == 'p') || (last[0] == 'P'))
-			tmp_uint64 *= (uint64_t)pow(1024, 5);
+			tmp_uint64 *= (1024 * 1024 * 1024 * 1024 * 1024);
 		else if (last[0] != '\0') {
 			fatal("Invalid gres data for %s, Count=%s", p->name,
 			      tmp_str);
@@ -1507,9 +1507,9 @@ static void _get_gres_cnt(gres_node_state_t *gres_data, char *orig_config,
 			else if ((last_num[0] == 'g') || (last_num[0] == 'G'))
 				tmp_gres_cnt *= (1024 * 1024 * 1024);
 			else if ((last_num[0] == 't') || (last_num[0] == 'T'))
-				tmp_gres_cnt *= (uint64_t)pow(1024, 4);
+				tmp_gres_cnt *= (1024 * 1024 * 1024 * 1024);
 			else if ((last_num[0] == 'p') || (last_num[0] == 'P'))
-				tmp_gres_cnt *= (uint64_t)pow(1024, 5);
+				tmp_gres_cnt *= (1024 * 1024 * 1024 * 1024 * 1024);
 			else {
 				error("Bad GRES configuration: %s", tok);
 				break;
-- 
GitLab