summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b5f387a)
TW_SZONE is a mask of one bit that can either be 0, TW_SZNIL, or set,
TW_SZEXP. Rather than three macros for the single bit, have one,
TW_SZEXP. Simplifies the test too when the mask is known to be one-bit
wide.
#define TW_SEXP 0x0001 /* explicitly given */
#define TW_SIMP 0x0002 /* implicitly given */
#define TW_SEXP 0x0001 /* explicitly given */
#define TW_SIMP 0x0002 /* implicitly given */
-#define TW_SZONE 0x0004 /* how timezone was determined */
-#define TW_SZNIL 0x0000 /* not given */
-#define TW_SZEXP 0x0004 /* explicitly given */
+#define TW_SZEXP 0x0004 /* Explicit timezone. */
#define TW_DST 0x0010 /* daylight savings time */
#define TW_ZONE 0x0020 /* use numeric timezones only */
#define TW_DST 0x0010 /* daylight savings time */
#define TW_ZONE 0x0020 /* use numeric timezones only */
tw.tw_flags &= ~TW_SDAY;
tw.tw_flags |= TW_SEXP;
tw.tw_flags &= ~TW_SDAY;
tw.tw_flags |= TW_SEXP;
- tw.tw_flags &= ~TW_SZONE;
tw.tw_flags |= TW_SZEXP;
tw.tw_clock = *clock;
tw.tw_flags |= TW_SZEXP;
tw.tw_clock = *clock;
tw.tw_flags &= ~TW_SDAY;
tw.tw_flags |= TW_SEXP;
tw.tw_flags &= ~TW_SDAY;
tw.tw_flags |= TW_SEXP;
- tw.tw_flags &= ~TW_SZONE;
tw.tw_flags |= TW_SZEXP;
tw.tw_clock = *clock;
tw.tw_flags |= TW_SZEXP;
tw.tw_clock = *clock;
return NULL;
/* Display timezone if known */
return NULL;
/* Display timezone if known */
- if ((tw->tw_flags & TW_SZONE) == TW_SZNIL)
- result[0] = '\0';
- else
+ if (tw->tw_flags & TW_SZEXP)
snprintf(result, sizeof(result), " %s", dtimezone(tw->tw_zone, tw->tw_flags | flags));
snprintf(result, sizeof(result), " %s", dtimezone(tw->tw_zone, tw->tw_flags | flags));
+ else
+ result[0] = '\0';
snprintf(buffer, sizeof(buffer), "%02d %s %0*d %02d:%02d:%02d%s",
tw->tw_mday, tw_moty[tw->tw_mon],
snprintf(buffer, sizeof(buffer), "%02d %s %0*d %02d:%02d:%02d%s",
tw->tw_mday, tw_moty[tw->tw_mon],
}
break;
case FT_LV_ZONEF:
}
break;
case FT_LV_ZONEF:
- if ((fmt->f_comp->c_tws->tw_flags & TW_SZONE) == TW_SZEXP)
+ if (fmt->f_comp->c_tws->tw_flags & TW_SZEXP)
value = 1;
else
value = -1;
value = 1;
else
value = -1;