From 0c24502450e25298b6704dbe1b0a6d4005467c3c Mon Sep 17 00:00:00 2001 From: James Simmons Date: Sat, 6 Jul 2019 18:51:40 -0400 Subject: [PATCH] LU-12513 utils: change cy_valueint to 64 bits While testing the lustre YAML implementation with netlink I found that it didn't support 64 bit integer values. Change cy_valueint to a long long. Test-Parameter: trivial Change-Id: I1746a4907a83e7c5733a0681a66e7f4a54a4c392 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/35423 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain --- lnet/include/cyaml.h | 3 ++- lnet/utils/lnetconfig/cyaml.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lnet/include/cyaml.h b/lnet/include/cyaml.h index 1537dbd..c624f62 100644 --- a/lnet/include/cyaml.h +++ b/lnet/include/cyaml.h @@ -27,6 +27,7 @@ #ifndef CYAML_H #define CYAML_H +#include #include enum cYAML_object_type { @@ -51,7 +52,7 @@ struct cYAML { /* The item's string, if type==CYAML_TYPE_STRING */ char *cy_valuestring; /* The item's number, if type==CYAML_TYPE_NUMBER */ - int cy_valueint; + int64_t cy_valueint; /* The item's number, if type==CYAML_TYPE_NUMBER */ double cy_valuedouble; /* The item's name string, if this item is the child of, diff --git a/lnet/utils/lnetconfig/cyaml.c b/lnet/utils/lnetconfig/cyaml.c index 71b3f49..ae5205f 100644 --- a/lnet/utils/lnetconfig/cyaml.c +++ b/lnet/utils/lnetconfig/cyaml.c @@ -801,7 +801,7 @@ static inline void print_simple(FILE *f, struct cYAML *node, if (cpi->array_first_elem) fprintf(f, "%*s- ", INDENT * level, ""); - fprintf(f, "%*s""%s: %d\n", (cpi->array_first_elem) ? 0 : + fprintf(f, "%*s""%s: %" PRId64 "\n", (cpi->array_first_elem) ? 0 : INDENT * level + ind, "", node->cy_string, node->cy_valueint); } @@ -852,7 +852,7 @@ static void print_number(FILE *f, struct cYAML *node, if ((fabs(((double)node->cy_valueint) - d) <= DBL_EPSILON) && (d <= INT_MAX) && (d >= INT_MIN)) - fprintf(f, "%*s""%s: %d\n", (cpi->array_first_elem) ? 0 : + fprintf(f, "%*s""%s: %" PRId64 "\n", (cpi->array_first_elem) ? 0 : INDENT * level + ind, "", node->cy_string, node->cy_valueint); else { -- 1.8.3.1