Skip to content

Commit 083b452

Browse files
authored
Merge pull request #3803 from BsAtHome/fix_cms-int64
Replace non-functional 64-bit long int CMS updaters with int64 types
2 parents f69c1da + b87d3ce commit 083b452

9 files changed

Lines changed: 312 additions & 291 deletions

File tree

src/libnml/cms/cms.cc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ CMS_STATUS CMS::update(bool &x)
12921292
}
12931293
}
12941294

1295-
CMS_STATUS CMS::update(char &x)
1295+
CMS_STATUS CMS::update(int8_t &x)
12961296
{
12971297
if (NULL != updater) {
12981298
return (updater->update(x));
@@ -1301,7 +1301,7 @@ CMS_STATUS CMS::update(char &x)
13011301
}
13021302
}
13031303

1304-
CMS_STATUS CMS::update(unsigned char &x)
1304+
CMS_STATUS CMS::update(uint8_t &x)
13051305
{
13061306
if (NULL != updater) {
13071307
return (updater->update(x));
@@ -1310,7 +1310,7 @@ CMS_STATUS CMS::update(unsigned char &x)
13101310
}
13111311
}
13121312

1313-
CMS_STATUS CMS::update(short int &x)
1313+
CMS_STATUS CMS::update(int16_t &x)
13141314
{
13151315
if (NULL != updater) {
13161316
return (updater->update(x));
@@ -1319,7 +1319,7 @@ CMS_STATUS CMS::update(short int &x)
13191319
}
13201320
}
13211321

1322-
CMS_STATUS CMS::update(unsigned short int &x)
1322+
CMS_STATUS CMS::update(uint16_t &x)
13231323
{
13241324
if (NULL != updater) {
13251325
return (updater->update(x));
@@ -1328,7 +1328,7 @@ CMS_STATUS CMS::update(unsigned short int &x)
13281328
}
13291329
}
13301330

1331-
CMS_STATUS CMS::update(int &x)
1331+
CMS_STATUS CMS::update(int32_t &x)
13321332
{
13331333
if (NULL != updater) {
13341334
return (updater->update(x));
@@ -1337,7 +1337,7 @@ CMS_STATUS CMS::update(int &x)
13371337
}
13381338
}
13391339

1340-
CMS_STATUS CMS::update(unsigned int &x)
1340+
CMS_STATUS CMS::update(uint32_t &x)
13411341
{
13421342
if (NULL != updater) {
13431343
return (updater->update(x));
@@ -1346,7 +1346,7 @@ CMS_STATUS CMS::update(unsigned int &x)
13461346
}
13471347
}
13481348

1349-
CMS_STATUS CMS::update(long int &x)
1349+
CMS_STATUS CMS::update(int64_t &x)
13501350
{
13511351
if (NULL != updater) {
13521352
return (updater->update(x));
@@ -1355,7 +1355,7 @@ CMS_STATUS CMS::update(long int &x)
13551355
}
13561356
}
13571357

1358-
CMS_STATUS CMS::update(unsigned long int &x)
1358+
CMS_STATUS CMS::update(uint64_t &x)
13591359
{
13601360
if (NULL != updater) {
13611361
return (updater->update(x));
@@ -1391,7 +1391,7 @@ CMS_STATUS CMS::update(long double &x)
13911391
}
13921392
}
13931393

1394-
CMS_STATUS CMS::update(char *x, unsigned int len)
1394+
CMS_STATUS CMS::update(int8_t *x, unsigned int len)
13951395
{
13961396
if (NULL != updater) {
13971397
return (updater->update(x, len));
@@ -1400,7 +1400,7 @@ CMS_STATUS CMS::update(char *x, unsigned int len)
14001400
}
14011401
}
14021402

1403-
CMS_STATUS CMS::update(unsigned char *x, unsigned int len)
1403+
CMS_STATUS CMS::update(uint8_t *x, unsigned int len)
14041404
{
14051405
if (NULL != updater) {
14061406
return (updater->update(x, len));
@@ -1409,7 +1409,7 @@ CMS_STATUS CMS::update(unsigned char *x, unsigned int len)
14091409
}
14101410
}
14111411

1412-
CMS_STATUS CMS::update(short *x, unsigned int len)
1412+
CMS_STATUS CMS::update(int16_t *x, unsigned int len)
14131413
{
14141414
if (NULL != updater) {
14151415
return (updater->update(x, len));
@@ -1418,7 +1418,7 @@ CMS_STATUS CMS::update(short *x, unsigned int len)
14181418
}
14191419
}
14201420

1421-
CMS_STATUS CMS::update(unsigned short *x, unsigned int len)
1421+
CMS_STATUS CMS::update(uint16_t *x, unsigned int len)
14221422
{
14231423
if (NULL != updater) {
14241424
return (updater->update(x, len));
@@ -1427,7 +1427,7 @@ CMS_STATUS CMS::update(unsigned short *x, unsigned int len)
14271427
}
14281428
}
14291429

