summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--amiga/clipboard.c2
-rw-r--r--amiga/dt_picture.c3
-rw-r--r--amiga/file.c25
-rw-r--r--amiga/filetype.c29
-rw-r--r--amiga/font_scan.c4
-rwxr-xr-xamiga/launch.c3
-rw-r--r--amiga/menu.c3
-rwxr-xr-xamiga/misc.c3
-rwxr-xr-xamiga/plotters.c6
-rw-r--r--amiga/theme.c2
10 files changed, 30 insertions, 50 deletions
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 0f3a33d0f..fa1d189d4 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -189,7 +189,6 @@ void gui_get_clipboard(char **buffer, size_t *length)
struct StoredProperty *sp = NULL;
ULONG rlen=0,error;
struct CSet *cset;
- LONG codeset = 0;
if(OpenIFF(iffh,IFFF_READ)) return;
@@ -203,6 +202,7 @@ void gui_get_clipboard(char **buffer, size_t *length)
if(ci = FindCollection(iffh, ID_FTXT, ID_UTF8)) {
*buffer = ami_clipboard_cat_collection(ci, 106, length);
} else if(ci = FindCollection(iffh, ID_FTXT, ID_CHRS)) {
+ LONG codeset = 0;
if(sp = FindProp(iffh, ID_FTXT, ID_CSET)) {
cset = (struct CSet *)sp->sp_Data;
codeset = cset->CodeSet;
diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c
index 1d3092806..779e1bcf8 100644
--- a/amiga/dt_picture.c
+++ b/amiga/dt_picture.c
@@ -174,7 +174,6 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
UBYTE *bm_buffer;
Object *dto;
struct bitmap *bitmap;
- unsigned int bm_flags = BITMAP_NEW;
#ifdef __amigaos4__
int bm_format = PBPAFMT_RGBA;
#else
@@ -184,7 +183,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
if(dto = amiga_dt_picture_newdtobject(adt))
{
- bitmap = bitmap_create(c->width, c->height, bm_flags);
+ bitmap = bitmap_create(c->width, c->height, BITMAP_NEW);
if (!bitmap) {
msg_data.error = messages_get("NoMemory");
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
diff --git a/amiga/file.c b/amiga/file.c
index 5d16ceb13..008141c42 100644
--- a/amiga/file.c
+++ b/amiga/file.c
@@ -149,23 +149,19 @@ void ami_file_save(int type, char *fname, struct Window *win,
struct hlcache_handle *object, struct hlcache_handle *favicon,
struct browser_window *bw)
{
- BPTR lock = 0;
+ BPTR lock, fh;
const char *source_data;
ULONG source_size;
struct bitmap *bm;
- BPTR fh=0;
ami_update_pointer(win, GUI_POINTER_WAIT);
- if(ami_download_check_overwrite(fname, win, 0))
- {
- switch(type)
- {
+ if(ami_download_check_overwrite(fname, win, 0)) {
+ switch(type) {
case AMINS_SAVE_SOURCE:
- if((source_data = content_get_source_data(object, &source_size)))
- {
- if(fh = FOpen(fname, MODE_NEWFILE,0))
- {
+ if((source_data = content_get_source_data(object, &source_size))) {
+ BPTR fh;
+ if(fh = FOpen(fname, MODE_NEWFILE,0)) {
FWrite(fh, source_data, 1, source_size);
FClose(fh);
}
@@ -177,8 +173,7 @@ void ami_file_save(int type, char *fname, struct Window *win,
break;
case AMINS_SAVE_COMPLETE:
- if(lock = CreateDir(fname))
- {
+ if(lock = CreateDir(fname)) {
UnLock(lock);
save_complete(object, fname, ami_file_set_type);
amiga_icon_superimpose_favicon(fname, favicon, NULL);
@@ -193,15 +188,13 @@ void ami_file_save(int type, char *fname, struct Window *win,
break;
case AMINS_SAVE_IFF:
- if((bm = content_get_bitmap(object)))
- {
+ if((bm = content_get_bitmap(object))) {
bm->url = (char *)nsurl_access(hlcache_handle_get_url(object));
bm->title = (char *)content_get_title(object);
bitmap_save(bm, fname, 0);
}
#ifdef WITH_NS_SVG
- else if(ami_mime_compare(object, "svg") == true)
- {
+ else if(ami_mime_compare(object, "svg") == true) {
ami_save_svg(object, fname);
}
#endif
diff --git a/amiga/filetype.c b/amiga/filetype.c
index bcb6b7e87..2d55e1f8e 100644
--- a/amiga/filetype.c
+++ b/amiga/filetype.c
@@ -55,9 +55,7 @@ enum
const char *fetch_filetype(const char *unix_path)
{
static char mimetype[50];
- STRPTR ttype = NULL;
struct DiskObject *dobj = NULL;
- BPTR lock = 0;
struct DataType *dtn;
BOOL found = FALSE;
lwc_string *lwc_mimetype;
@@ -66,8 +64,7 @@ const char *fetch_filetype(const char *unix_path)
We'll just do a filename check here for quickness, although the
first word ought to be checked against WB_DISKMAGIC really. */
- if(strncmp(unix_path + strlen(unix_path) - 5, ".info", 5) == 0)
- {
+ if(strncmp(unix_path + strlen(unix_path) - 5, ".info", 5) == 0) {
strcpy(mimetype,"image/x-amiga-icon");
found = TRUE;
}
@@ -76,32 +73,26 @@ const char *fetch_filetype(const char *unix_path)
/* Secondly try getting a tooltype "MIMETYPE" and use that as the MIME type.
Will fail over to default icons if the file doesn't have a real icon. */
- if(!found)
- {
+ if(!found) {
if(dobj = GetIconTags(unix_path,ICONGETA_FailIfUnavailable,FALSE,
- TAG_DONE))
- {
+ TAG_DONE)) {
+ STRPTR ttype = NULL;
ttype = FindToolType(dobj->do_ToolTypes, "MIMETYPE");
- if(ttype)
- {
+ if(ttype) {
strcpy(mimetype,ttype);
found = TRUE;
}
-
FreeDiskObject(dobj);
}
}
/* If that didn't work, use the MIME file and DataTypes */
- if(!found)
- {
- if (lock = Lock (unix_path, ACCESS_READ))
- {
- if (dtn = ObtainDataTypeA (DTST_FILE, (APTR)lock, NULL))
- {
- if(ami_mime_from_datatype(dtn, &lwc_mimetype, NULL))
- {
+ if(!found) {
+ BPTR lock;
+ if (lock = Lock (unix_path, ACCESS_READ)) {
+ if (dtn = ObtainDataTypeA (DTST_FILE, (APTR)lock, NULL)) {
+ if(ami_mime_from_datatype(dtn, &lwc_mimetype, NULL)) {
strcpy(mimetype, lwc_string_data(lwc_mimetype));
found = TRUE;
ReleaseDataType(dtn);
diff --git a/amiga/font_scan.c b/amiga/font_scan.c
index f3ad36e6f..a2738f208 100644
--- a/amiga/font_scan.c
+++ b/amiga/font_scan.c
@@ -294,7 +294,7 @@ ULONG ami_font_scan_fonts(struct MinList *list,
*/
ULONG ami_font_scan_list(struct MinList *list)
{
- int afShortage, afSize = 100, i;
+ int afShortage, afSize = 100;
struct AvailFontsHeader *afh;
struct AvailFonts *af;
ULONG found = 0;
@@ -315,7 +315,7 @@ ULONG ami_font_scan_list(struct MinList *list)
if(afh) {
af = (struct AvailFonts *)&(afh[1]);
- for(i = 0; i < afh->afh_NumEntries; i++) {
+ for(int i = 0; i < afh->afh_NumEntries; i++) {
if(af[i].af_Attr.ta_Style == FS_NORMAL) {
if(af[i].af_Attr.ta_Name != NULL) {
node = (struct nsObject *)FindIName((struct List *)list,
diff --git a/amiga/launch.c b/amiga/launch.c
index 0d25bcf32..1ccc52026 100755
--- a/amiga/launch.c
+++ b/amiga/launch.c
@@ -126,7 +126,6 @@ void gui_launch_url(const char *url)
{
APTR procwin = SetProcWindow((APTR)-1L);
char *launchurl = NULL;
- BPTR fptr = 0;
if(ami_openurl_check_list(&ami_unsupportedprotocols, url) == FALSE)
{
@@ -135,7 +134,7 @@ void gui_launch_url(const char *url)
URL_OpenA((STRPTR)url,NULL);
} else {
if(launchurl = ASPrintf("URL:%s",url)) {
- fptr = Open(launchurl,MODE_OLDFILE);
+ BPTR fptr = Open(launchurl,MODE_OLDFILE);
if(fptr) Close(fptr);
else ami_openurl_add_protocol(url);
FreeVec(launchurl);
diff --git a/amiga/menu.c b/amiga/menu.c
index 234a95855..b2e233415 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -1093,13 +1093,13 @@ static void ami_menu_item_arexx_entries(struct Hook *hook, APTR window, struct I
char *script = hook->h_Data;
char *temp;
struct gui_window_2 *gwin;
- BPTR lock = 0;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
if(script)
{
if(temp = AllocVecTagList(1024, NULL))
{
+ BPTR lock;
if(lock = Lock(nsoption_charp(arexx_dir), SHARED_LOCK)) {
DevNameFromLock(lock, temp, 1024, DN_FULLPATH);
AddPart(temp, script, 1024);
@@ -1110,3 +1110,4 @@ static void ami_menu_item_arexx_entries(struct Hook *hook, APTR window, struct I
}
}
}
+
diff --git a/amiga/misc.c b/amiga/misc.c
index c25c5d59d..3f6983476 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -43,7 +43,6 @@ void warn_user(const char *warning, const char *detail)
Object *req = NULL;
char *utf8warning = ami_utf8_easy(messages_get(warning));
STRPTR bodytext = NULL;
- LONG result = 0;
LOG(("%s %s", warning, detail));
@@ -63,7 +62,7 @@ void warn_user(const char *warning, const char *detail)
TAG_DONE);
if (req) {
- result = IDoMethod(req, RM_OPENREQ, NULL, NULL, scrn);
+ LONG result = IDoMethod(req, RM_OPENREQ, NULL, NULL, scrn);
DisposeObject(req);
}
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 0893c552c..de9075552 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -473,8 +473,6 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
LOG(("[ami_plotter] Entered ami_polygon()"));
#endif
- int k;
-
if((nsoption_int(cairo_renderer) < 1) || (palette_mapped == true))
{
ULONG cx,cy;
@@ -484,7 +482,7 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
if(AreaMove(glob->rp,p[0],p[1]) == -1)
LOG(("AreaMove: vector list full"));
- for(k=1;k<n;k++)
+ for(int k = 1; k < n; k++)
{
if(AreaDraw(glob->rp,p[k*2],p[(k*2)+1]) == -1)
LOG(("AreaDraw: vector list full"));
@@ -501,7 +499,7 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
cairo_set_line_width(glob->cr, 0);
cairo_move_to(glob->cr, p[0], p[1]);
- for (k = 1; k != n; k++) {
+ for (int k = 1; k != n; k++) {
cairo_line_to(glob->cr, p[k * 2], p[k * 2 + 1]);
}
cairo_fill(glob->cr);
diff --git a/amiga/theme.c b/amiga/theme.c
index e00e08090..054d46521 100644
--- a/amiga/theme.c
+++ b/amiga/theme.c
@@ -289,7 +289,7 @@ void ami_init_mouse_pointers(void)
for(i=0;i<=AMI_LASTPOINTER;i++)
{
- BPTR ptrfile = 0;
+ BPTR ptrfile;
mouseptrbm[i] = NULL;
mouseptrobj[i] = NULL;
char ptrfname[1024];