Esempio n. 1
0
static void	ft_recasts(void *d, t_struct *details)
{
	if (details->mod == 'h' && (details->conv == 'd' || details->conv == 'i'))
		ft_conv_d((long long)(short)d, details);
	else if ((details->conv == 'd' || details->conv == 'i') && \
			details->mod == 'h' + 'h')
		ft_conv_d((long long)(char)d, details);
	else if (((details->conv == 'd' || details->conv == 'i') && \
			details->mod == 'l') || details->conv == 'D')
		ft_conv_d((long long)(long)d, details);
	else if ((details->conv == 'd' || details->conv == 'i') && \
			details->mod == 'l' + 'l')
		ft_conv_d((long long)d, details);
	else if ((details->conv == 'd' || details->conv == 'i') && \
			details->mod == 'j')
		ft_conv_d((long long)(intmax_t)d, details);
	else if ((details->conv == 'd' || details->conv == 'i') && \
			details->mod == 'z')
		ft_conv_d((long long)(ssize_t)d, details);
	else if ((details->conv == 'd' || details->conv == 'i') && \
			details->mod == 0)
		ft_conv_d((long long)(int)d, details);
	else if ((details->conv == 'u' && details->mod == 'l') || \
			details->conv == 'U')
		ft_conv_u((unsigned long long)(unsigned long)d, details);
}
Esempio n. 2
0
File: ft_tag.c Progetto: Draeyo/FdF
int		ft_tag(va_list ap, t_print *lst)
{
	int		j;

	j = 0;
	if (lst->conv == '%')
		j = ft_noconv(lst);
	else if (lst->conv == 's' || lst->conv == 'S')
		j = ft_conv_s(ap, lst);
	else if (lst->conv == 'd' || lst->conv == 'i' || lst->conv == 'D')
		j = ft_conv_d(ap, lst);
	else if (lst->conv == 'x' || lst->conv == 'X')
		j = ft_conv_x(ap, lst);
	else if (lst->conv == 'c' || lst->conv == 'C')
		j = ft_conv_c(ap, lst);
	else if (lst->conv == 'o' || lst->conv == 'O')
		j = ft_conv_o(ap, lst);
	else if (lst->conv == 'p')
		j = ft_conv_p(ap, lst);
	else if (lst->conv == 'u' || lst->conv == 'U')
		j = ft_conv_u(ap, lst);
	free_all(lst);
	return (j);
}