case 'D':
return llvm::make_unique<PrintfArgChecker> (int32_arg_handler,
this->pcontext, this->ci);
- case 'B':
- return llvm::make_unique<PrintfArgChecker> (gboolean_arg_handler,
- this->pcontext, this->ci);
case 'T':
return llvm::make_unique<PrintfArgChecker> (tok_arg_handler,
this->pcontext, this->ci);
format_specs = {
's', 'd', 'l', 'L', 'v', 'V', 'f', 'F', 'g', 'G',
- 'T', 'z', 'D', 'c', 'p', 'P', 'e', 'B'
+ 'T', 'z', 'D', 'c', 'p', 'P', 'e'
};
};
return true;
}
- static bool
- gboolean_arg_handler (const Expr *arg, struct PrintfArgChecker *ctx)
- {
- return check_builtin_type (arg,
- ctx,
- {BuiltinType::Kind::Int}, // gboolean is int in fact
- "%b");
- }
-
static bool
check_struct_type (const Expr *arg, struct PrintfArgChecker *ctx,
const std::string &sname, const std::string &fmt)
break;
case UCL_BOOLEAN:
*target = rspamd_mempool_alloc (pool, num_str_len);
- rspamd_snprintf (*target, num_str_len, "%B", (gboolean)obj->value.iv);
+ rspamd_snprintf (*target, num_str_len, "%s",
+ ((gboolean)obj->value.iv) ? "true" : "false");
break;
default:
g_set_error (err,
break;
case UCL_BOOLEAN:
val = rspamd_mempool_alloc (pool, num_str_len);
- rspamd_snprintf (val, num_str_len, "%B", (gboolean)cur->value.iv);
+ rspamd_snprintf (val, num_str_len, "%s",
+ ((gboolean)cur->value.iv) ? "true" : "false");
break;
default:
g_set_error (err,
rspamd_ftok_t *tok;
GString *gs;
GError *err;
- gboolean bv;
while (*fmt) {
continue;
- case 'B':
- bv = (gboolean) va_arg (args, double);
- RSPAMD_PRINTF_APPEND (bv ? "true" : "false", bv ? 4 : 5);
-
- continue;
-
case 'p':
ui64 = (uintptr_t) va_arg (args, void *);
hex = 2;
* %[0][width][.width]F long double
* %[0][width][.width]g double
* %[0][width][.width]G long double
- * %B boolean (true or false)
* %P pid_t
* %r rlim_t
* %p void *
elt = ucl_object_lookup (doc_obj, "required");
if (elt) {
- rspamd_printf_fstring (&comment, " * Required: %B",
- ucl_object_toboolean (elt));
+ rspamd_printf_fstring (&comment, " * Required: %s",
+ ucl_object_toboolean (elt) ? "true" : "false");
cur_comment = ucl_object_fromstring_common (comment->str, comment->len, 0);
rspamd_fstring_erase (comment, 0, comment->len);
DL_APPEND (nobj, cur_comment);