aboutsummaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-10-16 23:25:46 +0000
committerUlrich Drepper <drepper@redhat.com>2007-10-16 23:25:46 +0000
commit6a649d25bb4eac00000781221310b7c9e547b503 (patch)
treece7f4589969bab7eddd9ba57522e11d7b09e0ad5 /time
parent800d6f9ee878373efac8d7063f1231be4b054225 (diff)
downloadglibc-6a649d25bb4eac00000781221310b7c9e547b503.zip
glibc-6a649d25bb4eac00000781221310b7c9e547b503.tar.gz
glibc-6a649d25bb4eac00000781221310b7c9e547b503.tar.bz2
Help the compiler recognize unreachable code on 32-bit machines.
2007-10-16 Ulrich Drepper <drepper@redhat.com> * time/tzfile.c (__tzfile_read): Help the compiler recognize unreachable code on 32-bit machines.
Diffstat (limited to 'time')
-rw-r--r--time/tzfile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/time/tzfile.c b/time/tzfile.c
index 925f95f..6a8bf89 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -243,7 +243,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
& ~(__alignof__ (struct leap) - 1));
leaps_idx = total_size;
total_size += num_leaps * sizeof (struct leap);
- tzspec_len = (trans_width == 8
+ tzspec_len = (sizeof (time_t) == 8 && trans_width == 8
? st.st_size - (ftello (f)
+ num_transitions * (8 + 1)
+ num_types * 6
@@ -263,14 +263,14 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
types = (struct ttinfo *) ((char *) transitions + types_idx);
zone_names = (char *) types + num_types * sizeof (struct ttinfo);
leaps = (struct leap *) ((char *) transitions + leaps_idx);
- if (trans_width == 8)
+ if (sizeof (time_t) == 8 && trans_width == 8)
tzspec = (char *) leaps + num_leaps * sizeof (struct leap) + extra;
else
tzspec = NULL;
if (extra > 0)
*extrap = (char *) &leaps[num_leaps];
- if (sizeof (time_t) == 4 || trans_width == 8)
+ if (sizeof (time_t) == 4 || __builtin_expect (trans_width == 8, 1))
{
if (__builtin_expect (fread_unlocked (transitions, trans_width + 1,
num_transitions, f)