1
0
Fork 0
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:
Lasse Collin 2011-05-17 11:54:38 +03:00
parent 22159c6ba2
commit afcff45cee
25 changed files with 49 additions and 47 deletions

View file

@ -46,7 +46,7 @@ struct lzma_coder_s {
static lzma_ret static lzma_ret
alone_decode(lzma_coder *coder, 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, const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out, size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size, size_t *restrict out_pos, size_t out_size,

View file

@ -32,7 +32,7 @@ struct lzma_coder_s {
static lzma_ret static lzma_ret
alone_encode(lzma_coder *coder, 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, const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out, size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size, size_t *restrict out_pos, size_t out_size,

View file

@ -144,7 +144,7 @@ block_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret static lzma_ret
block_encoder_update(lzma_coder *coder, lzma_allocator *allocator, 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) const lzma_filter *reversed_filters)
{ {
if (coder->sequence != SEQ_CODE) if (coder->sequence != SEQ_CODE)

View file

@ -35,7 +35,7 @@ lzma_version_string(void)
// Memory allocation // // 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) lzma_alloc(size_t size, lzma_allocator *allocator)
{ {
// Some malloc() variants return NULL if called with size == 0. // Some malloc() variants return NULL if called with size == 0.

View file

@ -205,7 +205,7 @@ struct lzma_internal_s {
/// Allocates memory /// Allocates memory
extern void *lzma_alloc(size_t size, lzma_allocator *allocator) 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 /// Frees memory
extern void lzma_free(void *ptr, lzma_allocator *allocator); extern void lzma_free(void *ptr, lzma_allocator *allocator);

View file

@ -56,10 +56,11 @@ struct lzma_coder_s {
static lzma_ret static lzma_ret
index_decode(lzma_coder *coder, lzma_allocator *allocator, index_decode(lzma_coder *coder, lzma_allocator *allocator,
const uint8_t *restrict in, size_t *restrict in_pos, const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out lzma_attribute((unused)), size_t in_size,
size_t *restrict out_pos lzma_attribute((unused)), uint8_t *restrict out lzma_attribute((__unused__)),
size_t out_size lzma_attribute((unused)), size_t *restrict out_pos lzma_attribute((__unused__)),
lzma_action action lzma_attribute((unused))) size_t out_size lzma_attribute((__unused__)),
lzma_action action lzma_attribute((__unused__)))
{ {
// Similar optimization as in index_encoder.c // Similar optimization as in index_encoder.c
const size_t in_start = *in_pos; const size_t in_start = *in_pos;

View file

@ -42,12 +42,13 @@ struct lzma_coder_s {
static lzma_ret static lzma_ret
index_encode(lzma_coder *coder, index_encode(lzma_coder *coder,
lzma_allocator *allocator lzma_attribute((unused)), lzma_allocator *allocator lzma_attribute((__unused__)),
const uint8_t *restrict in lzma_attribute((unused)), const uint8_t *restrict in lzma_attribute((__unused__)),
size_t *restrict in_pos lzma_attribute((unused)), size_t *restrict in_pos lzma_attribute((__unused__)),
size_t in_size lzma_attribute((unused)), size_t in_size lzma_attribute((__unused__)),
uint8_t *restrict out, size_t *restrict out_pos, 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 // Position where to start calculating CRC32. The idea is that we
// need to call lzma_crc32() only once per call to index_encode(). // need to call lzma_crc32() only once per call to index_encode().

View file

@ -85,7 +85,7 @@ delta_encode(lzma_coder *coder, lzma_allocator *allocator,
static lzma_ret static lzma_ret
delta_encoder_update(lzma_coder *coder, lzma_allocator *allocator, 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) const lzma_filter *reversed_filters)
{ {
// Delta doesn't and will never support changing the options in // Delta doesn't and will never support changing the options in

View file

@ -126,7 +126,7 @@ decode_buffer(lzma_coder *coder,
static lzma_ret static lzma_ret
lz_decode(lzma_coder *coder, 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, const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out, size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size, size_t *restrict out_pos, size_t out_size,

View file

@ -480,7 +480,7 @@ lz_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret static lzma_ret
lz_encoder_update(lzma_coder *coder, lzma_allocator *allocator, 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) const lzma_filter *reversed_filters)
{ {
if (coder->lz.options_update == NULL) if (coder->lz.options_update == NULL)

View file

@ -15,7 +15,7 @@
static size_t 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, uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size) uint8_t *buffer, size_t size)
{ {

View file

@ -15,7 +15,7 @@
static size_t 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, uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size) uint8_t *buffer, size_t size)
{ {

View file

@ -15,7 +15,7 @@
static size_t 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, uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size) uint8_t *buffer, size_t size)
{ {

View file

@ -15,7 +15,7 @@
static size_t 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, uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size) uint8_t *buffer, size_t size)
{ {

View file

@ -212,7 +212,7 @@ simple_coder_end(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret static lzma_ret
simple_coder_update(lzma_coder *coder, lzma_allocator *allocator, 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) const lzma_filter *reversed_filters)
{ {
// No update support, just call the next filter in the chain. // No update support, just call the next filter in the chain.

View file

@ -15,7 +15,7 @@
static size_t 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, uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size) uint8_t *buffer, size_t size)
{ {

View file

@ -26,7 +26,7 @@
#endif #endif
static void lzma_attribute((noreturn)) static void lzma_attribute((__noreturn__))
help(void) help(void)
{ {
printf( printf(
@ -45,7 +45,7 @@ _("Usage: %s [--help] [--version] [FILE]...\n"
} }
static void lzma_attribute((noreturn)) static void lzma_attribute((__noreturn__))
version(void) version(void)
{ {
puts("lzmainfo (" PACKAGE_NAME ") " LZMA_VERSION_STRING); puts("lzmainfo (" PACKAGE_NAME ") " LZMA_VERSION_STRING);

View file

@ -102,7 +102,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) memlimit_too_small(uint64_t memory_usage)
{ {
message(V_ERROR, _("Memory usage limit is too low for the given " message(V_ERROR, _("Memory usage limit is too low for the given "

View file

@ -35,4 +35,4 @@ extern void hardware_memlimit_set(uint64_t new_memlimit,
extern uint64_t hardware_memlimit_get(enum operation_mode mode); extern uint64_t hardware_memlimit_get(enum operation_mode mode);
/// Display the amount of RAM and memory usage limits and exit. /// 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__));

View file

@ -94,7 +94,7 @@ static volatile sig_atomic_t progress_needs_updating = false;
/// Signal handler for SIGALRM /// Signal handler for SIGALRM
static void static void
progress_signal_handler(int sig lzma_attribute((unused))) progress_signal_handler(int sig lzma_attribute((__unused__)))
{ {
progress_needs_updating = true; progress_needs_updating = true;
return; return;

View file

@ -45,7 +45,7 @@ extern enum message_verbosity message_verbosity_get(void);
/// ///
/// This doesn't touch the exit status. /// This doesn't touch the exit status.
extern void message(enum message_verbosity verbosity, const char *fmt, ...) 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 /// \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 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. /// The exit status is set to WARNING unless it was already at ERROR.
extern void message_warning(const char *fmt, ...) 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 /// \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 message is printed only if verbosity level is at least V_ERROR.
/// The exit status is set to ERROR. /// The exit status is set to ERROR.
extern void message_error(const char *fmt, ...) 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 /// \brief Prints an error message and exits with EXIT_ERROR
/// ///
/// The message is printed only if verbosity level is at least V_ERROR. /// The message is printed only if verbosity level is at least V_ERROR.
extern void message_fatal(const char *fmt, ...) extern void message_fatal(const char *fmt, ...)
lzma_attribute((format(printf, 1, 2))) lzma_attribute((__format__(__printf__, 1, 2)))
lzma_attribute((noreturn)); lzma_attribute((__noreturn__));
/// Print an error message that an internal error occurred and exit with /// Print an error message that an internal error occurred and exit with
/// EXIT_ERROR. /// 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 /// Print a message that establishing signal handlers failed, and exit with
/// exit status ERROR. /// 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. /// 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. /// 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. /// 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 /// \brief Set the total number of files to be processed

View file

@ -150,7 +150,7 @@ enum {
static void static void
set_delta(void *options, uint32_t key, uint64_t value, 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; lzma_options_delta *opt = options;
switch (key) { switch (key) {
@ -194,7 +194,7 @@ enum {
static void static void
set_bcj(void *options, uint32_t key, uint64_t value, 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; lzma_options_bcj *opt = options;
switch (key) { switch (key) {
@ -241,7 +241,7 @@ enum {
}; };
static void lzma_attribute((noreturn)) static void lzma_attribute((__noreturn__))
error_lzma_preset(const char *valuestr) error_lzma_preset(const char *valuestr)
{ {
message_fatal(_("Unsupported LZMA1/LZMA2 preset: %s"), valuestr); message_fatal(_("Unsupported LZMA1/LZMA2 preset: %s"), valuestr);

View file

@ -179,7 +179,7 @@ signals_exit(void)
// console window. // console window.
static BOOL WINAPI 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 // Since we don't get a signal number which we could raise() at
// signals_exit() like on POSIX, just set the exit status to // signals_exit() like on POSIX, just set the exit status to

View file

@ -20,11 +20,11 @@
/// \brief Safe realloc() that never returns NULL /// \brief Safe realloc() that never returns NULL
extern void *xrealloc(void *ptr, size_t size) 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 /// \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() /// \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 /// A maximum of *left bytes is written starting from *pos. *pos and *left
/// are updated accordingly. /// are updated accordingly.
extern void my_snprintf(char **pos, size_t *left, const char *fmt, ...) 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 /// \brief Check if filename is empty and print an error message

View file

@ -40,7 +40,7 @@
static unsigned int display_errors = 2; 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, ...) my_errorf(const char *fmt, ...)
{ {
va_list ap; va_list ap;
@ -57,7 +57,7 @@ my_errorf(const char *fmt, ...)
} }
static void lzma_attribute((noreturn)) static void lzma_attribute((__noreturn__))
help(void) help(void)
{ {
printf( 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) version(void)
{ {
printf(TOOL_FORMAT "dec (" PACKAGE_NAME ") " LZMA_VERSION_STRING "\n" printf(TOOL_FORMAT "dec (" PACKAGE_NAME ") " LZMA_VERSION_STRING "\n"