diff --git a/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c b/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c
index 6a209c31ae94a9d93ee1fbe49a4449ab3f0709b4..b2fdf67111aee225d4a0ef51ab5e4d78f795834c 100644
--- a/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c
+++ b/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c
@@ -1206,142 +1206,142 @@ extern int setup_association_limits(slurmdb_association_rec_t *assoc,
 	if(!assoc)
 		return SLURM_ERROR;
 
-	if((int)assoc->shares_raw >= 0) {
+	if((int32_t)assoc->shares_raw >= 0) {
 		xstrcat(*cols, ", shares");
 		xstrfmtcat(*vals, ", %u", assoc->shares_raw);
 		xstrfmtcat(*extra, ", shares=%u", assoc->shares_raw);
-	} else if (((int)assoc->shares_raw == INFINITE) || get_fs) {
+	} else if ((assoc->shares_raw == INFINITE) || get_fs) {
 		xstrcat(*cols, ", shares");
 		xstrcat(*vals, ", 1");
 		xstrcat(*extra, ", shares=1");
 		assoc->shares_raw = 1;
 	}
 
-	if((int)assoc->grp_cpu_mins >= 0) {
+	if((int64_t)assoc->grp_cpu_mins >= 0) {
 		xstrcat(*cols, ", grp_cpu_mins");
 		xstrfmtcat(*vals, ", %llu", assoc->grp_cpu_mins);
 		xstrfmtcat(*extra, ", grp_cpu_mins=%llu",
 			   assoc->grp_cpu_mins);
-	} else if((int)assoc->grp_cpu_mins == INFINITE) {
+	} else if(assoc->grp_cpu_mins == INFINITE) {
 		xstrcat(*cols, ", grp_cpu_mins");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_cpu_mins=NULL");
 	}
 
-	if((int)assoc->grp_cpus >= 0) {
+	if((int32_t)assoc->grp_cpus >= 0) {
 		xstrcat(*cols, ", grp_cpus");
 		xstrfmtcat(*vals, ", %u", assoc->grp_cpus);
 		xstrfmtcat(*extra, ", grp_cpus=%u", assoc->grp_cpus);
-	} else if((int)assoc->grp_cpus == INFINITE) {
+	} else if(assoc->grp_cpus == INFINITE) {
 		xstrcat(*cols, ", grp_cpus");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_cpus=NULL");
 	}
 
-	if((int)assoc->grp_jobs >= 0) {
+	if((int32_t)assoc->grp_jobs >= 0) {
 		xstrcat(*cols, ", grp_jobs");
 		xstrfmtcat(*vals, ", %u", assoc->grp_jobs);
 		xstrfmtcat(*extra, ", grp_jobs=%u", assoc->grp_jobs);
-	} else if((int)assoc->grp_jobs == INFINITE) {
+	} else if(assoc->grp_jobs == INFINITE) {
 		xstrcat(*cols, ", grp_jobs");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_jobs=NULL");
 	}
 
-	if((int)assoc->grp_nodes >= 0) {
+	if((int32_t)assoc->grp_nodes >= 0) {
 		xstrcat(*cols, ", grp_nodes");
 		xstrfmtcat(*vals, ", %u", assoc->grp_nodes);
 		xstrfmtcat(*extra, ", grp_nodes=%u", assoc->grp_nodes);
-	} else if((int)assoc->grp_nodes == INFINITE) {
+	} else if(assoc->grp_nodes == INFINITE) {
 		xstrcat(*cols, ", grp_nodes");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_nodes=NULL");
 	}
 
-	if((int)assoc->grp_submit_jobs >= 0) {
+	if((int32_t)assoc->grp_submit_jobs >= 0) {
 		xstrcat(*cols, ", grp_submit_jobs");
 		xstrfmtcat(*vals, ", %u",
 			   assoc->grp_submit_jobs);
 		xstrfmtcat(*extra, ", grp_submit_jobs=%u",
 			   assoc->grp_submit_jobs);
-	} else if((int)assoc->grp_submit_jobs == INFINITE) {
+	} else if(assoc->grp_submit_jobs == INFINITE) {
 		xstrcat(*cols, ", grp_submit_jobs");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_submit_jobs=NULL");
 	}
 
-	if((int)assoc->grp_wall >= 0) {
+	if((int32_t)assoc->grp_wall >= 0) {
 		xstrcat(*cols, ", grp_wall");
 		xstrfmtcat(*vals, ", %u", assoc->grp_wall);
 		xstrfmtcat(*extra, ", grp_wall=%u",
 			   assoc->grp_wall);
-	} else if((int)assoc->grp_wall == INFINITE) {
+	} else if(assoc->grp_wall == INFINITE) {
 		xstrcat(*cols, ", grp_wall");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_wall=NULL");
 	}
 
-	if((int)assoc->max_cpu_mins_pj >= 0) {
+	if((int64_t)assoc->max_cpu_mins_pj >= 0) {
 		xstrcat(*cols, ", max_cpu_mins_pj");
 		xstrfmtcat(*vals, ", %llu", assoc->max_cpu_mins_pj);
 		xstrfmtcat(*extra, ", max_cpu_mins_pj=%u",
 			   assoc->max_cpu_mins_pj);
-	} else if((int)assoc->max_cpu_mins_pj == INFINITE) {
+	} else if(assoc->max_cpu_mins_pj == INFINITE) {
 		xstrcat(*cols, ", max_cpu_mins_pj");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_cpu_mins_pj=NULL");
 	}
 
-	if((int)assoc->max_cpus_pj >= 0) {
+	if((int32_t)assoc->max_cpus_pj >= 0) {
 		xstrcat(*cols, ", max_cpus_pj");
 		xstrfmtcat(*vals, ", %u", assoc->max_cpus_pj);
 		xstrfmtcat(*extra, ", max_cpus_pj=%u",
 			   assoc->max_cpus_pj);
-	} else if((int)assoc->max_cpus_pj == INFINITE) {
+	} else if(assoc->max_cpus_pj == INFINITE) {
 		xstrcat(*cols, ", max_cpus_pj");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_cpus_pj=NULL");
 	}
 
-	if((int)assoc->max_jobs >= 0) {
+	if((int32_t)assoc->max_jobs >= 0) {
 		xstrcat(*cols, ", max_jobs");
 		xstrfmtcat(*vals, ", %u", assoc->max_jobs);
 		xstrfmtcat(*extra, ", max_jobs=%u",
 			   assoc->max_jobs);
-	} else if((int)assoc->max_jobs == INFINITE) {
+	} else if(assoc->max_jobs == INFINITE) {
 		xstrcat(*cols, ", max_jobs");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_jobs=NULL");
 	}
 
-	if((int)assoc->max_nodes_pj >= 0) {
+	if((int32_t)assoc->max_nodes_pj >= 0) {
 		xstrcat(*cols, ", max_nodes_pj");
 		xstrfmtcat(*vals, ", %u", assoc->max_nodes_pj);
 		xstrfmtcat(*extra, ", max_nodes_pj=%u",
 			   assoc->max_nodes_pj);
-	} else if((int)assoc->max_nodes_pj == INFINITE) {
+	} else if(assoc->max_nodes_pj == INFINITE) {
 		xstrcat(*cols, ", max_nodes_pj");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_nodes_pj=NULL");
 	}
 
-	if((int)assoc->max_submit_jobs >= 0) {
+	if((int32_t)assoc->max_submit_jobs >= 0) {
 		xstrcat(*cols, ", max_submit_jobs");
 		xstrfmtcat(*vals, ", %u", assoc->max_submit_jobs);
 		xstrfmtcat(*extra, ", max_submit_jobs=%u",
 			   assoc->max_submit_jobs);
-	} else if((int)assoc->max_submit_jobs == INFINITE) {
+	} else if(assoc->max_submit_jobs == INFINITE) {
 		xstrcat(*cols, ", max_submit_jobs");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_submit_jobs=NULL");
 	}
 
-	if((int)assoc->max_wall_pj >= 0) {
+	if((int32_t)assoc->max_wall_pj >= 0) {
 		xstrcat(*cols, ", max_wall_pj");
 		xstrfmtcat(*vals, ", %u", assoc->max_wall_pj);
 		xstrfmtcat(*extra, ", max_wall_pj=%u",
 			   assoc->max_wall_pj);
-	} else if((int)assoc->max_wall_pj == INFINITE) {
+	} else if(assoc->max_wall_pj == INFINITE) {
 		xstrcat(*cols, ", max_wall_pj");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_wall_pj=NULL");
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_qos.c b/src/plugins/accounting_storage/mysql/as_mysql_qos.c
index a68508683d964bd9e2521db4ae72572e2b22d30f..e201be0da11b80f5ba54173334d3d5882709a768 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_qos.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_qos.c
@@ -90,153 +90,153 @@ static int _setup_qos_limits(slurmdb_qos_rec_t *qos,
 			   qos->description);
 	}
 
-	if((int)qos->grp_cpu_mins >= 0) {
+	if((int64_t)qos->grp_cpu_mins >= 0) {
 		xstrcat(*cols, ", grp_cpu_mins");
 		xstrfmtcat(*vals, ", %llu", qos->grp_cpu_mins);
 		xstrfmtcat(*extra, ", grp_cpu_mins=%llu",
 			   qos->grp_cpu_mins);
-	} else if((int)qos->grp_cpu_mins == INFINITE) {
+	} else if(qos->grp_cpu_mins == (uint64_t)INFINITE) {
 		xstrcat(*cols, ", grp_cpu_mins");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_cpu_mins=NULL");
 	}
 
-	if((int)qos->grp_cpu_run_mins >= 0) {
+	if((int64_t)qos->grp_cpu_run_mins >= 0) {
 		xstrcat(*cols, ", grp_cpu_run_mins");
 		xstrfmtcat(*vals, ", %llu", qos->grp_cpu_run_mins);
 		xstrfmtcat(*extra, ", grp_cpu_run_mins=%llu",
 			   qos->grp_cpu_run_mins);
-	} else if((int)qos->grp_cpu_run_mins == INFINITE) {
+	} else if(qos->grp_cpu_run_mins == (uint64_t)INFINITE) {
 		xstrcat(*cols, ", grp_cpu_run_mins");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_cpu_run_mins=NULL");
 	}
 
-	if((int)qos->grp_cpus >= 0) {
+	if((int32_t)qos->grp_cpus >= 0) {
 		xstrcat(*cols, ", grp_cpus");
 		xstrfmtcat(*vals, ", %u", qos->grp_cpus);
 		xstrfmtcat(*extra, ", grp_cpus=%u", qos->grp_cpus);
-	} else if((int)qos->grp_cpus == INFINITE) {
+	} else if(qos->grp_cpus == INFINITE) {
 		xstrcat(*cols, ", grp_cpus");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_cpus=NULL");
 	}
 
-	if((int)qos->grp_jobs >= 0) {
+	if((int32_t)qos->grp_jobs >= 0) {
 		xstrcat(*cols, ", grp_jobs");
 		xstrfmtcat(*vals, ", %u", qos->grp_jobs);
 		xstrfmtcat(*extra, ", grp_jobs=%u", qos->grp_jobs);
-	} else if((int)qos->grp_jobs == INFINITE) {
+	} else if(qos->grp_jobs == INFINITE) {
 		xstrcat(*cols, ", grp_jobs");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_jobs=NULL");
 	}
 
-	if((int)qos->grp_nodes >= 0) {
+	if((int32_t)qos->grp_nodes >= 0) {
 		xstrcat(*cols, ", grp_nodes");
 		xstrfmtcat(*vals, ", %u", qos->grp_nodes);
 		xstrfmtcat(*extra, ", grp_nodes=%u", qos->grp_nodes);
-	} else if((int)qos->grp_nodes == INFINITE) {
+	} else if(qos->grp_nodes == INFINITE) {
 		xstrcat(*cols, ", grp_nodes");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_nodes=NULL");
 	}
 
-	if((int)qos->grp_submit_jobs >= 0) {
+	if((int32_t)qos->grp_submit_jobs >= 0) {
 		xstrcat(*cols, ", grp_submit_jobs");
 		xstrfmtcat(*vals, ", %u",
 			   qos->grp_submit_jobs);
 		xstrfmtcat(*extra, ", grp_submit_jobs=%u",
 			   qos->grp_submit_jobs);
-	} else if((int)qos->grp_submit_jobs == INFINITE) {
+	} else if(qos->grp_submit_jobs == INFINITE) {
 		xstrcat(*cols, ", grp_submit_jobs");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_submit_jobs=NULL");
 	}
 
-	if((int)qos->grp_wall >= 0) {
+	if((int32_t)qos->grp_wall >= 0) {
 		xstrcat(*cols, ", grp_wall");
 		xstrfmtcat(*vals, ", %u", qos->grp_wall);
 		xstrfmtcat(*extra, ", grp_wall=%u",
 			   qos->grp_wall);
-	} else if((int)qos->grp_wall == INFINITE) {
+	} else if(qos->grp_wall == INFINITE) {
 		xstrcat(*cols, ", grp_wall");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", grp_wall=NULL");
 	}
 
-	if((int)qos->max_cpu_mins_pj >= 0) {
+	if((int64_t)qos->max_cpu_mins_pj >= 0) {
 		xstrcat(*cols, ", max_cpu_mins_per_job");
 		xstrfmtcat(*vals, ", %llu", qos->max_cpu_mins_pj);
 		xstrfmtcat(*extra, ", max_cpu_mins_per_job=%u",
 			   qos->max_cpu_mins_pj);
-	} else if((int)qos->max_cpu_mins_pj == INFINITE) {
+	} else if(qos->max_cpu_mins_pj == (uint64_t)INFINITE) {
 		xstrcat(*cols, ", max_cpu_mins_per_job");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_cpu_mins_per_job=NULL");
 	}
 
-	if((int)qos->max_cpu_run_mins_pu >= 0) {
+	if((int64_t)qos->max_cpu_run_mins_pu >= 0) {
 		xstrcat(*cols, ", max_cpu_run_mins_per_user");
 		xstrfmtcat(*vals, ", %llu", qos->max_cpu_run_mins_pu);
 		xstrfmtcat(*extra, ", max_cpu_run_mins_per_user=%u",
 			   qos->max_cpu_run_mins_pu);
-	} else if((int)qos->max_cpu_run_mins_pu == INFINITE) {
+	} else if(qos->max_cpu_run_mins_pu == (uint64_t)INFINITE) {
 		xstrcat(*cols, ", max_cpu_run_mins_per_user");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_cpu_run_mins_per_user=NULL");
 	}
 
-	if((int)qos->max_cpus_pj >= 0) {
+	if((int32_t)qos->max_cpus_pj >= 0) {
 		xstrcat(*cols, ", max_cpus_per_job");
 		xstrfmtcat(*vals, ", %u", qos->max_cpus_pj);
 		xstrfmtcat(*extra, ", max_cpus_per_job=%u",
 			   qos->max_cpus_pj);
-	} else if((int)qos->max_cpus_pj == INFINITE) {
+	} else if(qos->max_cpus_pj == INFINITE) {
 		xstrcat(*cols, ", max_cpus_per_job");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_cpus_per_job=NULL");
 	}
 
-	if((int)qos->max_jobs_pu >= 0) {
+	if((int32_t)qos->max_jobs_pu >= 0) {
 		xstrcat(*cols, ", max_jobs_per_user");
 		xstrfmtcat(*vals, ", %u", qos->max_jobs_pu);
 		xstrfmtcat(*extra, ", max_jobs_per_user=%u",
 			   qos->max_jobs_pu);
-	} else if((int)qos->max_jobs_pu == INFINITE) {
+	} else if(qos->max_jobs_pu == INFINITE) {
 		xstrcat(*cols, ", max_jobs_per_user");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_jobs_per_user=NULL");
 	}
 
-	if((int)qos->max_nodes_pj >= 0) {
+	if((int32_t)qos->max_nodes_pj >= 0) {
 		xstrcat(*cols, ", max_nodes_per_job");
 		xstrfmtcat(*vals, ", %u", qos->max_nodes_pj);
 		xstrfmtcat(*extra, ", max_nodes_per_job=%u",
 			   qos->max_nodes_pj);
-	} else if((int)qos->max_nodes_pj == INFINITE) {
+	} else if(qos->max_nodes_pj == INFINITE) {
 		xstrcat(*cols, ", max_nodes_per_job");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_nodes_per_job=NULL");
 	}
 
-	if((int)qos->max_submit_jobs_pu >= 0) {
+	if((int32_t)qos->max_submit_jobs_pu >= 0) {
 		xstrcat(*cols, ", max_submit_jobs_per_user");
 		xstrfmtcat(*vals, ", %u", qos->max_submit_jobs_pu);
 		xstrfmtcat(*extra, ", max_submit_jobs_per_user=%u",
 			   qos->max_submit_jobs_pu);
-	} else if((int)qos->max_submit_jobs_pu == INFINITE) {
+	} else if(qos->max_submit_jobs_pu == INFINITE) {
 		xstrcat(*cols, ", max_submit_jobs_per_user");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_submit_jobs_per_user=NULL");
 	}
 
-	if((int)qos->max_wall_pj >= 0) {
+	if((int32_t)qos->max_wall_pj >= 0) {
 		xstrcat(*cols, ", max_wall_duration_per_job");
 		xstrfmtcat(*vals, ", %u", qos->max_wall_pj);
 		xstrfmtcat(*extra, ", max_wall_duration_per_job=%u",
 			   qos->max_wall_pj);
-	} else if((int)qos->max_wall_pj == INFINITE) {
+	} else if(qos->max_wall_pj == INFINITE) {
 		xstrcat(*cols, ", max_wall_duration_per_job");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", max_wall_duration_per_job=NULL");
@@ -292,21 +292,21 @@ static int _setup_qos_limits(slurmdb_qos_rec_t *qos,
 		xstrfmtcat(*extra, ", preempt_mode=%u", qos->preempt_mode);
 	}
 
-	if((int)qos->priority >= 0) {
+	if((int32_t)qos->priority >= 0) {
 		xstrcat(*cols, ", priority");
 		xstrfmtcat(*vals, ", %u", qos->priority);
 		xstrfmtcat(*extra, ", priority=%u", qos->priority);
-	} else if ((int)qos->priority == INFINITE) {
+	} else if (qos->priority == INFINITE) {
 		xstrcat(*cols, ", priority");
 		xstrcat(*vals, ", NULL");
 		xstrcat(*extra, ", priority=NULL");
 	}
 
-	if((int)qos->usage_factor >= 0) {
+	if((int32_t)qos->usage_factor >= 0) {
 		xstrcat(*cols, ", usage_factor");
 		xstrfmtcat(*vals, ", %f", qos->usage_factor);
 		xstrfmtcat(*extra, ", usage_factor=%f", qos->usage_factor);
-	} else if((int)qos->usage_factor == INFINITE) {
+	} else if(qos->usage_factor == INFINITE) {
 		xstrcat(*cols, ", usage_factor");
 		xstrcat(*vals, ", 1");
 		xstrcat(*extra, ", usage_factor=1");