const char *abbrev; /* dynamic abbrev */
} TmFromChar;
-#define ZERO_tmfc(_X) memset(_X, 0, sizeof(TmFromChar))
-
struct fmt_tz /* do_to_timestamp's timezone info output */
{
bool has_tz; /* was there any TZ/TZH/TZM field? */
int *fprec, uint32 *flags, Node *escontext)
{
FormatNode *format = NULL;
- TmFromChar tmfc;
+ TmFromChar tmfc = {0};
int fmt_len;
char *date_str;
int fmask;
date_str = text_to_cstring(date_txt);
- ZERO_tmfc(&tmfc);
ZERO_tm(tm);
*fsec = 0;
tz->has_tz = false;
return str;
}
-#define zeroize_NUM(_n) \
-do { \
- (_n)->flag = 0; \
- (_n)->lsign = 0; \
- (_n)->pre = 0; \
- (_n)->post = 0; \
- (_n)->pre_lsign_num = 0; \
- (_n)->need_locale = 0; \
- (_n)->multi = 0; \
- (_n)->zero_start = 0; \
- (_n)->zero_end = 0; \
-} while(0)
-
/* This works the same as DCH_prevent_counter_overflow */
static inline void
NUM_prevent_counter_overflow(void)
*/
ent = NUM_cache_getnew(str);
- zeroize_NUM(&ent->Num);
+ memset(&ent->Num, 0, sizeof ent->Num);
parse_format(ent->format, str, NUM_keywords,
NULL, NUM_index, NUM_FLAG, &ent->Num);
*shouldFree = true;
- zeroize_NUM(Num);
+ memset(Num, 0, sizeof *Num);
parse_format(format, str, NUM_keywords,
NULL, NUM_index, NUM_FLAG, Num);