static lzma_ret
alone_decode(lzma_coder *coder,
- lzma_allocator *allocator lzma_attribute((unused)),
+ lzma_allocator *allocator lzma_attribute((__unused__)),
const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size,
static lzma_ret
alone_encode(lzma_coder *coder,
- lzma_allocator *allocator lzma_attribute((unused)),
+ lzma_allocator *allocator lzma_attribute((__unused__)),
const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size,
static lzma_ret
block_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
- const lzma_filter *filters lzma_attribute((unused)),
+ const lzma_filter *filters lzma_attribute((__unused__)),
const lzma_filter *reversed_filters)
{
if (coder->sequence != SEQ_CODE)
// Memory allocation //
///////////////////////
-extern void * lzma_attribute((malloc))
+extern void * lzma_attribute((__malloc__)) lzma_attr_alloc_size(1)
lzma_alloc(size_t size, lzma_allocator *allocator)
{
// Some malloc() variants return NULL if called with size == 0.
/// Allocates memory
extern void *lzma_alloc(size_t size, lzma_allocator *allocator)
- lzma_attribute((malloc)) lzma_attr_alloc_size(1);
+ lzma_attribute((__malloc__)) lzma_attr_alloc_size(1);
/// Frees memory
extern void lzma_free(void *ptr, lzma_allocator *allocator);
static lzma_ret
index_decode(lzma_coder *coder, lzma_allocator *allocator,
const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out lzma_attribute((unused)),
- size_t *restrict out_pos lzma_attribute((unused)),
- size_t out_size lzma_attribute((unused)),
- lzma_action action lzma_attribute((unused)))
+ size_t in_size,
+ uint8_t *restrict out lzma_attribute((__unused__)),
+ size_t *restrict out_pos lzma_attribute((__unused__)),
+ size_t out_size lzma_attribute((__unused__)),
+ lzma_action action lzma_attribute((__unused__)))
{
// Similar optimization as in index_encoder.c
const size_t in_start = *in_pos;
static lzma_ret
index_encode(lzma_coder *coder,
- lzma_allocator *allocator lzma_attribute((unused)),
- const uint8_t *restrict in lzma_attribute((unused)),
- size_t *restrict in_pos lzma_attribute((unused)),
- size_t in_size lzma_attribute((unused)),
+ lzma_allocator *allocator lzma_attribute((__unused__)),
+ const uint8_t *restrict in lzma_attribute((__unused__)),
+ size_t *restrict in_pos lzma_attribute((__unused__)),
+ size_t in_size lzma_attribute((__unused__)),
uint8_t *restrict out, size_t *restrict out_pos,
- size_t out_size, lzma_action action lzma_attribute((unused)))
+ size_t out_size,
+ lzma_action action lzma_attribute((__unused__)))
{
// Position where to start calculating CRC32. The idea is that we
// need to call lzma_crc32() only once per call to index_encode().
static lzma_ret
delta_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
- const lzma_filter *filters_null lzma_attribute((unused)),
+ const lzma_filter *filters_null lzma_attribute((__unused__)),
const lzma_filter *reversed_filters)
{
// Delta doesn't and will never support changing the options in
static lzma_ret
lz_decode(lzma_coder *coder,
- lzma_allocator *allocator lzma_attribute((unused)),
+ lzma_allocator *allocator lzma_attribute((__unused__)),
const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size,
static lzma_ret
lz_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
- const lzma_filter *filters_null lzma_attribute((unused)),
+ const lzma_filter *filters_null lzma_attribute((__unused__)),
const lzma_filter *reversed_filters)
{
if (coder->lz.options_update == NULL)
static size_t
-arm_code(lzma_simple *simple lzma_attribute((unused)),
+arm_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size)
{
static size_t
-armthumb_code(lzma_simple *simple lzma_attribute((unused)),
+armthumb_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size)
{
static size_t
-ia64_code(lzma_simple *simple lzma_attribute((unused)),
+ia64_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size)
{
static size_t
-powerpc_code(lzma_simple *simple lzma_attribute((unused)),
+powerpc_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size)
{
static lzma_ret
simple_coder_update(lzma_coder *coder, lzma_allocator *allocator,
- const lzma_filter *filters_null lzma_attribute((unused)),
+ const lzma_filter *filters_null lzma_attribute((__unused__)),
const lzma_filter *reversed_filters)
{
// No update support, just call the next filter in the chain.
static size_t
-sparc_code(lzma_simple *simple lzma_attribute((unused)),
+sparc_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size)
{
#endif
-static void lzma_attribute((noreturn))
+static void lzma_attribute((__noreturn__))
help(void)
{
printf(
}
-static void lzma_attribute((noreturn))
+static void lzma_attribute((__noreturn__))
version(void)
{
puts("lzmainfo (" PACKAGE_NAME ") " LZMA_VERSION_STRING);
}
-static void lzma_attribute((noreturn))
+static void lzma_attribute((__noreturn__))
memlimit_too_small(uint64_t memory_usage)
{
message(V_ERROR, _("Memory usage limit is too low for the given "
extern uint64_t hardware_memlimit_get(enum operation_mode mode);
/// Display the amount of RAM and memory usage limits and exit.
-extern void hardware_memlimit_show(void) lzma_attribute((noreturn));
+extern void hardware_memlimit_show(void) lzma_attribute((__noreturn__));
/// Signal handler for SIGALRM
static void
-progress_signal_handler(int sig lzma_attribute((unused)))
+progress_signal_handler(int sig lzma_attribute((__unused__)))
{
progress_needs_updating = true;
return;
///
/// This doesn't touch the exit status.
extern void message(enum message_verbosity verbosity, const char *fmt, ...)
- lzma_attribute((format(printf, 2, 3)));
+ lzma_attribute((__format__(__printf__, 2, 3)));
/// \brief Prints a warning and possibly sets exit status
/// The message is printed only if verbosity level is at least V_WARNING.
/// The exit status is set to WARNING unless it was already at ERROR.
extern void message_warning(const char *fmt, ...)
- lzma_attribute((format(printf, 1, 2)));
+ lzma_attribute((__format__(__printf__, 1, 2)));
/// \brief Prints an error message and sets exit status
/// The message is printed only if verbosity level is at least V_ERROR.
/// The exit status is set to ERROR.
extern void message_error(const char *fmt, ...)
- lzma_attribute((format(printf, 1, 2)));
+ lzma_attribute((__format__(__printf__, 1, 2)));
/// \brief Prints an error message and exits with EXIT_ERROR
///
/// The message is printed only if verbosity level is at least V_ERROR.
extern void message_fatal(const char *fmt, ...)
- lzma_attribute((format(printf, 1, 2)))
- lzma_attribute((noreturn));
+ lzma_attribute((__format__(__printf__, 1, 2)))
+ lzma_attribute((__noreturn__));
/// Print an error message that an internal error occurred and exit with
/// EXIT_ERROR.
-extern void message_bug(void) lzma_attribute((noreturn));
+extern void message_bug(void) lzma_attribute((__noreturn__));
/// Print a message that establishing signal handlers failed, and exit with
/// exit status ERROR.
-extern void message_signal_handler(void) lzma_attribute((noreturn));
+extern void message_signal_handler(void) lzma_attribute((__noreturn__));
/// Convert lzma_ret to a string.
/// Prints the version number to stdout and exits with exit status SUCCESS.
-extern void message_version(void) lzma_attribute((noreturn));
+extern void message_version(void) lzma_attribute((__noreturn__));
/// Print the help message.
-extern void message_help(bool long_help) lzma_attribute((noreturn));
+extern void message_help(bool long_help) lzma_attribute((__noreturn__));
/// \brief Set the total number of files to be processed
static void
set_delta(void *options, uint32_t key, uint64_t value,
- const char *valuestr lzma_attribute((unused)))
+ const char *valuestr lzma_attribute((__unused__)))
{
lzma_options_delta *opt = options;
switch (key) {
static void
set_bcj(void *options, uint32_t key, uint64_t value,
- const char *valuestr lzma_attribute((unused)))
+ const char *valuestr lzma_attribute((__unused__)))
{
lzma_options_bcj *opt = options;
switch (key) {
};
-static void lzma_attribute((noreturn))
+static void lzma_attribute((__noreturn__))
error_lzma_preset(const char *valuestr)
{
message_fatal(_("Unsupported LZMA1/LZMA2 preset: %s"), valuestr);
// console window.
static BOOL WINAPI
-signal_handler(DWORD type lzma_attribute((unused)))
+signal_handler(DWORD type lzma_attribute((__unused__)))
{
// Since we don't get a signal number which we could raise() at
// signals_exit() like on POSIX, just set the exit status to
/// \brief Safe realloc() that never returns NULL
extern void *xrealloc(void *ptr, size_t size)
- lzma_attribute((malloc)) lzma_attr_alloc_size(2);
+ lzma_attribute((__malloc__)) lzma_attr_alloc_size(2);
/// \brief Safe strdup() that never returns NULL
-extern char *xstrdup(const char *src) lzma_attribute((malloc));
+extern char *xstrdup(const char *src) lzma_attribute((__malloc__));
/// \brief Fancy version of strtoull()
/// A maximum of *left bytes is written starting from *pos. *pos and *left
/// are updated accordingly.
extern void my_snprintf(char **pos, size_t *left, const char *fmt, ...)
- lzma_attribute((format(printf, 3, 4)));
+ lzma_attribute((__format__(__printf__, 3, 4)));
/// \brief Check if filename is empty and print an error message
static unsigned int display_errors = 2;
-static void lzma_attribute((format(printf, 1, 2)))
+static void lzma_attribute((__format__(__printf__, 1, 2)))
my_errorf(const char *fmt, ...)
{
va_list ap;
}
-static void lzma_attribute((noreturn))
+static void lzma_attribute((__noreturn__))
help(void)
{
printf(
}
-static void lzma_attribute((noreturn))
+static void lzma_attribute((__noreturn__))
version(void)
{
printf(TOOL_FORMAT "dec (" PACKAGE_NAME ") " LZMA_VERSION_STRING "\n"