mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
Add underscores to attributes (__attribute((__foo__))).
This commit is contained in:
parent
7a480e4859
commit
4c6e146df9
25 changed files with 49 additions and 47 deletions
|
@ -46,7 +46,7 @@ struct lzma_coder_s {
|
|||
|
||||
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,
|
||||
|
|
|
@ -32,7 +32,7 @@ struct lzma_coder_s {
|
|||
|
||||
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,
|
||||
|
|
|
@ -144,7 +144,7 @@ block_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
|||
|
||||
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)
|
||||
|
|
|
@ -35,7 +35,7 @@ lzma_version_string(void)
|
|||
// 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.
|
||||
|
|
|
@ -221,7 +221,7 @@ struct lzma_internal_s {
|
|||
|
||||
/// 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);
|
||||
|
|
|
@ -56,10 +56,11 @@ struct lzma_coder_s {
|
|||
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;
|
||||
|
|
|
@ -42,12 +42,13 @@ struct lzma_coder_s {
|
|||
|
||||
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().
|
||||
|
|
|
@ -85,7 +85,7 @@ delta_encode(lzma_coder *coder, lzma_allocator *allocator,
|
|||
|
||||
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
|
||||
|
|
|
@ -126,7 +126,7 @@ decode_buffer(lzma_coder *coder,
|
|||
|
||||
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,
|
||||
|
|
|
@ -480,7 +480,7 @@ lz_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
|||
|
||||
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)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -212,7 +212,7 @@ simple_coder_end(lzma_coder *coder, lzma_allocator *allocator)
|
|||
|
||||
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.
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#endif
|
||||
|
||||
|
||||
static void lzma_attribute((noreturn))
|
||||
static void lzma_attribute((__noreturn__))
|
||||
help(void)
|
||||
{
|
||||
printf(
|
||||
|
@ -45,7 +45,7 @@ _("Usage: %s [--help] [--version] [FILE]...\n"
|
|||
}
|
||||
|
||||
|
||||
static void lzma_attribute((noreturn))
|
||||
static void lzma_attribute((__noreturn__))
|
||||
version(void)
|
||||
{
|
||||
puts("lzmainfo (" PACKAGE_NAME ") " LZMA_VERSION_STRING);
|
||||
|
|
|
@ -112,7 +112,7 @@ coder_add_filter(lzma_vli id, void *options)
|
|||
}
|
||||
|
||||
|
||||
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 "
|
||||
|
|
|
@ -34,4 +34,4 @@ extern void hardware_memlimit_set(uint64_t new_memlimit,
|
|||
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__));
|
||||
|
|
|
@ -94,7 +94,7 @@ static volatile sig_atomic_t progress_needs_updating = false;
|
|||
|
||||
/// 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;
|
||||
|
|
|
@ -45,7 +45,7 @@ extern enum message_verbosity message_verbosity_get(void);
|
|||
///
|
||||
/// 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
|
||||
|
@ -53,7 +53,7 @@ extern void message(enum message_verbosity verbosity, const char *fmt, ...)
|
|||
/// 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
|
||||
|
@ -61,25 +61,25 @@ extern void message_warning(const char *fmt, ...)
|
|||
/// 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.
|
||||
|
@ -116,11 +116,11 @@ extern void message_try_help(void);
|
|||
|
||||
|
||||
/// 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
|
||||
|
|
|
@ -150,7 +150,7 @@ enum {
|
|||
|
||||
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) {
|
||||
|
@ -194,7 +194,7 @@ enum {
|
|||
|
||||
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) {
|
||||
|
@ -241,7 +241,7 @@ enum {
|
|||
};
|
||||
|
||||
|
||||
static void lzma_attribute((noreturn))
|
||||
static void lzma_attribute((__noreturn__))
|
||||
error_lzma_preset(const char *valuestr)
|
||||
{
|
||||
message_fatal(_("Unsupported LZMA1/LZMA2 preset: %s"), valuestr);
|
||||
|
|
|
@ -179,7 +179,7 @@ signals_exit(void)
|
|||
// 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
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
|
||||
/// \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()
|
||||
|
@ -102,7 +102,7 @@ extern const char *uint64_to_nicestr(uint64_t value,
|
|||
/// 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
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
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;
|
||||
|
@ -57,7 +57,7 @@ my_errorf(const char *fmt, ...)
|
|||
}
|
||||
|
||||
|
||||
static void lzma_attribute((noreturn))
|
||||
static void lzma_attribute((__noreturn__))
|
||||
help(void)
|
||||
{
|
||||
printf(
|
||||
|
@ -81,7 +81,7 @@ PACKAGE_NAME " home page: <" PACKAGE_URL ">\n", progname);
|
|||
}
|
||||
|
||||
|
||||
static void lzma_attribute((noreturn))
|
||||
static void lzma_attribute((__noreturn__))
|
||||
version(void)
|
||||
{
|
||||
printf(TOOL_FORMAT "dec (" PACKAGE_NAME ") " LZMA_VERSION_STRING "\n"
|
||||
|
|
Loading…
Reference in a new issue