Use a macro for unused variables

Change-Id: I491bea842274029feb965b71c3a62b5953c2ce5c
This commit is contained in:
KINGbabasula
2015-03-23 14:57:20 +01:00
parent 5f73cc6c99
commit 55600f4acc
14 changed files with 31 additions and 33 deletions

View File

@@ -1089,7 +1089,7 @@ void fb_pop_context(void)
} }
#define SLEEP_CONST 16 #define SLEEP_CONST 16
void *fb_draw_thread_work(__attribute__((unused)) void *cookie) void *fb_draw_thread_work(UNUSED void *cookie)
{ {
struct timespec last, curr; struct timespec last, curr;
uint32_t diff = 0, prevSleepTime = 0; uint32_t diff = 0, prevSleepTime = 0;

View File

@@ -176,7 +176,7 @@ static void fb_qcom_vsync_destroy(struct fb_qcom_vsync *vs)
free(vs); free(vs);
} }
static int fb_qcom_vsync_wait(__attribute__((unused)) struct fb_qcom_vsync *vs) static int fb_qcom_vsync_wait(UNUSED struct fb_qcom_vsync *vs)
{ {
#ifdef MR_QCOM_OVERLAY_USE_VSYNC #ifdef MR_QCOM_OVERLAY_USE_VSYNC
int res; int res;

View File

@@ -45,7 +45,7 @@ static int get_img_trampoline_ver(struct bootimg *img)
return ver; return ver;
} }
static int copy_rd_files(__attribute__((unused)) const char *path, __attribute__((unused)) const char *busybox_path) static int copy_rd_files(UNUSED const char *path, UNUSED const char *busybox_path)
{ {
char buf[256]; char buf[256];

View File

@@ -294,7 +294,7 @@ void touch_commit_events(struct timeval ev_time)
} }
} }
static void *input_thread_work(__attribute__((unused)) void *cookie) static void *input_thread_work(UNUSED void *cookie)
{ {
ev_init(); ev_init();
struct input_event ev; struct input_event ev;

View File

@@ -108,7 +108,7 @@ struct keyboard_btn_data {
static int keyboard_init_map(struct keyboard *k, const uint32_t *map, const uint32_t *dimen); static int keyboard_init_map(struct keyboard *k, const uint32_t *map, const uint32_t *dimen);
static int keyboard_charset_switch_worker(__attribute__((unused)) uint32_t diff, void *data) static int keyboard_charset_switch_worker(UNUSED uint32_t diff, void *data)
{ {
void **keyboard_bnt_data_old = NULL; void **keyboard_bnt_data_old = NULL;
struct keyboard_btn_data *d = data; struct keyboard_btn_data *d = data;

View File

@@ -37,7 +37,7 @@
#define OVERSCROLL_MARK_H (4*DPI_MUL) #define OVERSCROLL_MARK_H (4*DPI_MUL)
#define OVERSCROLL_RETURN_SPD (10*DPI_MUL) #define OVERSCROLL_RETURN_SPD (10*DPI_MUL)
static int listview_bounceback(__attribute__((unused)) uint32_t diff, void *data) static int listview_bounceback(UNUSED uint32_t diff, void *data)
{ {
listview *v = (listview*)data; listview *v = (listview*)data;
const int max = v->fullH - v->h; const int max = v->fullH - v->h;
@@ -570,7 +570,7 @@ static void rom_item_deselect_finished(void *data)
d->sel_rect_sh = NULL; d->sel_rect_sh = NULL;
} }
static void rom_item_sel_step(void *data, __attribute__((unused)) float interpolated) static void rom_item_sel_step(void *data, UNUSED float interpolated)
{ {
rom_item_data *d = data; rom_item_data *d = data;
if(!d->sel_rect || !d->sel_rect_sh) if(!d->sel_rect || !d->sel_rect_sh)
@@ -744,7 +744,7 @@ void rom_item_hide(void *data)
d->icon = NULL; d->icon = NULL;
} }
int rom_item_height(__attribute__((unused)) listview_item *it) int rom_item_height(UNUSED listview_item *it)
{ {
return ROM_ITEM_H; return ROM_ITEM_H;
} }

View File

@@ -278,7 +278,7 @@ static void ncard_move_step(void *data, float interpolated)
fb_request_draw(); fb_request_draw();
} }
static void ncard_reveal_finished(__attribute__((unused)) void *data) static void ncard_reveal_finished(UNUSED void *data)
{ {
pthread_mutex_lock(&ncard.mutex); pthread_mutex_lock(&ncard.mutex);
ncard.bg->h = ncard.targetH; ncard.bg->h = ncard.targetH;
@@ -529,7 +529,7 @@ void ncard_hide(void)
ncard.on_hidden_call(ncard.on_hidden_data); ncard.on_hidden_call(ncard.on_hidden_data);
} }
void ncard_hide_callback(__attribute__((unused)) void *data) void ncard_hide_callback(UNUSED void *data)
{ {
ncard_hide(); ncard_hide();
} }

View File

@@ -22,6 +22,8 @@
#include <sys/time.h> #include <sys/time.h>
#include <time.h> #include <time.h>
#define UNUSED __attribute__((unused))
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
#define REBOOT_SYSTEM 0 #define REBOOT_SYSTEM 0

View File

@@ -410,7 +410,7 @@ static void multirom_ui_destroy_auto_boot_data(void)
auto_boot_data.destroy = 1; auto_boot_data.destroy = 1;
} }
static void multirom_ui_auto_boot_hidden(__attribute__((unused)) void *data) static void multirom_ui_auto_boot_hidden(UNUSED void *data)
{ {
pthread_mutex_lock(&auto_boot_data.mutex); pthread_mutex_lock(&auto_boot_data.mutex);
multirom_ui_destroy_auto_boot_data(); multirom_ui_destroy_auto_boot_data();
@@ -427,7 +427,7 @@ static void multirom_ui_auto_boot_now(void *data)
pthread_mutex_unlock(&exit_code_mutex); pthread_mutex_unlock(&exit_code_mutex);
} }
static void multirom_ui_auto_boot_tick(__attribute__((unused)) void *data) static void multirom_ui_auto_boot_tick(UNUSED void *data)
{ {
char buff[128]; char buff[128];
@@ -490,7 +490,7 @@ void multirom_ui_refresh_usb_handler(void)
pthread_mutex_unlock(&exit_code_mutex); pthread_mutex_unlock(&exit_code_mutex);
} }
void multirom_ui_start_pong(__attribute__((unused)) void *data) void multirom_ui_start_pong(UNUSED void *data)
{ {
pthread_mutex_lock(&exit_code_mutex); pthread_mutex_lock(&exit_code_mutex);
loop_act |= LOOP_START_PONG; loop_act |= LOOP_START_PONG;
@@ -552,7 +552,7 @@ void multirom_ui_tab_rom_destroy(void *data)
free(t); free(t);
} }
void multirom_ui_tab_rom_confirmed(__attribute__((unused)) listview_item *it) void multirom_ui_tab_rom_confirmed(UNUSED listview_item *it)
{ {
multirom_ui_tab_rom_boot(); multirom_ui_tab_rom_boot();
} }
@@ -623,7 +623,7 @@ void multirom_ui_tab_rom_update_usb(void)
fb_request_draw(); fb_request_draw();
} }
void multirom_ui_tab_rom_refresh_usb(__attribute__((unused)) int action) void multirom_ui_tab_rom_refresh_usb(UNUSED int action)
{ {
multirom_update_partitions(mrom_status); multirom_update_partitions(mrom_status);
} }
@@ -705,7 +705,7 @@ void multirom_ui_reboot_btn(void *data)
pthread_mutex_unlock(&exit_code_mutex); pthread_mutex_unlock(&exit_code_mutex);
} }
void multirom_ui_tab_misc_copy_log(__attribute__((unused)) void *data) void multirom_ui_tab_misc_copy_log(UNUSED void *data)
{ {
multirom_dump_status(mrom_status); multirom_dump_status(mrom_status);

View File

@@ -50,7 +50,7 @@
#define SELECTED_RECT_H (6*DPI_MUL) #define SELECTED_RECT_H (6*DPI_MUL)
#define BTN_SHADOW_OFF (5*DPI_MUL) #define BTN_SHADOW_OFF (5*DPI_MUL)
static void destroy(__attribute__((unused)) multirom_theme_data *t) static void destroy(UNUSED multirom_theme_data *t)
{ {
} }
@@ -146,9 +146,7 @@ static void init_header(multirom_theme_data *t)
header_set_tab_selector_pos(t, 0.f); header_set_tab_selector_pos(t, 0.f);
} }
static void tab_rom_init(__attribute__((unused)) multirom_theme_data *t, static void tab_rom_init(UNUSED multirom_theme_data *t, tab_data_roms *d, UNUSED int tab_type)
tab_data_roms *d,
__attribute__((unused)) int tab_type)
{ {
d->list->x = fb_width/2 - fb_height/2; d->list->x = fb_width/2 - fb_height/2;
d->list->y = HEADER_HEIGHT + LISTVIEW_MARGIN; d->list->y = HEADER_HEIGHT + LISTVIEW_MARGIN;
@@ -262,12 +260,12 @@ static void tab_misc_init(multirom_theme_data *t, tab_data_misc *d, int color_sc
tabview_add_items(t->tabs, TAB_MISC, d->ui_elements); tabview_add_items(t->tabs, TAB_MISC, d->ui_elements);
} }
static int get_tab_width(__attribute__((unused)) multirom_theme_data *t) static int get_tab_width(UNUSED multirom_theme_data *t)
{ {
return fb_width; return fb_width;
} }
static int get_tab_height(__attribute__((unused)) multirom_theme_data *t) static int get_tab_height(UNUSED multirom_theme_data *t)
{ {
return fb_height - HEADER_HEIGHT; return fb_height - HEADER_HEIGHT;
} }

View File

@@ -51,7 +51,7 @@
#define BTN_SHADOW_OFF (5*DPI_MUL) #define BTN_SHADOW_OFF (5*DPI_MUL)
static button *pong_btn = NULL; static button *pong_btn = NULL;
static void destroy(__attribute__((unused)) multirom_theme_data *t) static void destroy(UNUSED multirom_theme_data *t)
{ {
if(pong_btn) if(pong_btn)
{ {
@@ -161,9 +161,7 @@ static void init_header(multirom_theme_data *t)
header_set_tab_selector_pos(t, 0.f); header_set_tab_selector_pos(t, 0.f);
} }
static void tab_rom_init(__attribute__((unused)) multirom_theme_data *t, static void tab_rom_init(UNUSED multirom_theme_data *t, tab_data_roms *d, UNUSED int tab_type)
tab_data_roms *d,
__attribute__((unused)) int tab_type)
{ {
d->list->x = LISTVIEW_MARGIN; d->list->x = LISTVIEW_MARGIN;
d->list->y = HEADER_HEIGHT+LISTVIEW_MARGIN; d->list->y = HEADER_HEIGHT+LISTVIEW_MARGIN;
@@ -275,12 +273,12 @@ static void tab_misc_init(multirom_theme_data *t, tab_data_misc *d, int color_sc
tabview_add_items(t->tabs, TAB_MISC, d->ui_elements); tabview_add_items(t->tabs, TAB_MISC, d->ui_elements);
} }
static int get_tab_width(__attribute__((unused)) multirom_theme_data *t) static int get_tab_width(UNUSED multirom_theme_data *t)
{ {
return fb_width; return fb_width;
} }
static int get_tab_height(__attribute__((unused)) multirom_theme_data *t) static int get_tab_height(UNUSED multirom_theme_data *t)
{ {
return fb_height - HEADER_HEIGHT; return fb_height - HEADER_HEIGHT;
} }

2
pong.c
View File

@@ -198,7 +198,7 @@ int pong_do_movement(int step)
return 0; return 0;
} }
int pong_touch_handler(touch_event *ev, __attribute__((unused)) void *data) int pong_touch_handler(touch_event *ev, UNUSED void *data)
{ {
int i = 0; int i = 0;
for(; i < 2; ++i) for(; i < 2; ++i)

View File

@@ -77,7 +77,7 @@ static int device_fd = -1;
static volatile int run_event_thread = 1; static volatile int run_event_thread = 1;
static pthread_t uevent_thread; static pthread_t uevent_thread;
static void *uevent_thread_work(__attribute__((unused)) void *cookie) static void *uevent_thread_work(UNUSED void *cookie)
{ {
struct pollfd ufd; struct pollfd ufd;
int nr; int nr;
@@ -328,7 +328,7 @@ static mode_t get_device_perm(const char *path, unsigned *uid, unsigned *gid)
} }
static void make_device(const char *path, static void make_device(const char *path,
__attribute__((unused)) const char *upath, UNUSED const char *upath,
int block, int major, int minor) int block, int major, int minor)
{ {
unsigned uid; unsigned uid;

View File

@@ -65,7 +65,7 @@ static int exit_code = ENCMNT_UIRES_ERROR;
static void *pwui_type_data = NULL; static void *pwui_type_data = NULL;
static fb_text *invalid_pass_text = NULL; static fb_text *invalid_pass_text = NULL;
static void boot_internal_clicked(__attribute__((unused)) void *data) static void boot_internal_clicked(UNUSED void *data)
{ {
ncard_builder *b = ncard_create_builder(); ncard_builder *b = ncard_create_builder();
ncard_set_pos(b, NCARD_POS_CENTER); ncard_set_pos(b, NCARD_POS_CENTER);
@@ -422,7 +422,7 @@ static void destroy_ui(int pwtype)
} }
} }
static int pw_ui_shutdown_counter_touch_handler(__attribute__((unused)) touch_event *ev, void *data) static int pw_ui_shutdown_counter_touch_handler(UNUSED touch_event *ev, void *data)
{ {
int *shutdown_counter = data; int *shutdown_counter = data;
if(*shutdown_counter == 0) if(*shutdown_counter == 0)