Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/eet

Dir     : e17/libs/eet/src/bin


Modified Files:
        eet_bench_main.c eet_main.c 


Log Message:


whitespace + unsigned

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/eet/src/bin/eet_bench_main.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- eet_bench_main.c    10 May 2005 13:35:32 -0000      1.1
+++ eet_bench_main.c    23 May 2005 04:32:03 -0000      1.2
@@ -1,3 +1,6 @@
+/* strdup requires BSD source */
+#define _BSD_SOURCE
+
 #include "Eet.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -16,7 +19,7 @@
 get_time(void)
 {
    struct timeval      timev;
-   
+
    gettimeofday(&timev, NULL);
    return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
 }
@@ -30,7 +33,10 @@
    int items_num;
    int i;
    double t1, t2;
-   
+
+   if (argc < 2)
+     exit(-1);
+
    file = argv[1];
    ef = eet_open(file, EET_FILE_MODE_READ);
    if (ef)
@@ -45,16 +51,17 @@
        printf("EEK. cannot load %s\n", file);
        exit(-1);
      }
-   
+
    t1 = get_time();
    ef = eet_open(file, EET_FILE_MODE_READ);
    if (ef)
      {
        for (i = 0; i < items_num; i++)
          {
-            int w, h, alpha, compress, quality, lossy;
+            int alpha, compress, quality, lossy;
+            unsigned int w, h;
             void *data;
-            
+
             if (eet_data_image_header_read(ef, items[i], &w, &h, &alpha, 
&compress, &quality, &lossy))
               {
                  data = eet_data_image_read(ef, items[i], &w, &h, &alpha, 
&compress, &quality, &lossy);
@@ -81,9 +88,10 @@
    t1 = get_time();
    for (i = 0; i < items_num; i++)
      {
-       int w, h, alpha, compress, quality, lossy;
+       int alpha, compress, quality, lossy;
+       unsigned int w, h;
        void *data;
-       
+
        ef = eet_open(file, EET_FILE_MODE_READ);
        if (ef)
          {
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/eet/src/bin/eet_main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- eet_main.c  31 Mar 2005 08:36:10 -0000      1.6
+++ eet_main.c  23 May 2005 04:32:03 -0000      1.7
@@ -1,3 +1,6 @@
+/* PATH_MAX requires POSIX source */
+#define _POSIX_SOURCE
+
 #include "Eet.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -51,31 +54,31 @@
    int size;
    FILE *f;
    Blah *blah_in;
-   
+
    edd3 = eet_data_descriptor_new("blah3", sizeof(Blah3),
-                                 evas_list_next, 
-                                 evas_list_append, 
-                                 evas_list_data, 
+                                 evas_list_next,
+                                 evas_list_append,
+                                 evas_list_data,
                                  evas_list_free,
                                  evas_hash_foreach,
                                  evas_hash_add,
                                  evas_hash_free);
    EET_DATA_DESCRIPTOR_ADD_BASIC(edd3, Blah3, "string3", string, EET_T_STRING);
-   
+
    edd2 = eet_data_descriptor_new("blah2", sizeof(Blah2),
-                                 evas_list_next, 
-                                 evas_list_append, 
-                                 evas_list_data, 
+                                 evas_list_next,
+                                 evas_list_append,
+                                 evas_list_data,
                                  evas_list_free,
                                  evas_hash_foreach,
                                  evas_hash_add,
                                  evas_hash_free);
    EET_DATA_DESCRIPTOR_ADD_BASIC(edd2, Blah2, "string2", string, EET_T_STRING);
-   
+
    edd = eet_data_descriptor_new("blah", sizeof(Blah),
-                                 evas_list_next, 
-                                 evas_list_append, 
-                                 evas_list_data, 
+                                 evas_list_next,
+                                 evas_list_append,
+                                 evas_list_data,
                                  evas_list_free,
                                  evas_hash_foreach,
                                  evas_hash_add,
@@ -91,9 +94,9 @@
    EET_DATA_DESCRIPTOR_ADD_LIST (edd, Blah, "blah3", blah3, edd3);
 
    blah3.string="PANTS";
-   
+
    blah2.string="subtype string here!";
-   
+
    blah.character='7';
    blah.sixteen=0x7777;
    blah.integer=0xc0def00d;
@@ -109,14 +112,14 @@
    blah.blah3 = evas_list_append(blah.blah3, &blah3);
    blah.blah3 = evas_list_append(blah.blah3, &blah3);
    blah.blah3 = evas_list_append(blah.blah3, &blah3);
-   
+
    data = eet_data_descriptor_encode(edd, &blah, &size);
    f = fopen("out", "wb");
    if (f)
      {
        fwrite(data, size, 1, f);
        fclose(f);
-     }      
+     }
    printf("-----DECODING\n");
    blah_in = eet_data_descriptor_decode(edd, data, size);
    printf("-----DECODED!\n");
@@ -131,11 +134,11 @@
    printf("  %s\n", blah_in->blah2->string);
      {
        Evas_List *l;
-       
+
        for (l = blah_in->blah3; l; l = l->next)
          {
             Blah3 *blah3_in;
-            
+
             blah3_in = l->data;
             printf("%p\n", blah3_in);
             printf("  %s\n", blah3_in->string);
@@ -144,7 +147,7 @@
    eet_data_descriptor_free(edd);
    eet_data_descriptor_free(edd2);
    eet_data_descriptor_free(edd3);
-   
+
    exit(0);
 }
 #endif
@@ -181,7 +184,7 @@
 {
    char ss[PATH_MAX];
    int  i, ii;
-   
+
    i = 0;
    ii = 0;
    while (s[i])
@@ -199,14 +202,14 @@
    void *data;
    int size;
    char *last;
-   
+
    data = eet_read(ef, file, &size);
    if (data)
      {
        FILE *f;
        char buf[PATH_MAX];
        int len;
-       
+
        strncpy(buf, file, sizeof(buf) - 1);
        buf[sizeof(buf) - 1] = 0;
        if (buf[0] == '/') return;
@@ -219,12 +222,12 @@
             if (!strcmp(&(buf[len - 3]), "/..")) return;
          }
        last = strrchr(buf, '/');
-       if (last) 
+       if (last)
          {
             last[1] = 0;
             eet_mkdirs(buf);
          }
-         
+
        f = fopen(file, "wb");
        if (f)
          {
@@ -248,8 +251,8 @@
    int i, num;
    char **list;
    Eet_File *ef;
-   
-   ef = eet_open(pak_file, EET_FILE_MODE_READ);   
+
+   ef = eet_open(pak_file, EET_FILE_MODE_READ);
    if (!ef)
      {
        printf("cannot open for reading: %s\n", pak_file);
@@ -262,7 +265,7 @@
          depak_file(ef, list[i]);
        free(list);
      }
-   eet_close(ef);   
+   eet_close(ef);
 }
 
 void
@@ -271,8 +274,8 @@
    int i, num;
    char **list;
    Eet_File *ef;
-   
-   ef = eet_open(pak_file, EET_FILE_MODE_READ);   
+
+   ef = eet_open(pak_file, EET_FILE_MODE_READ);
    if (!ef)
      {
        printf("cannot open for reading: %s\n", pak_file);
@@ -285,29 +288,29 @@
          printf("%s\n",list[i]);
        free(list);
      }
-   eet_close(ef);   
+   eet_close(ef);
 }
 
 void
 pak_file(Eet_File *ef, char *file, char **noz, int noz_num)
 {
    struct stat st;
-   
+
    if (stat(file, &st) >= 0)
      {
        void *buf;
-       
+
        buf = malloc(st.st_size);
        if (buf)
          {
             FILE *f;
-            
+
             f = fopen(file, "rb");
             if (f)
               {
                  int compress = 1;
                  int i;
-                 
+
                  for (i = 0; i < noz_num; i++)
                    {
                       if (!fnmatch(noz[i], file, 0))
@@ -347,7 +350,7 @@
        while ((dp = readdir(dirp)))
          {
             char buf[PATH_MAX];
-            
+
             if ((!strcmp(".", dp->d_name)) || (!strcmp("..", dp->d_name)))
               {
               }
@@ -365,7 +368,7 @@
 {
    Eet_File *ef;
    int i;
-   
+
    ef = eet_open(pak_file, EET_FILE_MODE_WRITE);
    if (!ef)
      {
@@ -379,7 +382,7 @@
 
 int
 main(int argc, char **argv)
-{   
+{
    if (argc == 3)
      {
        if (!strcmp(argv[1], "-d"))
@@ -397,11 +400,11 @@
      {
        char **noz     = NULL;
        int    noz_num = 0;
-       
+
        if (!strcmp(argv[1], "-c"))
          {
             int i;
-            
+
             for (i = 3; i < argc; i++)
               {
                  if (!strcmp(argv[i], "-nz"))




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to