From 65adc1712123f81847a85ce0374acc5a741368ec Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 5 Apr 2014 20:18:26 +0100 Subject: [PATCH] Fix a bunch of cppcheck unused/unreadVariable warnings --- amiga/clipboard.c | 1 - amiga/download.c | 1 - amiga/drag.c | 9 +++------ amiga/dt_anim.c | 4 ---- amiga/dt_picture.c | 5 ----- amiga/dt_sound.c | 4 ---- amiga/file.c | 2 -- amiga/filetype.c | 2 -- amiga/font.c | 2 -- amiga/history_local.c | 2 -- amiga/icon.c | 7 +++---- amiga/iff_dr2d.c | 2 -- amiga/launch.c | 2 -- amiga/menu.c | 3 --- amiga/misc.c | 2 +- amiga/plotters.c | 1 - amiga/plugin_hack.c | 2 +- amiga/stringview/stringview.c | 1 - 18 files changed, 8 insertions(+), 44 deletions(-) diff --git a/amiga/clipboard.c b/amiga/clipboard.c index 6768dde17..0f3a33d0f 100644 --- a/amiga/clipboard.c +++ b/amiga/clipboard.c @@ -185,7 +185,6 @@ char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codeset, size void gui_get_clipboard(char **buffer, size_t *length) { - struct ContextNode *cn; struct CollectionItem *ci = NULL; struct StoredProperty *sp = NULL; ULONG rlen=0,error; diff --git a/amiga/download.c b/amiga/download.c index 74cb51f15..7ce47a360 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -89,7 +89,6 @@ static struct gui_download_window *gui_download_window_create(download_context * struct gui_window *gui) { const char *url = download_context_get_url(ctx); - const char *mime_type = download_context_get_mime_type(ctx); unsigned long total_size = download_context_get_total_length(ctx); struct gui_download_window *dw; char *dl_filename = ami_utf8_easy(download_context_get_filename(ctx)); diff --git a/amiga/drag.c b/amiga/drag.c index f8944d3a5..09df0d0c4 100644 --- a/amiga/drag.c +++ b/amiga/drag.c @@ -98,9 +98,8 @@ void gui_drag_save_selection(struct gui_window *g, const char *selection) void ami_drag_save(struct Window *win) { - ULONG which = WBO_NONE,type; - char path[1025],dpath[1025]; - const char *source_data; + ULONG which = WBO_NONE, type; + char path[1025], dpath[1025]; ULONG source_size; ami_drag_icon_close(NULL); @@ -195,10 +194,8 @@ void ami_drag_save(struct Window *win) void ami_drag_icon_show(struct Window *win, const char *type) { struct DiskObject *dobj = NULL; - ULONG *icondata1; ULONG width, height; - long format = 0; - int err = 0; + int err; int deftype = WBPROJECT; drag_in_progress = TRUE; diff --git a/amiga/dt_anim.c b/amiga/dt_anim.c index f2b0f768f..d6e5c1096 100644 --- a/amiga/dt_anim.c +++ b/amiga/dt_anim.c @@ -92,7 +92,6 @@ static const content_handler amiga_dt_anim_content_handler = { nserror amiga_dt_anim_init(void) { - char dt_mime[50]; struct DataType *dt, *prevdt = NULL; lwc_string *type; lwc_error lerror; @@ -161,14 +160,11 @@ bool amiga_dt_anim_convert(struct content *c) amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c; union content_msg_data msg_data; int width, height; - char title[100]; const uint8 *data; UBYTE *bm_buffer; ULONG size; - Object *dto; struct BitMapHeader *bmh; unsigned int bm_flags = BITMAP_NEW | BITMAP_OPAQUE; - int bm_format = PBPAFMT_RGBA; struct adtFrame adt_frame; APTR clut; diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c index 211d2215a..1d3092806 100644 --- a/amiga/dt_picture.c +++ b/amiga/dt_picture.c @@ -62,7 +62,6 @@ struct amiga_dt_picture_content { nserror amiga_dt_picture_init(void) { - char dt_mime[50]; struct DataType *dt, *prevdt = NULL; lwc_string *type; lwc_error lerror; @@ -214,14 +213,10 @@ bool amiga_dt_picture_convert(struct content *c) { LOG(("amiga_dt_picture_convert")); - union content_msg_data msg_data; int width, height; char *title; - UBYTE *bm_buffer; Object *dto; struct BitMapHeader *bmh; - unsigned int bm_flags = BITMAP_NEW; - int bm_format = PBPAFMT_RGBA; char *filetype; if(dto = amiga_dt_picture_newdtobject((struct amiga_dt_picture_content *)c)) diff --git a/amiga/dt_sound.c b/amiga/dt_sound.c index 3f8216914..a1daf03f5 100644 --- a/amiga/dt_sound.c +++ b/amiga/dt_sound.c @@ -77,7 +77,6 @@ void amiga_dt_sound_play(Object *dto) nserror amiga_dt_sound_init(void) { - char dt_mime[50]; struct DataType *dt, *prevdt = NULL; lwc_string *type; lwc_error lerror; @@ -146,12 +145,9 @@ bool amiga_dt_sound_convert(struct content *c) LOG(("amiga_dt_sound_convert")); amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c; - union content_msg_data msg_data; int width = 50, height = 50; - char title[100]; const uint8 *data; ULONG size; - Object *dto; data = (uint8 *)content__get_source_data(c, &size); diff --git a/amiga/file.c b/amiga/file.c index 91d375576..5d16ceb13 100644 --- a/amiga/file.c +++ b/amiga/file.c @@ -49,8 +49,6 @@ static struct Hook aslhookfunc; static const ULONG ami_file_asl_mime_hook(struct Hook *mh, struct FileRequester *fr, struct AnchorPathOld *ap) { - BPTR file = 0; - char buffer[10]; char fname[1024]; BOOL ret = FALSE; char *mt = NULL; diff --git a/amiga/filetype.c b/amiga/filetype.c index 0cb4ac454..bcb6b7e87 100644 --- a/amiga/filetype.c +++ b/amiga/filetype.c @@ -173,9 +173,7 @@ const char *ami_content_type_to_file_type(content_type type) nserror ami_mime_init(const char *mimefile) { - lwc_string *type; lwc_error lerror; - nserror error; char buffer[256]; BPTR fh = 0; struct RDArgs *rargs = NULL; diff --git a/amiga/font.c b/amiga/font.c index df4a18862..148d860c4 100755 --- a/amiga/font.c +++ b/amiga/font.c @@ -204,8 +204,6 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle, FIXED kern = 0; struct OutlineFont *ofont, *ufont = NULL; uint32 tx=0,i=0; - size_t len, utf8len = 0; - uint8 *utf8; int utf8_pos = 0; uint32 co = 0; int utf16charlen; diff --git a/amiga/history_local.c b/amiga/history_local.c index 1f710b2e0..4849c6560 100755 --- a/amiga/history_local.c +++ b/amiga/history_local.c @@ -74,7 +74,6 @@ static void ami_history_scroller_hook(struct Hook *hook,Object *object,struct In void ami_history_open(struct browser_window *bw, struct history *history) { int width, height; - struct IBox *bbox; assert(history); @@ -239,7 +238,6 @@ BOOL ami_history_event(struct history_window *hw) /* return TRUE if window destroyed */ ULONG class,result,relevent = 0; uint16 code; - struct MenuItem *item; const char *url; struct IBox *bbox; ULONG xs, ys; diff --git a/amiga/icon.c b/amiga/icon.c index c5bc6ae1f..a6b61a273 100644 --- a/amiga/icon.c +++ b/amiga/icon.c @@ -139,7 +139,7 @@ bool amiga_icon_convert(struct content *c) ULONG size; int width = 0, height = 0; long format = 0; - int err = 0; + int err; uint8 r, g, b, a; ULONG offset; const char *url; @@ -365,7 +365,7 @@ void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct ULONG *icondata1, *icondata2; ULONG width, height; long format = 0; - int err = 0; + int err; if(dobj == NULL) return; @@ -420,11 +420,10 @@ void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct void amiga_icon_superimpose_favicon(char *path, struct hlcache_handle *icon, char *type) { struct DiskObject *dobj = NULL; - struct BitMap *bm = NULL; ULONG *icondata1, *icondata2; ULONG width, height; long format = 0; - int err = 0; + int err; ULONG trans1, pals1; ULONG trans2, pals2; struct ColorRegister *pal1; diff --git a/amiga/iff_dr2d.c b/amiga/iff_dr2d.c index 0638b94a6..6cced5b68 100644 --- a/amiga/iff_dr2d.c +++ b/amiga/iff_dr2d.c @@ -49,7 +49,6 @@ ULONG findcolour(ULONG newcol) void addcolour(ULONG newcol) { - int i; ULONG colour; UBYTE red,grn,blu; @@ -342,7 +341,6 @@ int main(int argc, char **argv) { BPTR fh = 0; char *buffer; - size_t n; struct IFFHandle *iffh = NULL; int64 size; LONG rarray[] = {0,0}; diff --git a/amiga/launch.c b/amiga/launch.c index ebd82294a..0d25bcf32 100755 --- a/amiga/launch.c +++ b/amiga/launch.c @@ -105,8 +105,6 @@ BOOL ami_openurl_check_list(struct MinList *list, const char *url) void ami_openurl_open(void) { - struct ami_protocol *ami_p; - if(nsoption_bool(use_openurl_lib)) { if(OpenURLBase = OpenLibrary("openurl.library",0)) IOpenURL = (struct OpenURLIFace *)GetInterface(OpenURLBase,"main",1,NULL); diff --git a/amiga/menu.c b/amiga/menu.c index 13b9c9c24..234a95855 100644 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -456,8 +456,6 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin) struct NewMenu *ami_create_menu(struct gui_window_2 *gwin) { - int i; - gwin->menu = AllocVecTags(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1), AVT_ClearWithValue, 0, TAG_DONE); ami_init_menulabs(gwin); @@ -1029,7 +1027,6 @@ static void ami_menu_item_hotlist_show(struct Hook *hook, APTR window, struct In static void ami_menu_item_hotlist_entries(struct Hook *hook, APTR window, struct IntuiMessage *msg) { nsurl *url = hook->h_Data; - nserror error; struct gui_window_2 *gwin; GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin); diff --git a/amiga/misc.c b/amiga/misc.c index ac9d2453e..c25c5d59d 100755 --- a/amiga/misc.c +++ b/amiga/misc.c @@ -108,7 +108,7 @@ void die(const char *error) char *url_to_path(const char *url) { - char *tmps, *unesc, *slash, *colon, *url2; + char *unesc, *slash, *colon, *url2; if (strncmp(url, "file://", SLEN("file://")) != 0) return NULL; diff --git a/amiga/plotters.c b/amiga/plotters.c index 05db67f48..7b8ad1281 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -945,7 +945,6 @@ bool ami_path(const float *p, unsigned int n, colour fill, float width, colour c, const float transform[6]) { unsigned int i; - struct bez_point *old_p; struct bez_point start_p, cur_p, p_a, p_b, p_c, p_r; #ifdef AMI_PLOTTER_DEBUG diff --git a/amiga/plugin_hack.c b/amiga/plugin_hack.c index f78a67e2d..9bfd7a3d3 100644 --- a/amiga/plugin_hack.c +++ b/amiga/plugin_hack.c @@ -132,7 +132,7 @@ void amiga_plugin_hack_destroy(struct content *c) { amiga_plugin_hack_content *plugin = (amiga_plugin_hack_content *) c; - LOG(("amiga_plugin_hack_destroy")); + LOG(("amiga_plugin_hack_destroy %p", plugin)); return; } diff --git a/amiga/stringview/stringview.c b/amiga/stringview/stringview.c index 5aea939d5..9aa110a55 100755 --- a/amiga/stringview/stringview.c +++ b/amiga/stringview/stringview.c @@ -859,7 +859,6 @@ Class *MakeStringClass( void ) void FreeStringClass(Class *cl) { - struct Library *libbase; URLHistory_Free(); FreeClass(cl); }