Use GTM_Sequence type to hold value of a sequence on GTM
authorPavan Deolasee <[email protected]>
Wed, 6 Jul 2016 18:14:05 +0000 (23:44 +0530)
committerPavan Deolasee <[email protected]>
Wed, 6 Jul 2016 18:14:05 +0000 (23:44 +0530)
We were incorrectly using "int" at couple of places which is not wide enough to
store 64-bit sequence values.

Per report by Helmi Ahmad

src/gtm/main/gtm_seq.c

index 2fa6bf297ad22dd286cc99fadbdf1a8937dc26df..2b3868ec5e012a632e40e41708b37f726f9551e9 100644 (file)
@@ -851,7 +851,7 @@ GTM_SeqGetNext(GTM_SequenceKey seqkey, char *coord_name,
                        if (seqinfo->gs_max_value - seqinfo->gs_increment_by
                                        >= seqinfo->gs_value)
                        {
-                               int newval = seqinfo->gs_value + seqinfo->gs_increment_by;
+                               GTM_Sequence newval = seqinfo->gs_value + seqinfo->gs_increment_by;
                                *result = seqinfo->gs_value = newval;
                        }
                        else if (SEQ_IS_CYCLE(seqinfo))
@@ -879,7 +879,7 @@ GTM_SeqGetNext(GTM_SequenceKey seqkey, char *coord_name,
                        if (seqinfo->gs_min_value - seqinfo->gs_increment_by
                                        <= seqinfo->gs_value)
                        {
-                               int newval = seqinfo->gs_value + seqinfo->gs_increment_by;
+                               GTM_Sequence newval = seqinfo->gs_value + seqinfo->gs_increment_by;
                                *result = seqinfo->gs_value = newval;
                        }
                        else if (SEQ_IS_CYCLE(seqinfo))