kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2_loaders.git/commit/?id=c4750cbcb7f54a4b87d579cdb586cf82e00caec1

commit c4750cbcb7f54a4b87d579cdb586cf82e00caec1
Author: Kim Woelders <k...@woelders.dk>
Date:   Mon Jan 18 17:36:21 2021 +0100

    EET loader: Fix build + stuff
    
    Several changes were not properly incorporated in this loader.
    
    Noted by Andrew Savchenko
    
    Also add back im->key check previously dropped by mistake.
---
 src/modules/loaders/loader_eet.c | 28 ++++++----------------------
 1 file changed, 6 insertions(+), 22 deletions(-)

diff --git a/src/modules/loaders/loader_eet.c b/src/modules/loaders/loader_eet.c
index 95f9d33..ea7e62d 100644
--- a/src/modules/loaders/loader_eet.c
+++ b/src/modules/loaders/loader_eet.c
@@ -6,11 +6,6 @@
 
 #include "loader_common.h"
 
-#define SWAP32(x) (x) = \
-((((x) & 0x000000ff ) << 24) |\
- (((x) & 0x0000ff00 ) << 8) |\
- (((x) & 0x00ff0000 ) >> 8) |\
- (((x) & 0xff000000 ) >> 24))
 #include <Eet.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -42,11 +37,7 @@ exists(char *file)
 static int
 can_read(char *file)
 {
-#ifndef __EMX__
    if (!(permissions(file) & (S_IRUSR | S_IRGRP | S_IROTH)))
-#else
-   if (!(permissions(file)))
-#endif
       return 0;
    return (1 + access(file, R_OK));
 }
@@ -54,11 +45,7 @@ can_read(char *file)
 static int
 can_write(char *file)
 {
-#ifndef __EMX__
    if (!(permissions(file) & (S_IWUSR | S_IWGRP | S_IWOTH)))
-#else
-   if (!(permissions(file)))
-#endif
       return 0;
    return (1 + access(file, W_OK));
 }
@@ -73,6 +60,9 @@ load(ImlibImage * im, ImlibProgressFunction progress,
    DATA32             *ret;
    DATA32             *body;
 
+   if (!im->key)
+      return 0;
+
    strcpy(file, im->real_file);
    strcpy(key, im->key);
    if (!can_read(file))
@@ -372,18 +362,12 @@ save(ImlibImage * im, ImlibProgressFunction progress, 
char progress_granularity)
    /* finish off */
    eet_close(ef);
    return 1;
-   progress_granularity = 0;
 }
 
 void
 formats(ImlibLoader * l)
 {
-   static const char  *const list_formats[] = { "eet" };
-   int                 i;
-
-   l->num_formats = sizeof(list_formats) / sizeof(char *);
-   l->formats = malloc(sizeof(char *) * l->num_formats);
-
-   for (i = 0; i < l->num_formats; i++)
-      l->formats[i] = strdup(list_formats[i]);
+   static const char  *const list_formats[] = { "ani" };
+   __imlib_LoaderSetFormats(l, list_formats,
+                            sizeof(list_formats) / sizeof(char *));
 }

-- 


Reply via email to