Fix a bunch of cppcheck unused/unreadVariable warnings

This commit is contained in:
Chris Young 2014-04-05 20:18:26 +01:00
parent 975a1d3c5d
commit 65adc17121
18 changed files with 8 additions and 44 deletions

View File

@ -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;

View File

@ -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));

View File

@ -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;

View File

@ -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;

View File

@ -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))

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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};

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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;
}

View File

@ -859,7 +859,6 @@ Class *MakeStringClass( void )
void FreeStringClass(Class *cl)
{
struct Library *libbase;
URLHistory_Free();
FreeClass(cl);
}