1430-
CMS_STATUS CMS::update(int *x, unsigned int len)
1430+
CMS_STATUS CMS::update(int32_t *x, unsigned int len)
14311431
{
14321432
if (NULL != updater) {
14331433
return (updater->update(x, len));
@@ -1436,7 +1436,7 @@ CMS_STATUS CMS::update(int *x, unsigned int len)
14361436
}
14371437
}
14381438

1439-
CMS_STATUS CMS::update(unsigned int *x, unsigned int len)
1439+
CMS_STATUS CMS::update(uint32_t *x, unsigned int len)
14401440
{
14411441
if (NULL != updater) {
14421442
return (updater->update(x, len));
@@ -1445,7 +1445,7 @@ CMS_STATUS CMS::update(unsigned int *x, unsigned int len)
14451445
}
14461446
}
14471447

1448-
CMS_STATUS CMS::update(long *x, unsigned int len)
1448+
CMS_STATUS CMS::update(int64_t *x, unsigned int len)
14491449
{
14501450
if (NULL != updater) {
14511451
return (updater->update(x, len));
@@ -1454,7 +1454,7 @@ CMS_STATUS CMS::update(long *x, unsigned int len)
14541454
}
14551455
}
14561456

1457-
CMS_STATUS CMS::update(unsigned long *x, unsigned int len)
1457+
CMS_STATUS CMS::update(uint64_t *x, unsigned int len)
14581458
{
14591459
if (NULL != updater) {
14601460
return (updater->update(x, len));

src/libnml/cms/cms.hh

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#ifndef CMS_HH
1717
#define CMS_HH
1818

19+
#include <stdint.h>
20+
1921
#ifdef __cplusplus
2022
extern "C" {
2123
#endif
@@ -263,27 +265,28 @@ class CMS {
263265
/***********************************************/
264266
/* Access functions for primitive C language data types */
265267
CMS_STATUS update(bool &x);
266-
CMS_STATUS update(char &x); /* Used by emc2 */
267-
CMS_STATUS update(unsigned char &x); /* Used by emc2 */
268-
CMS_STATUS update(short int &x);
269-
CMS_STATUS update(unsigned short int &x);
270-
CMS_STATUS update(int &x); /* Used by emc2 */
271-
CMS_STATUS update(unsigned int &x);
272-
CMS_STATUS update(long int &x); /* Used by emc2 */
273-
CMS_STATUS update(unsigned long int &x); /* Used by emc2 */
268+
CMS_STATUS update(int8_t &x);
269+
CMS_STATUS update(uint8_t &x);
270+
CMS_STATUS update(int16_t &x);
271+
CMS_STATUS update(uint16_t &x);
272+
CMS_STATUS update(int32_t &x);
273+
CMS_STATUS update(uint32_t &x);
274+
CMS_STATUS update(int64_t &x);
275+
CMS_STATUS update(uint64_t &x);
274276
CMS_STATUS update(float &x);
275-
CMS_STATUS update(double &x); /* Used by emc2 */
277+
CMS_STATUS update(double &x);
276278
CMS_STATUS update(long double &x);
277-
CMS_STATUS update(char *x, unsigned int len); /* Used by emc2 */
278-
CMS_STATUS update(unsigned char *x, unsigned int len); /* Used by emc2 */
279-
CMS_STATUS update(short *x, unsigned int len);
280-
CMS_STATUS update(unsigned short *x, unsigned int len);
281-
CMS_STATUS update(int *x, unsigned int len); /* Used by emc2 */
282-
CMS_STATUS update(unsigned int *x, unsigned int len);
283-
CMS_STATUS update(long *x, unsigned int len);
284-
CMS_STATUS update(unsigned long *x, unsigned int len);
279+
CMS_STATUS update(char *x, unsigned int len) { return update(reinterpret_cast<int8_t *>(x), len); };
280+
CMS_STATUS update(int8_t *x, unsigned int len);
281+
CMS_STATUS update(uint8_t *x, unsigned int len);
282+
CMS_STATUS update(int16_t *x, unsigned int len);
283+
CMS_STATUS update(uint16_t *x, unsigned int len);
284+
CMS_STATUS update(int32_t *x, unsigned int len);
285+
CMS_STATUS update(uint32_t *x, unsigned int len);
286+
CMS_STATUS update(int64_t *x, unsigned int len);
287+
CMS_STATUS update(uint64_t *x, unsigned int len);
285288
CMS_STATUS update(float *x, unsigned int len);
286-
CMS_STATUS update(double *x, unsigned int len); /* Used by emc2 */
289+
CMS_STATUS update(double *x, unsigned int len);
287290
CMS_STATUS update(long double *x, unsigned int len);
288291

289292
/*************************************************************************

0 commit comments

Comments
 (0)