do { \
unsigned int _val = val; \
assert ((unsigned int) done < (unsigned int) INT_MAX); \
- if (__builtin_expect (INT_MAX - done < _val, 0)) \
+ if (__glibc_unlikely (INT_MAX - done < _val)) \
{ \
done = -1; \
__set_errno (EOVERFLOW); \
if (width > 0) \
{ \
unsigned int d = _IO_padn (s, (Padchar), width); \
- if (__builtin_expect (d == EOF, 0)) \
+ if (__glibc_unlikely (d == EOF)) \
{ \
done = -1; \
goto all_done; \
if (width > 0) \
{ \
unsigned int d = _IO_wpadn (s, (Padchar), width); \
- if (__builtin_expect (d == EOF, 0)) \
+ if (__glibc_unlikely (d == EOF)) \
{ \
done = -1; \
goto all_done; \
done = -1; \
goto all_done; \
} \
- if (__builtin_expect (INT_MAX - done < (Len), 0)) \
+ if (__glibc_unlikely (INT_MAX - done < (Len))) \
{ \
done = -1; \
__set_errno (EOVERFLOW); \
outstring (string, len); \
if (left) \
PAD (L' '); \
- if (__builtin_expect (string_malloced, 0)) \
+ if (__glibc_unlikely (string_malloced)) \
free (string); \
} \
break;
outstring (string, len); \
if (left) \
PAD (' '); \
- if (__builtin_expect (string_malloced, 0)) \
+ if (__glibc_unlikely (string_malloced)) \
free (string); \
} \
break;
goto all_done;
/* Use the slow path in case any printf handler is registered. */
- if (__builtin_expect (__printf_function_table != NULL
+ if (__glibc_unlikely (__printf_function_table != NULL
|| __printf_modifier_table != NULL
- || __printf_va_arg_table != NULL, 0))
+ || __printf_va_arg_table != NULL))
goto do_positional;
/* Process whole format string. */
left = 1;
}
- if (__builtin_expect (width >= INT_MAX / sizeof (CHAR_T) - 32, 0))
+ if (__glibc_unlikely (width >= INT_MAX / sizeof (CHAR_T) - 32))
{
__set_errno (EOVERFLOW);
done = -1;
LABEL (width):
width = read_int (&f);
- if (__builtin_expect (width == -1
- || width >= INT_MAX / sizeof (CHAR_T) - 32, 0))
+ if (__glibc_unlikely (width == -1
+ || width >= INT_MAX / sizeof (CHAR_T) - 32))
{
__set_errno (EOVERFLOW);
done = -1;
if (prec > width
&& prec > sizeof (work_buffer) / sizeof (work_buffer[0]) - 32)
{
- if (__builtin_expect (prec >= INT_MAX / sizeof (CHAR_T) - 32, 0))
+ if (__glibc_unlikely (prec >= INT_MAX / sizeof (CHAR_T) - 32))
{
__set_errno (EOVERFLOW);
done = -1;
/* The format is correctly handled. */
++nspecs_done;
- if (__builtin_expect (workstart != NULL, 0))
+ if (__glibc_unlikely (workstart != NULL))
free (workstart);
workstart = NULL;
/* Just a counter. */
size_t cnt;
- if (__builtin_expect (workstart != NULL, 0))
+ if (__glibc_unlikely (workstart != NULL))
free (workstart);
workstart = NULL;
+ sizeof (*args_type));
/* Check for potential integer overflow. */
- if (__builtin_expect (nargs > INT_MAX / bytes_per_arg, 0))
+ if (__glibc_unlikely (nargs > INT_MAX / bytes_per_arg))
{
__set_errno (EOVERFLOW);
done = -1;
default:
if ((args_type[cnt] & PA_FLAG_PTR) != 0)
args_value[cnt].pa_pointer = va_arg (ap_save, void *);
- else if (__builtin_expect (__printf_va_arg_table != NULL, 0)
+ else if (__glibc_unlikely (__printf_va_arg_table != NULL)
&& __printf_va_arg_table[args_type[cnt] - PA_LAST] != NULL)
{
args_value[cnt].pa_user = alloca (args_size[cnt]);
break;
}
- if (__builtin_expect (workstart != NULL, 0))
+ if (__glibc_unlikely (workstart != NULL))
free (workstart);
workstart = NULL;
}
all_done:
- if (__builtin_expect (args_malloced != NULL, 0))
+ if (__glibc_unlikely (args_malloced != NULL))
free (args_malloced);
- if (__builtin_expect (workstart != NULL, 0))
+ if (__glibc_unlikely (workstart != NULL))
free (workstart);
/* Unlock the stream. */
_IO_funlockfile (s);