Skip to content

Commit ea2fb9f

Browse files
Fix compilation warnings from Solaris Developer Studio
This lets us build on solaris without disabling -Werror * Switches from `UL` to `ULL` for very large constants in sds.c * Removes `break` statements when they immediately follow an unconditional goto. Signed-off-by: michael-grunder <michael.grunder@gmail.com>
1 parent 3819107 commit ea2fb9f

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/cluster.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,8 +1979,6 @@ static void *valkey_cluster_command_execute(valkeyClusterContext *cc,
19791979
}
19801980

19811981
goto moved_retry;
1982-
1983-
break;
19841982
case CLUSTER_ERR_ASK:
19851983
node = getNodeFromRedirectReply(cc, c, reply, NULL);
19861984
if (node == NULL) {
@@ -2008,15 +2006,12 @@ static void *valkey_cluster_command_execute(valkeyClusterContext *cc,
20082006
reply = NULL;
20092007

20102008
goto ask_retry;
2011-
2012-
break;
20132009
case CLUSTER_ERR_TRYAGAIN:
20142010
case CLUSTER_ERR_CLUSTERDOWN:
20152011
freeReplyObject(reply);
20162012
reply = NULL;
20172013
goto retry;
20182014

2019-
break;
20202015
default:
20212016

20222017
break;
@@ -3045,7 +3040,6 @@ static void valkeyClusterAsyncCallback(valkeyAsyncContext *ac, void *r,
30453040
default:
30463041

30473042
goto done;
3048-
break;
30493043
}
30503044

30513045
goto retry;

src/sds.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ static uint32_t digits10(uint64_t v) {
453453
return 2;
454454
if (v < 1000)
455455
return 3;
456-
if (v < 1000000000000UL) {
456+
if (v < 1000000000000ULL) {
457457
if (v < 100000000UL) {
458458
if (v < 1000000) {
459459
if (v < 10000)
@@ -462,12 +462,12 @@ static uint32_t digits10(uint64_t v) {
462462
}
463463
return 7 + (v >= 10000000UL);
464464
}
465-
if (v < 10000000000UL) {
465+
if (v < 10000000000ULL) {
466466
return 9 + (v >= 1000000000UL);
467467
}
468-
return 11 + (v >= 100000000000UL);
468+
return 11 + (v >= 100000000000ULL);
469469
}
470-
return 12 + digits10(v / 1000000000000UL);
470+
return 12 + digits10(v / 1000000000000ULL);
471471
}
472472

473473
/* Convert a unsigned long long into a string. Returns the number of

0 commit comments

Comments
 (0)