From fe55692cb3180b06967d45849664cc6a483756ea Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Wed, 22 Jun 2016 01:46:06 +0000 Subject: [PATCH] c-common.c (get_source_date_epoch): Use int64_t instead of long long. * c-common.c (get_source_date_epoch): Use int64_t instead of long long. * gcov-tool.c (profile_rewrite): Use int64_t instead of long long. (do_rewrite): likewise. * line-map.c (location_adhoc_data_update): Use int64_t instead of long long. (get_combined_adhoc_loc): Likewise. From-SVN: r237676 --- gcc/ChangeLog | 5 +++++ gcc/c-family/ChangeLog | 4 ++++ gcc/c-family/c-common.c | 6 +++++- gcc/gcov-tool.c | 14 ++++---------- libcpp/ChangeLog | 6 ++++++ libcpp/line-map.c | 4 ++-- 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7f37bf5dbe6..614c22ae8d7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-06-21 John David Anglin + + * gcov-tool.c (profile_rewrite): Use int64_t instead of long long. + (do_rewrite): likewise. + 2016-06-21 Trevor Saunders * common/config/mep/mep-common.c: Remove. diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 08302e1c5bd..7d2ca462223 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2016-06-21 John David Anglin + + * c-common.c (get_source_date_epoch): Use int64_t instead of long long. + 2016-06-14 Jason Merrill P0145R2: Refining Expression Order for C++. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 85f3a03146e..8f21fd1ad98 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -12811,7 +12811,7 @@ time_t cb_get_source_date_epoch (cpp_reader *pfile ATTRIBUTE_UNUSED) { char *source_date_epoch; - long long epoch; + int64_t epoch; char *endptr; source_date_epoch = getenv ("SOURCE_DATE_EPOCH"); @@ -12819,7 +12819,11 @@ cb_get_source_date_epoch (cpp_reader *pfile ATTRIBUTE_UNUSED) return (time_t) -1; errno = 0; +#if defined(INT64_T_IS_LONG) + epoch = strtol (source_date_epoch, &endptr, 10); +#else epoch = strtoll (source_date_epoch, &endptr, 10); +#endif if (errno != 0 || endptr == source_date_epoch || *endptr != '\0' || epoch < 0 || epoch > MAX_SOURCE_DATE_EPOCH) { diff --git a/gcc/gcov-tool.c b/gcc/gcov-tool.c index f628b603a80..f3da73cc596 100644 --- a/gcc/gcov-tool.c +++ b/gcc/gcov-tool.c @@ -232,7 +232,7 @@ do_merge (int argc, char **argv) Otherwise, multiply the all counters by SCALE. */ static int -profile_rewrite (const char *d1, const char *out, long long n_val, +profile_rewrite (const char *d1, const char *out, int64_t n_val, float scale, int n, int d) { struct gcov_info * d1_profile; @@ -261,7 +261,7 @@ print_rewrite_usage_message (int error_p) fnotice (file, " -v, --verbose Verbose mode\n"); fnotice (file, " -o, --output Output directory\n"); fnotice (file, " -s, --scale Scale the profile counters\n"); - fnotice (file, " -n, --normalize Normalize the profile\n"); + fnotice (file, " -n, --normalize Normalize the profile\n"); } static const struct option rewrite_options[] = @@ -291,11 +291,7 @@ do_rewrite (int argc, char **argv) int opt; int ret; const char *output_dir = 0; -#ifdef HAVE_LONG_LONG - long long normalize_val = 0; -#else int64_t normalize_val = 0; -#endif float scale = 0.0; int numerator = 1; int denominator = 1; @@ -315,12 +311,10 @@ do_rewrite (int argc, char **argv) break; case 'n': if (!do_scaling) -#if defined(HAVE_LONG_LONG) - normalize_val = strtoll (optarg, (char **)NULL, 10); -#elif defined(INT64_T_IS_LONG) +#if defined(INT64_T_IS_LONG) normalize_val = strtol (optarg, (char **)NULL, 10); #else - sscanf (optarg, "%" SCNd64, &normalize_val); + normalize_val = strtoll (optarg, (char **)NULL, 10); #endif else fnotice (stderr, "scaling cannot co-exist with normalization," diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 5d18c0a3ea3..c32b15725f8 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,9 @@ +2016-06-21 John David Anglin + + * line-map.c (location_adhoc_data_update): Use int64_t instead of + long long. + (get_combined_adhoc_loc): Likewise. + 2016-06-01 Eduard Sanou * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch diff --git a/libcpp/line-map.c b/libcpp/line-map.c index 2e61895bb35..8dea0d381c5 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -102,7 +102,7 @@ location_adhoc_data_eq (const void *l1, const void *l2) static int location_adhoc_data_update (void **slot, void *data) { - *((char **) slot) += *((long long *) data); + *((char **) slot) += *((int64_t *) data); return 1; } @@ -224,7 +224,7 @@ get_combined_adhoc_loc (struct line_maps *set, set->location_adhoc_data_map.allocated) { char *orig_data = (char *) set->location_adhoc_data_map.data; - long long offset; + int64_t offset; /* Cast away extern "C" from the type of xrealloc. */ line_map_realloc reallocator = (set->reallocator ? set->reallocator -- 2.30.2